Mistral
Mistral appears in Dunetrace in four independent places. You can use any one without the others.
| Where | What it does | Turned on by |
|---|---|---|
| SDK auto-instrumentation | Records your agent's Mistral calls automatically | dt.auto_instrument() |
| Dunetrace's own LLM features | Root-cause analysis, fix diffs, detector translation run on Mistral | API_LLM_PROVIDER=mistral |
| Semantic evaluator | Tier 2 LLM evaluation runs on Mistral | SEMANTIC_LLM_PROVIDER=mistral |
| Pricing | Mistral models priced for cost tracking and cost policies | Always on |
Instrument your agent
pip install 'dunetrace[mistral]' # requires mistralai>=2.0
from dunetrace import Dunetrace
dt = Dunetrace(api_key="dt_live_...")
dt.init(agent_id="my-agent") # patches Mistral along with everything else installed
with dt.run("my-agent", user_input=question):
resp = client.chat.complete(model="mistral-large-latest", messages=[...])
Covers chat.complete / chat.stream and their async twins, embeddings, and FIM — including the Azure- and GCP-hosted clients, which ship their own classes and need patching separately. Chat.parse is deliberately left alone because it calls complete internally and would double-count.
Streamed calls are recorded too: llm.called when the call is made, llm.responded when the stream ends. Mistral reports real token usage on the final chunk, so streamed Mistral calls carry exact counts rather than estimates.
TypeScript
import { Mistral } from "@mistralai/mistralai";
autoInstrument({ mistral: Mistral });
Bedrock-hosted Mistral
Bedrock is reached through boto3, not the Mistral SDK, so it has its own patcher — which covers every Bedrock-hosted model, not just Mistral's. It is included automatically when boto3 is installed.
Keep evaluation inside a European provider
SEMANTIC_LLM_PROVIDER=mistral
API_LLM_PROVIDER=mistral
MISTRAL_API_KEY=...
There is no cross-provider fallback. If Mistral fails, the evaluation fails — it is never quietly retried against OpenAI — and an unrecognised provider name is a startup error rather than a silent default. A fallback would ship your run text to a US API at exactly the moment you asked us not to.
The same rule extends to second opinions. Evaluators that confirm a high-confidence finding with a second model normally use a different vendor; with Mistral as the primary that is suppressed in favour of a second Mistral model. Set SEMANTIC_ALLOW_CROSS_PROVIDER_SECOND_OPINION=true if you chose Mistral on cost rather than residency and want cross-vendor diversity.
What this does and doesn't cover
- ✅ Your agent's Mistral calls are recorded, priced, and run through all 34 structural detectors and the policy engine.
- ✅ Tier 2 semantic evaluation and Dunetrace's own LLM features can both run entirely on Mistral.
- ✅ Bedrock-, Azure- and GCP-hosted Mistral, and the TypeScript SDK.
- ⚠️ Bedrock model ids do not yet resolve against the price tables, so those calls are costed at a default rate.