Skip to content

Conversation

@kwibus
Copy link
Contributor

@kwibus kwibus commented Oct 13, 2025

Description

Call mistral v1/models to get up to date list of models. And check which capabilities they have

Screenshots

screenshot_2025-10-13+02:10:17

TODO

Proof of concept work, But there are still thing i need to work on

  • Does mistral use same api for models as openai? no it does not expose capabilties
  • Mistral v1/models has lots of duplicates, that removed via dedup function. is bit ugly. I am happy with it now
  • Manual remove models with ocr, embed, because i have tested they won`t work for chat.
    Is there documentation which models should work with chat? Can this be implemented in cleaner way?
  • Copied logic, from olama get_models. Double check its logic. doe we need all of it. can we reuse components
  • How to pick good default model: Should keept outside merge request
  • cleanup: remove env.models_endpoint overkill
  • filter out deprecated models
  • cleanup: model opts like vision and can_use_tools are set after setup. This might have downsides.
    For example: you either never get the error message like
    "The image Slash Command is not enabled for this adapter" because it thinks all models can use vision. because it
    uses opts.vision. set before setup.
    might be worth it to solve it like get_models.check_thinking_capability
  • check contribution guidelines
  • Add test
  • Update documentation

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I've added test coverage for this fix/feature
  • I've run make all to ensure docs are generated, tests pass and my formatting is applied
  • (optional) I've updated CodeCompanion.has in the init.lua file for my new feature
  • (optional) I've updated the README and/or relevant docs pages

@olimorris
Copy link
Owner

I'll be fine to accept this PR, but we need to be able to switch off reasoning and function calling if the models don't support it, like we do with Copilot. The reason I've not allowed this in the OpenAI adapter thus far is because the models endpoint was so primitive.

@kwibus
Copy link
Contributor Author

kwibus commented Oct 13, 2025

Yeah, I my merge request I can use capabilities. to check if it support vision and tool calling.
Some models should also support reasoning. but that is not visible in the api.

    {
      "id": "voxtral-mini-latest",
      "object": "model",
      "created": 1760349603,
      "owned_by": "mistralai",
      "capabilities": {
        "completion_chat": true,
        "function_calling": false,
        "completion_fim": false,
        "fine_tuning": false,
        "vision": false,
        "ocr": false,
        "classification": false,
        "moderation": false,
        "audio": false
      },
      "name": "voxtral-mini-transcribe-2507",
      "description": "A mini transcription model released in July 2025",
      "max_context_length": 16384,
      "aliases": [
        "voxtral-mini-transcribe-2507",
        "voxtral-mini-2507"
      ],
      "deprecation": null,
      "deprecation_replacement_model": null,
      "default_model_temperature": 0.0,
      "type": "base"
    }

I wanted to check if openai worked the same way. But they don't have capabilities field.

    {
    "id": "gpt-5-pro-2025-10-06",
    "object": "model",
    "created": 1759469707,
    "owned_by": "system"
  },

There are still models like:

* ministral-3b-2410 that incorrect say it does not support chat.
* mistral-ocr-latest that incorrect say it does support chat.

Asked around on mistral discord. And they confirmed this a bug. And told
my the raised a issue in the bug tracker.
Those model still work. But list of models is already on the long side.
This will make list short, And remove models which have a better
version
No reason for the user to overwrite this.
@kwibus kwibus force-pushed the add-mistral-get-models branch 2 times, most recently from 61173ce to bad6a7d Compare October 19, 2025 15:46
@kwibus
Copy link
Contributor Author

kwibus commented Oct 19, 2025

I am relatively happy with how the code is now:
But I still have some question comments about it:

  • I don't know a smart and easy way to pick the best default Mistral Model. So I kept it the same mistral-small-latest
    But maybe devstral-small-latest or devstral-medium-latest would be a better fit

  • will be fixed by Add Icons to model and adapter selector to indicate capabilities #2299: A weakness for the current setup is that:
    when a User picks a model: the user can't easily see what what features the model supports.
    Might be a idea for the future to add icons to indicate if the model/adapter support's vision, tool calling, streaming and reasoning?, Things as context window

  • Just a idee I did not generate a custom error message if env.api_key was not set.
    I Could add if you want?

    Maybe an idea for later.: you could modify env_replaced so it supports:

    env = {
       api_key = "manditory: MISTRAL_API_KEY"
    }

    That would generate a generic error message if key is not set.
    The error message could include which env. key was missing for which adapter. and could reference to the documentation for how to set it. or even prompt for it.

  • I see a small problem with how copilot and now mistral expose the capabilities like vision:
    If you try to use /image for adapter that does not support vision like deepseek you get the warning: The image Slash Command is not enabled for this adapter
    But if the adapter supports it but the model does not. like copilot with 03-mini You don't get any warnings.

  • No longer revevan after feat: Adds tools for mistral #2278: After I ran make doc it did not only add my changes from doc/usage/chat-buffer/tools.md to
    doc/codecompanion.txt
    it also removed some special symbols. Don't know if this is intended?

@kwibus kwibus marked this pull request as ready for review October 19, 2025 16:12
@olimorris olimorris added the P3 Low impact, low urgency label Oct 19, 2025
@kwibus kwibus force-pushed the add-mistral-get-models branch from 94a5dfe to 1a4a2ca Compare October 28, 2025 23:10
@olimorris olimorris added P4 Negligible impact and urgency and removed P3 Low impact, low urgency labels Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P4 Negligible impact and urgency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants