feat(inference): add Mistral remote inference provider - #6239
Merged
mattf merged 5 commits intoJul 21, 2026
Conversation
Adds a remote inference adapter for Mistral AI (remote::mistral). Mistral exposes an OpenAI-compatible chat completions and embeddings API, so the adapter extends OpenAIMixin pointed at https://api.mistral.ai/v1, keyed by MISTRAL_API_KEY. Registers the provider, adds unit tests, and regenerates the provider docs. Signed-off-by: Nishchay Mahor <nishchaymahor@gmail.com>
NishchayMahor
requested review from
bbrowning,
cdoern,
franciscojavierarceo,
leseb,
mattf,
raghotham and
skamenan7
as code owners
July 5, 2026 04:59
Mistral's /v1/embeddings endpoint accepts the encoding_format parameter but ignores it, always returning floats. Reject encoding_format='base64' with a clear ValueError instead of silently accepting a misleading parameter. Signed-off-by: Matthew Farrellee <matt@cs.wisc.edu>
Mistral does not support the legacy /v1/completions endpoint, only /v1/chat/completions. Add an openai_completion override that raises NotImplementedError with a clear message, matching the pattern used by Anthropic and Databricks providers. Signed-off-by: Matthew Farrellee <matt@cs.wisc.edu>
Signed-off-by: Matthew Farrellee <matt@cs.wisc.edu>
Contributor
|
This pull request has merge conflicts that must be resolved before it can be merged. @NishchayMahor please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork |
mattf
approved these changes
Jul 21, 2026
mattf
left a comment
Collaborator
There was a problem hiding this comment.
@NishchayMahor i rounded this PR out. will you do the same for your other two, #6241 & #6240?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a remote inference provider for Mistral AI (
remote::mistral). Mistral is a major frontier lab that wasn't yet in the inference lineup — this lets users run Mistral chat models (e.g.mistral-large-latest,mistral-small-latest,codestral-latest) and themistral-embedembedding model through the standard inference API.Mistral exposes an OpenAI-compatible chat-completions and embeddings API, so the adapter extends the shared
OpenAIMixinpointed athttps://api.mistral.ai/v1, authenticated viaMISTRAL_API_KEY(or themistral_api_keyprovider-data header). No new pip dependency is required.Changes
providers/remote/inference/mistral/— adapter (MistralInferenceAdapter), config (MistralImplConfig+ provider-data validator), andget_adapter_impl.remote::mistralinproviders/registry/inference.py.tests/unit/providers/inference/test_mistral_config.py.docs/.../inference/remote_mistral.mdx) viascripts/provider_codegen.py.Test Plan
pytest tests/unit/providers/inference/test_mistral_config.py→ 5 passed (default/custom/env base URL, sample run config, provider-data + embedding metadata).remote::mistral) and imports cleanly.mypyandruffclean on the new module; docs codegen produces the expected page.Usage: