Mistral Provider
The Mistral provider gives you access to Mistral AI’s models, including general-purpose language models, vision models, and specialized coding models.Configuration
API Key Setup
Set your Mistral API key in your.env file:
config/llm-magic.php:
Available Models
LLM Magic supports the following Mistral models:Language Models
- mistral-large-latest - Most powerful Mistral model
- mistral-medium-latest - Balanced performance
- mistral-small-latest - Fast and efficient
- mistral-saba-latest - Specialized Saba model
Vision Models (Pixtral)
- pixtral-large-latest - Large vision model
- pixtral-12b-2409 - 12B parameter vision model
Code Models
- codestral-latest - Specialized coding model
Compact Models (Ministral)
- ministral-3b-latest - 3B parameter compact model
- ministral-8b-latest - 8B parameter compact model
Research Models
- open-mistral-nemo - Mistral Nemo research model
- open-codestral-mamba - Codestral Mamba research model
Model Constants
Use these constants for type safety:Usage
Using the Constructor
Create a Mistral model instance:Getting Available Models
Retrieve a list of all available Mistral models:API Configuration
Mistral uses the OpenAI-compatible API with a custom base URI:Organization Info
The Mistral provider includes organization metadata:- ID:
mistral - Name: Mistral
- Website: https://mistral.ai
- Privacy: Data may be used for model training and abuse prevention
Vision Support
Pixtral models support vision capabilities with image inputs.Image Limit
Mistral models are limited to 8 images per request:HasMaximumImageCount interface.
Model Selection Guide
General Language Tasks
- Mistral Large: Most powerful, best for complex reasoning
- Mistral Medium: Balanced performance and cost
- Mistral Small: Fast and cost-effective for simple tasks
Vision Tasks
- Pixtral Large: Best vision capabilities
- Pixtral 12B: Faster vision processing
Code Generation
- Codestral: Optimized for code generation and completion
- Codestral Mamba (Research): Experimental coding model
Edge/On-Device
- Ministral 3B: Smallest model for resource-constrained environments
- Ministral 8B: Better performance while still compact
Research
- Mistral Nemo: Open research model for experimentation
- Codestral Mamba: Research model with Mamba architecture
Advanced Options
You can pass additional options usingChatGptOptions: