Overview
The Mistral provider gives you access to Mistral AI’s models for chat completion and embeddings, optimized for European languages and multilingual tasks.Installation
createMistral()
Create a Mistral provider instance.Options
string
Your Mistral API key. Defaults to
MISTRAL_API_KEY environment variable.string
Custom base URL for API requests.
Mistral
Provide your own configured Mistral client instance.
Returns
MistralProvider with methods chatModel() and embeddingModel().
Supported models
Chat models
Large Models
Large Models
- mistral-large-2512 - Latest flagship model (Mistral Large 3)
- mistral-large-2407 - Previous generation flagship
Medium Models
Medium Models
- mistral-medium-2508 - Strong performance at lower cost (Mistral Medium 3.1) - magistral-medium-latest - Reasoning-capable Magistral model
Small Models
Small Models
- mistral-small-2506 - Balanced small model - mistral-small - Quick responses - mistral-tiny - Ultra-fast, lightweight
Specialized Models
Specialized Models
- codestral - Optimized for code generation
- mixtral-8x7b - Mixture of experts architecture
- mixtral-8x22b - Larger mixture of experts
Embedding models
- mistral-embed - High-quality text embeddings
Provider support
Model capabilities
Mistral can return reasoning content from thinking-capable models, but the provider does not mapreasoning.effort into requests. Consequently,
reasoning.mode is unsupported and supportedEfforts is empty. The
reasoning option is accepted as a no-op.
Inspect the model instance or use the exported helper:
modalities.input is resolved per model. Vision families such as mistral-large,
mistral-medium, mistral-small, magistral-*, ministral-*, and pixtral-*
advertise ['text', 'image', 'file'] (image sources: base64 and url);
text-only families such as codestral, devstral-*, open-mistral-*, and
open-mixtral-* advertise ['text'] and reject images. Unrecognized model
IDs are treated as multimodal capable. modalities.output is ['text'] for
all chat models.
Lookup prefers an exact model ID and falls back to the family, ignoring the
-latest alias and the -YYMM version suffix. This matters because Mistral
added vision to each family at a specific release, so pinning an older version
reports the capabilities of that version rather than of -latest:
Examples
Basic chat
Streaming
Reasoning output
reasoning.effort is not sent to the Mistral API. Thinking-capable models
decide their own reasoning behavior and the adapter extracts the resulting
reasoning parts.Tool calling
Embeddings
Batch embeddings
Code generation
Provider-specific options
Options are namespaced undermistral in providerOptions:
Generate options
stopSequences, frequencyPenalty, presencePenalty, randomSeed, parallelToolCalls, promptMode, safePrompt.
Embed options
outputDtype ('float' | 'int8' | 'uint8' | 'binary' | 'ubinary'), encodingFormat ('float' | 'base64'), metadata.
Error handling
Related
OpenAI Provider
GPT models with reasoning effort control
Anthropic Provider
Claude models with extended thinking
Embeddings Guide
Learn how to use embeddings