Skip to content

feat: add dedicated Mistral AI provider with latest model variants#118

Closed
ThomsenDrake wants to merge 4 commits into
charmbracelet:mainfrom
ThomsenDrake:add-mistral-provider
Closed

feat: add dedicated Mistral AI provider with latest model variants#118
ThomsenDrake wants to merge 4 commits into
charmbracelet:mainfrom
ThomsenDrake:add-mistral-provider

Conversation

@ThomsenDrake

Copy link
Copy Markdown
  • Added Mistral AI provider configuration with 32 models
  • Extracted all Mistral models from OpenRouter config
  • Added -latest variants for all main model sizes (large, medium, small)
  • Added -latest variants for devstral models (medium, small)
  • Updated providers.go to include mistralProvider
  • Set API endpoint to https://api.mistral.ai/v1

Generated by Mistral Vibe.

@ThomsenDrake ThomsenDrake marked this pull request as ready for review December 9, 2025 19:16
@ThomsenDrake ThomsenDrake requested a review from a team as a code owner December 9, 2025 19:16
@ThomsenDrake ThomsenDrake requested review from raphamorim and tauraamui and removed request for a team December 9, 2025 19:16
@nikaro

nikaro commented Dec 10, 2025

Copy link
Copy Markdown

Aren't Devstral 2 and Devstral Small 2 missing ?

@ThomsenDrake

Copy link
Copy Markdown
Author

Aren't Devstral 2 and Devstral Small 2 missing ?

devstral-medium-latest is the endpoint for Devstral 2 and devstral-small-latest is the endpoint for Devstral Small 2

@gm0stache

Copy link
Copy Markdown

would love to see this merged!

@kujtimiihoxha

Copy link
Copy Markdown
Contributor

@ThomsenDrake thanks for the PR, it looks like this pr needs a rebase and also have you made sure that the changes work as expected in crush?

You can test it locally by running the catwalk server go run . Than in another tab export CATWALK_URL=http://localhost:8080/ and running crush, select the models you have added and just make sure it all works as expected.

This will help me validate the configuration too :)

ThomsenDrake and others added 4 commits January 5, 2026 10:03
- Added Mistral AI provider configuration with 32 models
- Extracted all Mistral models from OpenRouter config
- Added -latest variants for all main model sizes (large, medium, small)
- Added -latest variants for devstral models (medium, small)
- Updated providers.go to include mistralProvider
- Set API endpoint to https://api.mistral.ai/v1
- Uses tILXtdeWUWgbTX3Uwg0Flp4SVLEahdyH environment variable

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- Updated Frontier Models - Generalist pricing:
  - Mistral Large 3: /bin/sh.5/M input, .5/M output
  - Mistral Medium 3.1: /bin/sh.4/M input, /M output
  - Mistral Small 3.2: /bin/sh.1/M input, /bin/sh.3/M output
  - Ministral 3 14B: /bin/sh.2/M input, /bin/sh.2/M output
  - Ministral 3 8B: /bin/sh.15/M input, /bin/sh.15/M output
  - Ministral 3 3B: /bin/sh.1/M input, /bin/sh.1/M output

- Updated Other Models pricing:
  - Devstral Medium 1.0: /bin/sh.4/M input, /M output
  - Devstral Small 1.1: /bin/sh.1/M input, /bin/sh.3/M output
  - Mistral Medium 3: /bin/sh.4/M input, /M output
  - Mistral Large 2.1: /M input, /M output (already correct)
  - Pixtral Large: /M input, /M output (already correct)
  - Mistral Nemo 12B: /bin/sh.15/M input, /bin/sh.15/M output (already correct)
  - Codestral: /bin/sh.3/M input, /bin/sh.9/M output

- Updated -latest variants to match their corresponding models

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- Changed default_large_model_id from mistral-large to devstral-medium-latest
- Changed default_small_model_id from mistral-small to devstral-small-latest
- This makes Devstral models the default choice when using the Mistral provider

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- Remove redundant "Mistral: " prefix from non-flagship model names
- Add TypeMistral to known provider types
- Add InferenceProviderMistral to known inference providers
- Register Mistral in KnownProviders() and KnownProviderTypes()
@ThomsenDrake

Copy link
Copy Markdown
Author

Thanks for the review! I've rebased on the latest main and tested locally with crush.

Testing results:

  1. ✅ Ran go run . and confirmed the catwalk server starts successfully on :8080
  2. ✅ Verified Mistral AI provider appears in /v2/providers with all 32 models
  3. ✅ Fixed model naming - removed redundant "Mistral: " prefix from non-flagship models (Devstral, Ministral, Mixtral, etc.)
  4. ✅ Added TypeMistral and InferenceProviderMistral to the provider type constants

One issue discovered:

When testing in crush with CATWALK_URL=http://localhost:8080/, the Mistral API key validation fails with "Invalid Mistral AI API Key" even with a valid key. This appears to be a client-side validation issue in crush - the key format regex likely doesn't recognize Mistral's API key pattern (alphanumeric, no specific prefix like OpenAI's sk-).

This would need a separate fix in the crush repo to add Mistral API key format validation. The catwalk configuration itself is working correctly.

@nikaro

nikaro commented Feb 26, 2026

Copy link
Copy Markdown

@kujtimiihoxha did you had time to review the changes here?

For me i'm getting this error when starting crush with this PR catwalk server running:

> CATWALK_URL=http://localhost:8080/ crush

   ERROR

  Failed to initialize coder agent: provider type not supported: "mistral".

@romanindermuehle

Copy link
Copy Markdown

I big fan of Mistral as well. Would love to see this merged. What is the current status?

"name": "Mistral AI",
"id": "mistral",
"api_key": "$MISTRAL_API_KEY",
"api_endpoint": "https://api.mistral.ai/v1",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there is a /models endpoint available:

https://docs.mistral.ai/api/endpoint/models#operation-list_models_v1_models_get

In those cases, we prefer to have a generator to fetch and update the list for us.

AIs are usually good do create one taking the others as examples. They are all under cmd/.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @andreynering, I just took at stab at it here: #332

@andreynering

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants