jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Automatically determine latest language models

Open InAnYan opened this issue 5 months ago β€’ 13 comments

Is your suggestion for improvement related to a problem? Please describe.

The field of AI/LLM is constantly improving, more and more models are available now. However, specific LLM models are hardcoded in JabRef, and maintainers sometimes don't have time to properly update everything. In any case, manual resolution and hardcoded values smells.

Describe the solution you'd like

Implement any automatic way of determining the latest LLM models into JabRef, so that maintainers and users don't have to update anything.

Additional context

This is an engineering task, as, at the moment of writing this issue, I don't have any concrete ideas to implement. A contributor should research the ways on their own

InAnYan avatar Sep 12 '25 10:09 InAnYan

A similar issue is for embedding models (https://github.com/JabRef/jabref/issues/12240), but I suspect that this issue is easier to solve

InAnYan avatar Sep 12 '25 10:09 InAnYan

I think currently, the only hard-coded models are remote (closed-source) model providers, apart from the list of embedding models that we query via the DeepJavaLibrary framework. In general, we use lang-chain.

Here are some parts of the code where we hard-code the models: https://github.com/JabRef/jabref/blob/ed1b43307138ba509bd6aaf4c04b720c39afbfb5/jablib/src/main/java/org/jabref/logic/ai/AiDefaultPreferences.java#L64-L70

For open models, we currently offer usage via the OpenAI API, although that's a littel roundabout. For open models, if we were to implement a proper backend, the models (as file) very simply could be downloaded and imported into JabRef.

ThiloteE avatar Sep 12 '25 11:09 ThiloteE

BTW, there is no limitation to selected chat model. In any case, if user wants a custom model, the field "Model" is editable and doesn't enforce the hardcoded values

InAnYan avatar Sep 12 '25 11:09 InAnYan

So it works, if you type in the latest SOTA model? Maybe we should then just let the user create a model card that they can save, so that they don't have to type it in repeatedly.

ThiloteE avatar Sep 12 '25 11:09 ThiloteE

Idea proposed by Siedlerchr: "Use API to query available models".

My comments:

hmmm, we could use, but:

- each provider should be asked in its own way
- some providers may not have such route
- this functionality might not be present in langchain

but this is a reasonable route

InAnYan avatar Sep 12 '25 11:09 InAnYan

Mistral has "latest" as option for modelnames: https://docs.mistral.ai/getting-started/models/models_overview/#api-versioning Using this option reduces maintenance overhead for JabRef maintainers, but has the drawback of silent updates breaking user workflows.

As of 2025-09-12:

API versioning

Mistral AI API are versions with specific release dates. To prevent any disruptions due to model updates and breaking changes, it is recommended to use the dated versions of the Mistral AI API. Additionally, be prepared for the deprecation of certain endpoints in the coming months.

Here are the details of the available versions:

  • magistral-medium-latest: currently points to magistral-medium-2507.
  • magistral-small-latest: currently points to magistral-small-2507.
  • mistral-medium-latest: currently points to mistral-medium-2508.
  • mistral-large-latest: currently points to mistral-medium-2508, previously mistral-large-2411.
  • pixtral-large-latest: currently points to pixtral-large-2411.
  • mistral-moderation-latest: currently points to mistral-moderation-2411.
  • ministral-3b-latest: currently points to ministral-3b-2410.
  • ministral-8b-latest: currently points to ministral-8b-2410.
  • open-mistral-nemo: currently points to open-mistral-nemo-2407.
  • mistral-small-latest: currently points to mistral-small-2506.
  • devstral-small-latest: currently points to devstral-small-2507
  • devstral-medium-latest: currently points to devstral-medium-2507
  • mistral-saba-latest: currently points to mistral-saba-2502.
  • codestral-latest: currently points to codestral-2508.
  • mistral-ocr-latest: currently points to mistral-ocr-2505.
  • voxtral-small-latest: currently points to voxtral-small-2507.
  • voxtral-mini-latest: currently points to voxtral-mini-2507.

ThiloteE avatar Sep 12 '25 12:09 ThiloteE

Based on llama.cpp, if model providers follow the OpenAI API, one can query model info like this:

OpenAI-compatible API Endpoints

GET /v1/models: OpenAI-compatible Model Info API

Returns information about the loaded model. See OpenAI Models API documentation.

The returned list always has one single element. The meta field can be null (for example, while the model is still loading).

By default, model id field is the path to model file, specified via -m. You can set a custom value for model id field via --alias argument. For example, --alias gpt-4o-mini.

Example:

{
    "object": "list",
    "data": [
        {
            "id": "../models/Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf",
            "object": "model",
            "created": 1735142223,
            "owned_by": "llamacpp",
            "meta": {
                "vocab_type": 2,
                "n_vocab": 128256,
                "n_ctx_train": 131072,
                "n_embd": 4096,
                "n_params": 8030261312,
                "size": 4912898304
            }
        }
    ]
}

17:34]3Simplex: /v1/models [17:35]3Simplex: /v1 (is automatic) Then you use /models as the enpoint for loading all served model info. [17:36]3Simplex: This can be used to auto populate models and few settings (context max, etc..) [17:37]3Simplex: In llama.cpp, you can use /props to get all properties of a model. Also if the server is started with --props it enables setting them from your application. [17:37]3Simplex: In combination these can be used to auto populate the entire model settings. [17:38]3Simplex: /health will allow you to determine if a model is online when you open your program. This will let you know if your server is accessible.

https://github.com/ggml-org/llama.cpp/blob/f4e664f838cc65d89fa845c48c372e43852112e4/tools/server/README.md?plain=1#L1144C1-L1144C35

ThiloteE avatar Sep 12 '25 15:09 ThiloteE

langchain4j currently has this enum https://github.com/langchain4j/langchain4j/blob/main/langchain4j-open-ai/src/main/java/dev/langchain4j/model/openai/OpenAiChatModelName.java

And Mistral has a method availableModels but the others not really

Ollama

https://github.com/langchain4j/langchain4j/blob/7cfba035c097c9403d94bcc0e19e5ea44270e23b/langchain4j-ollama/src/main/java/dev/langchain4j/model/ollama/OllamaModels.java#L32

Siedlerchr avatar Sep 12 '25 16:09 Siedlerchr

Hello @InAnYan, I would like to work on this issue/feature if it's still available.

st-rm-ng avatar Oct 10 '25 17:10 st-rm-ng

πŸ‘‹ Hey @st-rm-ng, looks like you’re eager to work on this issue β€” great! πŸŽ‰ It also looks like you don't know how to assign issues to yourself. Please read our CONTRIBUTING.md to find out how. It will also guide you in other aspects of contributing to JabRef.

github-actions[bot] avatar Oct 10 '25 17:10 github-actions[bot]

/assign-me

st-rm-ng avatar Oct 10 '25 17:10 st-rm-ng

πŸ‘‹ Hey @st-rm-ng, thank you for your interest in this issue! πŸŽ‰

We're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly.

For questions on JabRef functionality and the code base, you can consult the JabRef Guru or ask on our Gitter chat.

In case you encounter failing tests during development, please check our developer FAQs!

Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback.

Happy coding! πŸš€

github-actions[bot] avatar Oct 10 '25 17:10 github-actions[bot]

⏰ Assignment Reminder

Hi @st-rm-ng, this is a friendly reminder about your assignment to this issue.

[!WARNING] This issue will be automatically unassigned in 11 days if there's no activity.

Remember that you can ask the JabRef Guru or DeepWiki about anything regarding JabRef. Additionally, our contributing guide has hints on creating a pull request and a link to our Gitter chat.

How to keep your assignment


If you are working on it, you can prevent automatic unassignment by:

  • Submitting a draft pull request with your progress within 11 days
  • Asking for the πŸ“Œ Pinned label if you need more time

We appreciate your contribution and are here to help if needed!

github-actions[bot] avatar Oct 20 '25 12:10 github-actions[bot]