If you are an AIML engineer evaluating Mistral AI, the first problem is just figuring out what it actually is. Is it a chatbot competitor to ChatGPT? An open-weights lab like the early Llama releases? An API like OpenAI? A fine-tuning platform? The answer is "all of them," and that breadth is exactly what makes it confusing to know where you, as a builder, plug in.
Mistral is the European frontier lab that ships both open-weight models you can download and run yourself and a managed API platform with agents, fine-tuning, embeddings, and document AI on top. That dual nature is the whole point. You can prototype on the hosted API and later self-host the exact same model on your own hardware with EU data residency, an option most US labs do not offer. This guide maps the entire ecosystem, then goes deep on the parts a developer actually uses: the API, agents, fine-tuning, and RAG building blocks.
TLDR
- Mistral gives developers two access paths to one model family: open weights (Apache 2.0, so download, fine-tune, self-host) and La Plateforme (a hosted API with EU data residency).
- On top sit the developer products: a Chat Completions API with function calling and structured outputs, an Agents API with server-side tools (code interpreter, web search, document library) and MCP connectors.
- Fine-tuning comes in three routes: managed API, the open-source
mistral-finetuneLoRA SDK, and enterprise Forge, plus embeddings, OCR/document AI, and moderation. - Pick open weights for control and data residency. Pick the API for speed to ship.
The ecosystem at a glance#
Before the models and code, here is the whole landscape. Mistral is not one product but a stack, and knowing which layer you are touching keeps the rest of this guide oriented.
| Feature | What it is | Who uses it |
|---|---|---|
| Open-weight models | Downloadable models under Apache 2.0 you run anywhere | Engineers who need control, on-prem, or to fine-tune locally |
| La Plateforme | The hosted API + developer console, EU data residency | Developers calling models without managing GPUs |
| Mistral Studio | The web console for keys, playground, agents, connectors, fine-tuning jobs | Developers configuring and testing before they integrate |
| Le Chat / Vibe | The end-user chat + coding agent app (renamed Vibe in 2026) | End users and teams; the consumer face of the models |
| Mistral Forge | Enterprise platform to build custom models on proprietary data (pre-train, post-train, RL) | Enterprises wanting a bespoke frontier model |
| Mistral Compute | The underlying AI compute infrastructure | Large-scale training and inference customers |
For a developer, the two layers that matter day to day are the open-weight models and La Plateforme. Everything else is either an end-user surface (Vibe) or an enterprise engagement (Forge, Compute). The rest of this guide lives in those two developer layers.
The model lineup#
Mistral ships a family of models specialized by task, refreshed in the "Mistral 3" generation from late 2025 into 2026. The key distinction for a builder is open-weight vs API-only: open-weight models (Apache 2.0) can be downloaded, fine-tuned, and self-hosted; API-only "Premier" models are available only through La Plateforme.
| Feature | What it's for | Access |
|---|---|---|
| Mistral Large 3 | Flagship general-purpose multimodal reasoning (MoE, 41B active / 675B total) | Open-weight |
| Mistral Medium 3.5 | Frontier-class multimodal, optimized for agentic + coding; adjustable reasoning_effort | API-only |
| Mistral Small 4 | Hybrid 24B unifying instruct, reasoning, and coding (the workhorse) | Open-weight |
| Magistral Medium | Dedicated frontier reasoning model | API-only (Premier) |
| Devstral 2 / Devstral Small 2 | Agentic coding for real software-engineering tasks | Open-weight |
| Codestral | Low-latency code completion and fill-in-the-middle | API-only (Premier) |
| Ministral 3 (3B / 8B / 14B) | Edge and small-footprint text + vision | Open-weight |
| Voxtral / Voxtral TTS | Speech-to-text transcription and zero-shot voice-cloning TTS | Open-weight |
| Mistral Embed / Codestral Embed | Text and code embeddings for RAG and search | API-only (Premier) |
| Mistral OCR 3 | Document AI to extract structured text from PDFs and images | API-only (Premier) |
| Mistral Moderation 2 | Safety classification with jailbreak detection, 128k context | API-only (Premier) |
The practical reading: Mistral Small 4 is the default workhorse (open-weight, cheap, capable), Large 3 when you need the strongest open model, Medium 3.5 for the best agentic/coding performance via API, Magistral for hard reasoning, Devstral/Codestral for code, and the Ministral family when you need to run on the edge. Model names, sizes, and prices move quickly, so always confirm against the official models overview before committing.
Accessing the models: API, SDKs, and deployment#
There are three ways to run a Mistral model, and choosing among them is the first architectural decision.
1. La Plateforme API. The fastest path. Get an API key from Mistral Studio and call the models over HTTP. Official Python and TypeScript SDKs exist, and the endpoints are largely OpenAI-compatible, so migrating existing code is often a base-URL and key change.
from mistralai import Mistral
client = Mistral(api_key="...")
resp = client.chat.complete(
model="mistral-large-latest",
messages=[{"role": "user", "content": "Explain MoE routing in two sentences."}],
)
print(resp.choices[0].message.content)
2. Self-hosted open weights. Download an open-weight model (Large 3, Small 4, Devstral, Ministral) and serve it yourself with vLLM, TensorRT-LLM, or similar. That is the serving stack we cover in Part 2 of the fine-tuning guide. This gives you full control, no per-token cost, and data that never leaves your infrastructure.
3. Cloud marketplaces. Mistral models are also available through major cloud providers' model catalogs, which can simplify procurement and keep traffic inside an existing cloud account.
The decision: API to move fast and avoid infra; self-host for data control, cost at scale, or air-gapped/regulated environments. Because it is the same model either way, you can start on the API and migrate to self-hosting without re-architecting your prompts.
Core API capabilities#
Beyond plain chat completion, three features turn the API into a real application backend.
Function calling#
The model can call your code. You describe tools as JSON Schema in the tools parameter; the model decides when to call them and with what arguments, and returns a structured tool call for you to execute. Mistral's larger models support parallel tool calls, which is what makes them viable as agent brains.
tools = [{
"type": "function",
"function": {
"name": "get_order_status",
"description": "Look up an order's status by ID.",
"parameters": {
"type": "object",
"properties": {"order_id": {"type": "string"}},
"required": ["order_id"],
},
},
}]
resp = client.chat.complete(
model="mistral-large-latest",
messages=[{"role": "user", "content": "Where is order A123?"}],
tools=tools,
)
# resp contains a tool call; you execute get_order_status and send the result back
Structured outputs#
When you need reliable JSON (extraction, classification, anything machine-parsed), structured outputs constrain the model to a schema. There is a simple JSON mode and, more reliably, custom structured outputs where you supply a schema (or a Pydantic model) the response must conform to. This is the difference between parsing model prose with regex and getting a validated object.
Multimodal and reasoning controls#
The multimodal models accept images alongside text in the same messages array, and reasoning-capable models like Medium 3.5 expose a reasoning_effort parameter to trade latency for deeper thinking, a useful dial for balancing cost against hard-problem accuracy.
Building agents with the Agents API#
Function calling makes the model able to use tools, but you still have to run the loop, manage state, and host the tools. The Agents API (and its Conversations API) moves that work server-side. Mistral runs the agent loop, executes a set of built-in tools for you, persists conversation state, and orchestrates multiple agents. This is Mistral's answer to "I don't want to build agent plumbing from scratch."
The built-in, server-executed tools are the headline feature:
- Code Interpreter runs Python in a secure sandbox for computation, data analysis, and chart generation.
- Web Search grounds answers in current information from the web and news sources.
- Image Generation produces images inline.
- Document Library answers from documents you have uploaded (managed RAG, no vector DB to run).
On top of built-ins, the Agents API supports MCP connectors, the open Model Context Protocol, so you register your own tools (internal APIs, databases, SaaS systems) as MCP servers and the model discovers and calls them automatically. It also supports handoffs, where one agent transfers a conversation to a more specialized agent, letting you compose multi-agent workflows server-side.
agent = client.beta.agents.create(
model="mistral-medium-latest",
name="support-agent",
instructions="Help customers with orders. Use tools before answering.",
tools=[{"type": "web_search"}, {"type": "code_interpreter"}],
)
convo = client.beta.conversations.start(
agent_id=agent.id, inputs="Summarize today's news on EU AI regulation.",
)
When should you use Mistral's Agents API versus an orchestration framework like LangGraph? Use the Agents API when you want the fastest path to a hosted agent with managed tools and memory, and you are comfortable on Mistral's models. Use a framework (covered in Production AI Agents with LangGraph) when you need custom control flow, human-in-the-loop approval gates, multi-provider models, or your own observability. They are not mutually exclusive. A LangGraph node can call a Mistral model, and a Mistral agent can call your MCP tools.
Fine-tuning in three routes#
Mistral is unusually flexible here: it offers three distinct ways to fine-tune, and the right one depends on how much control and infrastructure you want. The general theory of when and how to fine-tune is covered in depth in our LLM Fine-Tuning guide; here is how Mistral specifically lets you do it.
| Feature | How it works | Choose it when |
|---|---|---|
| La Plateforme (managed API) | Upload JSONL, create a job, set hyperparameters, deploy (Mistral runs it) | You want zero infra and a hosted endpoint for the result |
| mistral-finetune (open-source SDK) | LoRA-based codebase you run on your own GPUs | You want control, local data, and to self-host the adapter |
| Mistral Forge (enterprise) | Mistral's team builds a custom model on your data (pre/post-train, RL) | You need a bespoke domain model and have the scale to justify it |
The managed API route is the most accessible. You format your data as JSONL conversation examples, upload it, create a fine-tuning job against a base model like mistral-small-latest or codestral-latest, monitor it via the API, and get a deployable endpoint. Pricing is roughly a dollar or two per million training tokens plus small job and storage fees, cheap enough to experiment freely.
job = client.fine_tuning.jobs.create(
model="mistral-small-latest",
training_files=[{"file_id": uploaded_file.id}],
hyperparameters={"training_steps": 1000, "learning_rate": 1e-4},
)
The mistral-finetune SDK is the open-source, LoRA-based path (most weights frozen, roughly 1 to 2 percent trained as low-rank adapters) for teams who want to fine-tune open-weight models on their own hardware and keep data in-house. It slots directly into the workflow and tooling from our fine-tuning guide (and works alongside Unsloth, TRL, and Hugging Face). Forge is the enterprise engagement for a fully custom model. There is also a Classifier Factory for turning labeled text into purpose-built classification models without writing training code, which is handy for moderation, routing, and intent detection.
RAG building blocks: embeddings and document AI#
Most production LLM systems are retrieval-augmented, and Mistral provides the two pieces you need beyond a vector database.
Embeddings. Mistral Embed turns text into vectors for semantic search and RAG; Codestral Embed does the same specialized for code. You call the embeddings endpoint, store the vectors, and retrieve at query time. That is the pipeline we detail in Build a RAG Search Pipeline and the RAG lifecycle series.
emb = client.embeddings.create(model="mistral-embed", inputs=["how do refunds work?"])
vector = emb.data[0].embedding
Document AI (OCR 3). Real documents are PDFs and scans, not clean text. Mistral's OCR model extracts structured text (preserving layout, tables, and reading order) from documents and images, which is often the missing first stage of an enterprise RAG pipeline, turning a folder of contracts into something you can chunk and embed. For teams who do not want to run their own vector store at all, the Agents API's Document Library wraps retrieval entirely.
Putting it together: which Mistral piece for which job#
| Feature | Reach for | Why |
|---|---|---|
| Ship a chatbot fast | La Plateforme API + Small 4 / Medium 3.5 | Cheap, capable, OpenAI-compatible, minimal integration work |
| Data must stay in-house | Open-weight model, self-hosted | Apache 2.0 weights run on your own GPUs, EU residency if hosted |
| Tool-using agent, hosted | Agents API + built-in tools + MCP | Server-side loop, sandboxed code, web search, your tools via MCP |
| Specialize on your data | Managed fine-tuning or mistral-finetune (LoRA) | Teach format/behavior; managed for ease, SDK for control |
| Coding assistant / IDE | Codestral (completion) or Devstral (agentic) | Purpose-built code models, low latency for completion |
| RAG over documents | Mistral Embed + OCR 3 (or Document Library) | Embeddings for retrieval; OCR to ingest real PDFs |
Getting started in five minutes#
Get an API key
Sign up at Mistral Studio (the La Plateforme console) and create an API key. Set it as an environment variable so it never lands in code.
export MISTRAL_API_KEY="..."
Install the SDK
Use the official client for your language.
pip install mistralai
Make your first call
A chat completion is three lines.
from mistralai import Mistral
client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
print(client.chat.complete(
model="mistral-small-latest",
messages=[{"role": "user", "content": "Hello!"}],
).choices[0].message.content)
Add a capability
Layer in function calling, structured outputs, embeddings, or an agent as your use case demands. Each is an incremental change to the same client.
Tradeoffs and limitations: an honest read#
Mistral's strengths are real: genuinely open weights under a permissive license, EU data residency, strong small and mid-size models, and a coherent API with hosted agents and three fine-tuning paths. For European teams, regulated industries, or anyone who wants the option to self-host, that combination is hard to match.
The honest caveats: on the very hardest frontier benchmarks, the largest closed models from other labs sometimes still lead, so validate Mistral on your task rather than assuming parity. The product surface also moves fast. Names like Le Chat becoming Vibe, and frequent model refreshes, mean documentation and your own integration assumptions can drift. And some capabilities (Codestral, Magistral, OCR, embeddings) are API-only Premier models, so "everything is open weight" is not quite true. Check the access tier of each model you depend on. As always, benchmark against alternatives on your real workload before committing; we frame that decision in Fine-Tuning vs RAG for AI Products and System Design for AI Products.
Key Takeaways#
- Mistral gives developers two access paths to one model family: open weights (Apache 2.0, self-hostable) and La Plateforme (hosted API, EU data residency). Start on the API, migrate to self-host without re-architecting.
- The model lineup is task-specialized: Small 4 as the workhorse, Large 3 as the strongest open model, Medium 3.5 for agentic/coding via API, Magistral for reasoning, Devstral/Codestral for code, Ministral for the edge.
- The API adds function calling, structured outputs, and multimodal/reasoning controls, enough to back a real application, and largely OpenAI-compatible.
- The Agents API runs the agent loop server-side with built-in tools (code interpreter, web search, document library), MCP connectors for your own tools, handoffs, and memory.
- Three fine-tuning routes cover every level of control: managed API (zero infra),
mistral-finetuneLoRA SDK (self-hosted), and Forge (enterprise custom models). - RAG building blocks (Mistral Embed, Codestral Embed, and OCR 3 document AI) round out the stack, with a managed Document Library if you would rather not run a vector store.
FAQ#
Is Mistral open source or a paid API?
Both. Many models (Large 3, Small 4, Devstral, Ministral, Voxtral) are open-weight under Apache 2.0, so you download and self-host them freely. Others (Codestral, Magistral, OCR, embeddings, moderation) are API-only "Premier" models on La Plateforme. You can mix: prototype on the API, self-host the open-weight models in production.
Is the Mistral API compatible with OpenAI code?
Largely, yes. The endpoints follow OpenAI-compatible conventions, so migrating existing OpenAI integrations is often just changing the base URL, key, and model name. The official mistralai Python and TypeScript SDKs also provide first-class clients.
How do I fine-tune a Mistral model?
Three ways. The managed La Plateforme API (upload JSONL, create a job, deploy) for zero infrastructure. The open-source mistral-finetune LoRA SDK to train open-weight models on your own GPUs. Or Mistral Forge for an enterprise custom model. For the underlying method choices (LoRA, data quality, evaluation), see our LLM Fine-Tuning guide.
Should I use Mistral's Agents API or a framework like LangGraph?
Use the Agents API for the fastest path to a hosted agent with managed server-side tools and memory on Mistral models. Use a framework like LangGraph when you need custom control flow, human-in-the-loop gates, multi-provider models, or your own tracing. They compose: a LangGraph graph can call Mistral models, and a Mistral agent can call your MCP tools.
Can I run Mistral models without sending data to Mistral?
Yes, and that is a core advantage. Download an open-weight model and serve it on your own infrastructure (or a cloud account you control) so data never leaves your environment. Even on the hosted API, La Plateforme offers EU data residency by default, which matters for GDPR-sensitive workloads.
Which Mistral model should I start with?
For most applications, start with Mistral Small 4. It is open-weight, inexpensive, and strong across instruct, reasoning, and code. Move up to Large 3 or Medium 3.5 if you need more capability, drop to Ministral for edge deployment, and use Codestral or Devstral for coding-specific work. Validate the choice on your own task and budget.