Skip to content

feat(inference): add Mistral remote inference provider - #6239

Merged
mattf merged 5 commits into
ogx-ai:mainfrom
NishchayMahor:feat/mistral-inference-provider
Jul 21, 2026
Merged

feat(inference): add Mistral remote inference provider#6239
mattf merged 5 commits into
ogx-ai:mainfrom
NishchayMahor:feat/mistral-inference-provider

Conversation

@NishchayMahor

Copy link
Copy Markdown
Contributor

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 the mistral-embed embedding model through the standard inference API.

Mistral exposes an OpenAI-compatible chat-completions and embeddings API, so the adapter extends the shared OpenAIMixin pointed at https://api.mistral.ai/v1, authenticated via MISTRAL_API_KEY (or the mistral_api_key provider-data header). No new pip dependency is required.

Changes

  • providers/remote/inference/mistral/ — adapter (MistralInferenceAdapter), config (MistralImplConfig + provider-data validator), and get_adapter_impl.
  • Registered remote::mistral in providers/registry/inference.py.
  • Unit tests in tests/unit/providers/inference/test_mistral_config.py.
  • Regenerated provider docs (docs/.../inference/remote_mistral.mdx) via scripts/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).
  • Provider resolves from the registry (remote::mistral) and imports cleanly.
  • mypy and ruff clean on the new module; docs codegen produces the expected page.

Usage:

providers:
  inference:
  - provider_id: mistral
    provider_type: remote::mistral
    config:
      api_key: ${env.MISTRAL_API_KEY}

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>
mattf added 3 commits July 21, 2026 10:53
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>
@mergify

mergify Bot commented Jul 21, 2026

Copy link
Copy Markdown
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

@mergify mergify Bot added the needs-rebase label Jul 21, 2026
@mergify mergify Bot removed the needs-rebase label Jul 21, 2026

@mattf mattf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@NishchayMahor i rounded this PR out. will you do the same for your other two, #6241 & #6240?

@mattf
mattf added this pull request to the merge queue Jul 21, 2026
Merged via the queue into ogx-ai:main with commit 828bb93 Jul 21, 2026
56 checks passed
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.

2 participants