Mistral model behaviour
Mistral's API and open weights — streaming shape, tool calling, function declines, and the parameters that behave differently from OpenAI's near-identical names.
Mistral’s chat endpoint was built to be familiar. It takes a messages array of role-tagged objects, it accepts temperature and max_tokens and stop, it streams server-sent events terminated by data: [DONE], and it returns choices with a finish_reason. If you have written against OpenAI, you can write against Mistral in an afternoon. That familiarity is the problem these pages exist for: the names are shared, the semantics are not always, and the divergences are concentrated in exactly the parameters people set once and never look at again.
So the subject here is not “how to call Mistral”. It is the specific behaviour behind each field — what tool_choice: "any" forces that "auto" does not, why JSON mode can emit an unbounded run of whitespace, what safe_prompt actually puts in your context and what it costs you, where the context window numbers come from and which of them are for models that no longer exist. Figures are sourced to Mistral’s own model cards and API reference and dated, because this is a vendor whose model line has turned over completely twice.
Mistral Large's Context Window and Output Limit
The documented context length for the current Mistral Large, why there is no separate output cap to quote, and how much room a real system prompt leaves you.
8 min read
Function Calling in the Mistral API: tool_choice Options
What each tool_choice value does to Mistral's output, including the 'any' mode that has no OpenAI equivalent, and the response shape each one produces.
9 min read
System Prompt Handling in the Mistral API
How the system role works in Mistral's messages array, where the documentation says to put it, and why a system message behaves differently from an instruction in the user turn.
8 min read
Mistral's Tokenizer: v1 to v3 and Why the Vocabulary Grew
The documented vocabulary size of each Mistral tokenizer version, what changed between them, and why a larger vocabulary produces fewer tokens for the same text.
9 min read
Mixtral's Context Window
The documented context length for Mixtral 8x7B and 8x22B, their retirement dates on Mistral's API, and what still applies if you are running the open weights.
8 min read
JSON Mode in the Mistral API: response_format Type json_object
What json_object guarantees, the documented failure that produces an infinite whitespace stream, and when to reach for a schema instead.
8 min read
The Streaming Response Shape of the Mistral Chat API
The SSE frames Mistral's chat endpoint emits, what each delta contains, how usage is reported, and the ten-minute idle timeout that ends a stream.
9 min read
The safe_prompt Parameter in the Mistral API
What safe_prompt injects into your conversation, the exact text of the guardrail, what it costs you, and its current deprecated status.
8 min read
Codestral's Context Window and What It's Tuned For
The documented context length for the current Codestral, how it grew from the original release, and why the fill-in-the-middle endpoint changes how you should spend it.
8 min read
Stop Sequences in the Mistral API
The shape of Mistral's stop parameter, what happens to the matched text, and the tokenisation boundary problem that makes a stop sequence fail to fire.
8 min read
Mistral's Licence Terms: Apache 2.0 Models and Research-Only Releases
Which Mistral weights ship under Apache 2.0, which ship under the Mistral Research Licence, and what the difference means for a product you charge for.
9 min read
Parallel Tool Calls in the Mistral API
What a Mistral response looks like when the model requests several tools at once, and the exact rule for matching each result back to its call.
9 min read
The random_seed Parameter in the Mistral API
What fixing random_seed does to a Mistral request, why identical seeds still produce different text, and what to use instead when you need a test that passes twice.
9 min read
Mistral's max_tokens Default and Output Ceiling
What happens when you omit max_tokens on a Mistral request, what actually caps the length of a completion, and how to read the current per-model number rather than trusting a copied table.
9 min read
Mistral Small's Context Window
The documented context length for the current Mistral Small line, why older Small releases were much shorter, and how to read the exact figure for the version you are calling.
8 min read
Mistral's Instruct Prompt Template, and What Raw Completion Mode Skips
The [INST] template Mistral's instruct models were fine-tuned on, how multi-turn conversations are laid out inside it, and what changes when you send raw text instead.
9 min read
When Mistral Declines to Call a Tool
Why a Mistral model answers in prose when a perfectly good tool was available, what tool_choice auto actually promises, and how to force the call when you need one.
9 min read
Pinning a Dated Mistral Model Version
Swap a moving family alias like mistral-large-latest for a dated snapshot, verify the pin took, and set up the check that tells you before the snapshot retires.
9 min read
Mistral's Embeddings Model: Dimension and Token Limit per Request
The documented output dimension and per-input token cap for mistral-embed, what happens to text that exceeds it, and how to size chunks and batches around both.
8 min read
What Model Version the Mistral API Actually Serves Under a Family Name
How to find the dated snapshot behind mistral-large-latest or mistral-small-latest today, using the alias mapping the API publishes rather than a figure someone wrote down.
8 min read
Other topics
- LLM fundamentals & architecture
- Tokens, tokenization & context windows
- Prompt engineering
- Reasoning models & test-time compute
- Multimodal AI: vision, audio, video
- RAG & retrieval
- Embeddings & vector search
- AI agents & tool use
- Structured output & function calling
- Fine-tuning & post-training
- Local inference errors, string by string
- Running local models day to day
- Testing code that calls an LLM
- Snapshot and property testing for model output
- Regression suites for prompts
- Eval gates in CI
- Flaky tests against a model
- Determinism and the cost of testing
- Contract and streaming tests
- Testing tool calls and retrieval
- Inference, serving & latency
- Rolling out a prompt change
- Testing AI systems in practice
- Forecasting a time series
- Machine learning on tabular data
- Geospatial data and models
- Understanding audio that is not speech
- Understanding video
- Core computer vision tasks
- Machine learning on graphs
- Point clouds and 3D
- Evaluation, benchmarks & LLM-as-judge
- Sensor and IoT data
- Logs and event streams
- Models over biological sequences
- Machine learning on molecules
- Embedding and searching code
- Extracting invoices and purchase orders
- Receipts, statements and tax forms
- Insurance policies and contracts
- Deeds, court filings and patents
- Extracting from medical records
- Observability & LLMOps
- CVs, certificates and identity documents
- Shipping, customs and technical documents
- Meetings, email, chat and filled-in forms
- Building an extraction pipeline
- Business, property and inspection documents
- Contract clauses and insurance claims
- Regulated and compliance documents
- Consumer, travel and closing documents
- Mapping one chat API onto another
- SDK and framework migrations
- Hallucination & failure modes
- Re-embedding and model deprecation
- Cutting over between providers
- Parity gaps, shims and legacy endpoints
- Moving between model versions
- Migrating vector stores and caches
- Mapping capabilities and parameters
- Migrating pipelines and agents
- Contracts, runbooks and rollback
- Auditing a codebase before a cutover
- Compliance and fine-tune migration
- LLM cost engineering
- Routing, cost tracking and multi-tenancy
- What a migration does to your prompts
- AI security & prompt injection
- Privacy, compliance & data residency
- AI governance, policy & society
- Building reliable AI applications
- AI hardware, GPUs & compute
- Open-weight models & local inference
- AI for developers & coding agents
- AI in industry: vertical playbooks
- AGI, superintelligence, alignment & the long future
- Machine learning foundations
- NLP fundamentals & classical tasks
- Data engineering for AI
- Synthetic data & dataset curation
- AI product design & UX
- Search, ranking & recommendation
- Enterprise adoption & change management
- AI careers, skills & teams
- Reading AI research
- AI in science & discovery
- Robotics & embodied AI
- AI economics, markets & business models
- AI myths, hype & media literacy
- Context engineering
- Shipping AI features: patterns & anti-patterns
- Build it: end-to-end AI tutorials
- Python for AI: hands-on recipes
- TypeScript, React and the web
- Frameworks and SDKs
- Errors and troubleshooting
- AI facts, numbers and statistics
- The history of AI
- The maths behind AI
- Architectures beyond the transformer
- Reinforcement learning
- Diffusion and generative media
- Speech, audio and voice engineering
- Benchmarks, one at a time
- AI search visibility
- Infrastructure and operations
- Databases and storage for AI
- Knowledge graphs and structured knowledge
- Classical ML in production
- Regulation, jurisdiction by jurisdiction
- Prompt recipes and pattern library
- AI for people who do not write code
- Writing, media and creative work
- Edge and on-device AI
- Interpretability and model internals
- Field notes
- OpenAI model behaviour
- Claude model behaviour
- Gemini model behaviour
- Llama model behaviour
- Qwen model behaviour
- DeepSeek model behaviour
- Cohere model behaviour
- Grok model behaviour
- Small model behaviour
- Hybrid model architectures
- Token cost by language and script
- Transliteration, romanization and script handling
- Locale-correct output
- Multilingual generation quality
- Multilingual pipelines
- The EU AI Act, article by article
- AI under the GDPR and EU data law
- US AI regulation, state and sector
- International AI governance and standards
- AI litigation and enforcement
- Running AI workloads on AWS
- Running AI workloads on Google Cloud
- Running AI workloads on Azure
- AI at the edge: Workers, Vercel and Netlify
- Serving models on Kubernetes
- Operating AI infrastructure
- Quantization formats and what they cost
- llama.cpp, flag by flag
- Ollama and the desktop local-model runtimes
- Local models on Apple Silicon
- Hardware for local inference
- Running speech and embedding models locally
- Model files, adapters and conversion
- VRAM arithmetic for local models