examples/mistral/README.md
This example demonstrates Mistral AI's chat models, including Magistral reasoning models, current multimodal models, and shows how to use Mistral models for evaluation grading and embeddings.
You can run this example with:
npx promptfoo@latest init --example mistral
cd mistral
This example requires:
MISTRAL_API_KEY - Your Mistral API key (get it from console.mistral.ai)magistral-medium-latest → magistral-medium-2509): Native reasoning model ($2/$5 per 1M tokens, 128k context) — the reasoning showcase in these examples.Mistral folded Magistral Small into Mistral Small 4: the
magistral-small-latestalias now resolves tomistral-small-2603(a hybrid model, $0.15/$0.60 per 1M), so these examples use the canonicalmistral-small-latestid. Enable Small 4's reasoning mode withreasoning_effort: high. The standalonemagistral-small-2509snapshot is deprecated (retires 2026-07-31).
mistral-medium-latest → mistral-medium-2604): Frontier agentic/coding multimodal model ($1.50/$7.50 per 1M, 256k context)mistral-large-latest → mistral-large-2512): General-purpose multimodal model ($0.50/$1.50 per 1M, 256k context)mistral-small-latest → mistral-small-2603): Hybrid instruct/reasoning/coding model ($0.15/$0.60 per 1M, 256k context)mistral-large-latest for LLM-as-a-judge evaluationmistral-embed for semantic similarity checks# Set your API key
export MISTRAL_API_KEY=your_api_key_here
# Run the evaluation
promptfoo eval
# View results in the web UI
promptfoo view
This example showcases several advanced promptfoo features:
The evaluation uses Mistral models end-to-end, providing a comprehensive view of their ecosystem capabilities.
This example includes multiple configuration files for different use cases:
promptfooconfig.aime2024.yaml - Advanced mathematical competition problems (AIME2024 dataset)promptfooconfig.reasoning.yaml - Step-by-step logical problem solvingpromptfooconfig.comparison.yaml - Compare reasoning across all Mistral modelspromptfooconfig.code-generation.yaml - Multi-language programming with Codestralpromptfooconfig.multimodal.yaml - Vision and text processing with current Mistral multimodal modelspromptfooconfig.tool-use.yaml - Function calling and tool integrationpromptfooconfig.tool-routing.yaml - End-to-end QA for tool-only, mixed content+tool_calls, file-based tools, and plain chat outputpromptfooconfig.json-mode.yaml - Structured JSON output generationpromptfooconfig.yaml - Main example with evaluation using Mistral modelsRun any specific configuration:
npx promptfoo@latest eval -c promptfooconfig.aime2024.yaml # Mathematical reasoning
npx promptfoo@latest eval -c promptfooconfig.comparison.yaml # Model comparison