Overview
Mistral AI provides powerful open-source and proprietary models including Mistral Large, Mixtral, and specialized coding models.Installation
Basic Usage
Constructor Options
string
required
Mistral model name
string
Mistral API key (defaults to
MISTRAL_API_KEY env variable)number
Sampling temperature
number
Maximum tokens in response
number
default:1
Nucleus sampling
Supported Models
Proprietary Models
mistral-large-latest: Most capable modelmistral-medium-latest: Balanced performancemistral-small-latest: Fast and efficient
Open Models
open-mixtral-8x7b: Mixtral 8x7B MoEopen-mixtral-8x22b: Mixtral 8x22B MoEopen-mistral-7b: Mistral 7Bopen-mistral-nemo: Mistral Nemo 12B
Specialized Models
codestral-latest: Code generationmistral-embed: Embeddings
Streaming
Function Calling
Codestral
Specialized model for code generation:Mistral Embeddings
Configuration
Environment Variables
Global Settings
With LlamaIndex
Model Selection Guide
Best Practices
- Use appropriate model: Balance cost, speed, and capability
- Leverage Codestral: Best-in-class code generation
- Monitor API usage: Track costs in console
- Stream responses: Better UX for long outputs
- Use function calling: Reliable tool integration