Docs / Instrument · Mistral

Mistral

Mistral appears in Dunetrace in four independent places. You can use any one without the others.

WhereWhat it doesTurned on by
SDK auto-instrumentationRecords your agent's Mistral calls automaticallydt.auto_instrument()
Dunetrace's own LLM featuresRoot-cause analysis, fix diffs, detector translation run on MistralAPI_LLM_PROVIDER=mistral
Semantic evaluatorTier 2 LLM evaluation runs on MistralSEMANTIC_LLM_PROVIDER=mistral
PricingMistral models priced for cost tracking and cost policiesAlways 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