PageSourceSearch

https://www.promptfoo.dev/assets/js/8bff3fb0.a4fb651b.js

js promptfoo.dev collected 2026-10-02 03:32:10 UTC 43,672 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkpromptfoo_docs||=[]).push([[15268],{47053(e,n,i){i.r(n),i.d(n,{assets:()=>o,contentTitle:()=>a,default:()=>m,frontMatter:()=>r,metadata:()=>s,toc:()=>d});const s=JSON.parse('{"id":"providers/mistral","title":"Mistral AI Provider - Complete Guide to Models, Reasoning, and API Integration","description":"Configure Mistral AI Magistral reasoning models with multimodal capabilities, function calling, and OpenAI-compatible APIs","source":"@site/docs/providers/mistral.md","sourceDirName":"providers","slug":"/providers/mistral","permalink":"/docs/providers/mistral","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedBy":"mldangelo-oai","lastUpdatedAt":1790895180000,"frontMatter":{"sidebar_label":"Mistral AI","title":"Mistral AI Provider - Complete Guide to Models, Reasoning, and API Integration","description":"Configure Mistral AI Magistral reasoning models with multimodal capabilities, function calling, and OpenAI-compatible APIs","keywords":["mistral ai","magistral reasoning","openai alternative","llm evaluation","function calling","multimodal ai","code generation","mistral api"]},"sidebar":"promptfoo","previous":{"title":"Meta Model API","permalink":"/docs/providers/meta"},"next":{"title":"Moonshot (Kimi)","permalink":"/docs/providers/moonshot"}}');var t=i(62540),l=i(43023);const r={sidebar_label:"Mistral AI",title:"Mistral AI Provider - Complete Guide to Models, Reasoning, and API Integration",description:"Configure Mistral AI Magistral reasoning models with multimodal capabilities, function calling, and OpenAI-compatible APIs",keywords:["mistral ai","magistral reasoning","openai alternative","llm evaluation","function calling","multimodal ai","code generation","mistral api"]},a="Mistral AI",o={},d=[{value:"API Key",id:"api-key",level:2},{value:"Configuration Options",id:"configuration-options",level:2},{value:"Basic Options",id:"basic-options",level:3},{value:"JSON Mode",id:"json-mode",level:3},{value:"Authentication Configuration",id:"authentication-configuration",level:3},{value:"Advanced Model Configuration",id:"advanced-model-configuration",level:3},{value:"Environment Variables Reference",id:"environment-variables-reference",level:3},{value:"Model Selection",id:"model-selection",level:2},{value:"Chat Models",id:"chat-models",level:3},{value:"Current Models",id:"current-models",level:4},{value:"Model aliases and snapshots",id:"model-aliases-and-snapshots",level:4},{value:"Legacy models",id:"legacy-models",level:4},{value:"Embedding Models",id:"embedding-models",level:3},{value:"Reasoning Models",id:"reasoning-models",level:2},{value:"Key Features of Magistral Models",id:"key-features-of-magistral-models",level:3},{value:"Magistral Model Variants",id:"magistral-model-variants",level:3},{value:"Usage Recommendations",id:"usage-recommendations",level:3},{value:"Multimodal Capabilities",id:"multimodal-capabilities",level:2},{value:"Image Understanding",id:"image-understanding",level:3},{value:"Supported Image Formats",id:"supported-image-formats",level:3},{value:"Function Calling & Tool Use",id:"function-calling--tool-use",level:2},{value:"Tool Calling Best Practices",id:"tool-calling-best-practices",level:3},{value:"Code Generation",id:"code-generation",level:2},{value:"Fill-in-the-Middle (FIM)",id:"fill-in-the-middle-fim",level:3},{value:"Code Generation Examples",id:"code-generation-examples",level:3},{value:"Complete Working Examples",id:"complete-working-examples",level:2},{value:"Example 1: Multi-Model Comparison",id:"example-1-multi-model-comparison",level:3},{value:"Example 2: Code Review Assistant",id:"example-2-code-review-assistant",level:3},{value:"Example 3: Multimodal Document Analysis",id:"example-3-multimodal-document-analysis",level:3},{value:"Authentication & Setup",id:"authentication--setup",level:2},{value:"Environment Variables",id:"environment-variables",level:3},{value:"Getting Your API Key",id:"getting-your-api-key",level:3},{value:"Performance Optimization",id:"performance-optimization",level:2},{value:"Model Selection Guide",id:"model-selection-guide",level:3},{value:"Context Window Optimization",id:"context-window-optimization",level:3},{value:"Cost Management",id:"cost-management",level:3},{value:"Troubleshooting",id:"troubleshooting",level:2},{value:"Common Issues",id:"common-issues",level:3}
1,{value:"Authentication Errors",id:"authentication-errors",level:4},{value:"Rate Limiting",id:"rate-limiting",level:4},{value:"Context Length Exceeded",id:"context-length-exceeded",level:4},{value:"Model Availability",id:"model-availability",level:4},{value:"Debugging Tips",id:"debugging-tips",level:3},{value:"Getting Help",id:"getting-help",level:3},{value:"Working Examples",id:"working-examples",level:2},{value:"\ud83d\udccb Complete Mistral Example Collection",id:"-complete-mistral-example-collection",level:3},{value:"Quick Start",id:"quick-start",level:3}];function c(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"mistral-ai",children:"Mistral AI"})}),"\n",(0,t.jsxs)(n.p,{children:["Use the ",(0,t.jsx)(n.a,{href:"https://docs.mistral.ai/api/",children:"Mistral AI API"})," for chat, reasoning, code generation, and image understanding. Check ",(0,t.jsx)(n.a,{href:"https://docs.mistral.ai/getting-started/models/",children:"Mistral's model catalog"})," for capabilities and availability."]}),"\n",(0,t.jsxs)(n.p,{children:["For Mistral-hosted ",(0,t.jsx)(n.a,{href:"https://docs.mistral.ai/models/zai-glm-5-3",children:"Z.ai GLM 5.3"}),", use ",(0,t.jsx)(n.code,{children:"mistral:zai-glm-5-3"}),". Promptfoo includes standard input and output pricing for this model."]}),"\n",(0,t.jsx)(n.h2,{id:"api-key",children:"API Key"}),"\n",(0,t.jsxs)(n.p,{children:["To use Mistral AI, you need to set the ",(0,t.jsx)(n.code,{children:"MISTRAL_API_KEY"})," environment variable, or specify the ",(0,t.jsx)(n.code,{children:"apiKey"})," in the provider configuration."]}),"\n",(0,t.jsx)(n.p,{children:"Example of setting the environment variable:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"export MISTRAL_API_KEY=your_api_key_here\n"})}),"\n",(0,t.jsx)(n.h2,{id:"configuration-options",children:"Configuration Options"}),"\n",(0,t.jsx)(n.p,{children:"The Mistral provider supports extensive configuration options:"}),"\n",(0,t.jsx)(n.h3,{id:"basic-options",children:"Basic Options"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"providers:\n  - id: mistral:mistral-large-latest\n    config:\n      # Model behavior\n      temperature: 0.7 # Creativity (0.0-2.0)\n      top_p: 0.95 # Nucleus sampling (0.0-1.0)\n      max_tokens: 4000 # Response length limit\n\n      # Advanced options\n      random_seed: 42 # Deterministic outputs\n      frequency_penalty: 0.1 # Reduce repetition\n      presence_penalty: 0.1 # Encourage diversity\n      stop: ['END'] # Optional stop sequence(s)\n      n: 1 # Number of completions\n      reasoning_effort: high # high | none on adjustable reasoning models\n      prompt_mode: reasoning # reasoning | null on native reasoning models\n      prompt_cache_key: shared-prefix # Reuse Mistral's server-side prompt cache across requests\n"})}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"safe_prompt"})," is still accepted for compatibility, but Mistral now recommends inline\n",(0,t.jsx)(n.code,{children:"guardrails"})," instead."]}),"\n",(0,t.jsx)(n.h3,{id:"json-mode",children:"JSON Mode"}),"\n",(0,t.jsx)(n.p,{children:"Force structured JSON output:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"providers:\n  - id: mistral:mistral-large-latest\n    config:\n      response_format:\n        type: 'json_object'\n      temperature: 0.3 # Lower temp for consistent JSON\n\ntests:\n  - vars:\n      prompt: \"Extract name, age, and occupation from: 'John Smith, 35, engineer'. Return as JSON.\"\n    assert:\n      - type: is-json\n      - type: javascript\n        value: JSON.parse(output).name === \"John Smith\"\n"})}),"\n",(0,t.jsx)(n.h3,{id:"authentication-configuration",children:"Authentication Configuration"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"providers:\n  # Option 1: Environment variable (recommended)\n  - id: mistral:mistral-large-latest\n\n  # Option 2: Direct API key (not recommended for production)\n  - id: mistral:mistral-large-latest\n    config:\n      apiKey: 'your-api-key-here'\n\n  # Option 3: Custom environment variable\n  - id: mistral:mistral-large-latest\n    config:\n      apiKeyEnvar: 'CUSTOM_MISTRAL_KEY'\n\n  # Option 4: Custom endpoint\n  - id: mistral:mistral-large-latest\n    config:\n      apiHost: 'custom-proxy.example.com'\n      apiBaseUrl: 'https://custom-api.example.com/v1'\n"})}),"\n",(0,t.jsx)(n.h3,{id:"advanced-model-configuration",children:"Advanced Model Configuration"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"providers:\n  # Reasoning model with optimal settings\n  - id: mistral:magistral-medium-latest\n    config:\n      temperature: 0.7\n      top_p: 0.95\n      max_tokens: 40960\n\n  # Adjustable reasoning on general-purpose models\n  - id: mistral:mistral-medium-3.5\n    config:\n      reasoning_effort: high\n      response_format:\n        type: json_schema\n        json_schema:\n          name: answer\n          schema:\n            type: object\n            properties:\n              answer:\n                type: string\n            required: [answer]\n\n  # C
1ode generation with FIM support\n  - id: mistral:codestral-latest\n    config:\n      temperature: 0.2 # Low for consistent code\n      max_tokens: 8000\n      stop: ['```'] # Stop at code block end\n\n  # Current multimodal configuration\n  - id: mistral:mistral-large-2512\n    config:\n      temperature: 0.5\n      max_tokens: 2000\n\n  # Recommended inline guardrails\n  - id: mistral:mistral-small-latest\n    config:\n      guardrails:\n        - block_on_error: true\n          moderation_llm_v2:\n            custom_category_thresholds:\n              sexual: 0.1\n            ignore_other_categories: false\n            action: block\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsxs)(n.p,{children:["Mistral's ",(0,t.jsx)(n.code,{children:"config.guardrails"})," field enables upstream inline input guardrails, but it does not enable Promptfoo's ",(0,t.jsxs)(n.a,{href:"/docs/configuration/expected-outputs/guardrails",children:[(0,t.jsx)(n.code,{children:"guardrails"})," assertion"]}),". Promptfoo sends the configuration without normalizing successful or HTTP 403 guardrail results into the required top-level response. Use a custom target or transform to assert on the native result. If ",(0,t.jsx)(n.code,{children:"block_on_error"})," is enabled, distinguish a moderation-service failure from a policy violation instead of counting both as a match. Call a moderation endpoint separately for output filtering."]})}),"\n",(0,t.jsx)(n.h3,{id:"environment-variables-reference",children:"Environment Variables Reference"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Variable"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Example"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"MISTRAL_API_KEY"})}),(0,t.jsx)(n.td,{children:"Your Mistral API key (required)"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"sk-1234..."})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"MISTRAL_API_HOST"})}),(0,t.jsx)(n.td,{children:"Custom hostname for proxy setup"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"api.example.com"})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"MISTRAL_API_BASE_URL"})}),(0,t.jsx)(n.td,{children:"Full base URL override"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"https://api.example.com/v1"})})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"model-selection",children:"Model Selection"}),"\n",(0,t.jsx)(n.p,{children:"You can specify which Mistral model to use in your configuration. The following models are available:"}),"\n",(0,t.jsx)(n.h3,{id:"chat-models",children:"Chat Models"}),"\n",(0,t.jsx)(n.h4,{id:"current-models",children:"Current Models"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Model"}),(0,t.jsx)(n.th,{children:"Context"}),(0,t.jsx)(n.th,{children:"Input Price"}),(0,t.jsx)(n.th,{children:"Output Price"}),(0,t.jsx)(n.th,{children:"Capabilities"}),(0,t.jsx)(n.th,{children:"Best For"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mistral-medium-latest"})}),(0,t.jsx)(n.td,{children:"256k"}),(0,t.jsx)(n.td,{children:"$1.50/1M"}),(0,t.jsx)(n.td,{children:"$7.50/1M"}),(0,t.jsx)(n.td,{children:"Text, vision, reasoning\xb9"}),(0,t.jsx)(n.td,{children:"Agentic and coding-heavy workloads"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mistral-large-latest"})}),(0,t.jsx)(n.td,{children:"256k"}),(0,t.jsx)(n.td,{children:"$0.50/1M"}),(0,t.jsx)(n.td,{children:"$1.50/1M"}),(0,t.jsx)(n.td,{children:"Text, vision"}),(0,t.jsx)(n.td,{children:"General-purpose multimodal tasks"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mistral-small-latest"})}),(0,t.jsx)(n.td,{children:"256k"}),(0,t.jsx)(n.td,{children:"$0.15/1M"}),(0,t.jsx)(n.td,{children:"$0.60/1M"}),(0,t.jsx)(n.td,{children:"Text, vision, reasoning\xb9"}),(0,t.jsx)(n.td,{children:"Hybrid instruct, reasoning, and coding"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"magistral-medium-latest"})}),(0,t.jsx)(n.td,{children:"128k"}),(0,t.jsx)(n.td,{children:"$2.00/1M"}),(0,t.jsx)(n.td,{children:"$5.00/1M"}),(0,t.jsx)(n.td,{children:"Native reasoning, vision"}),(0,t.jsx)(n.td,{children:"Step-by-step reasoning"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"codestral-latest"})}),(0,t.jsx)(n.td,{children:"256k"}),(0,t.jsx)(n.td,{children:"$0.30/1M"}),(0,t.jsx)(n.td,{children:"$0.90/1M"}),(0,t.jsx)(n.td,{children:"Code, FIM"}),(0,t.jsx)(n.td,{children:"Code generation and completion"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"devstral-medium-latest"})}),(0,t.jsx)(n.td,{children:"256k"}),(0,t.jsx)(n.td,{children:"$0.40/1M"}),(0,t.jsx)(n.td,{children:"$2.00/1M"}),(0,t.jsx)(n.td,{children:"Code agents"}),(0,t.jsx)(n.td,{children:"Software-engineering agents (Devstral 2)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ministral-14b-latest"})}),(0,t.jsx)(n.td,{children:"256k"}),(0,t.jsx)(n.td,{children:"$0.20/1M"}),(0,t.jsx)(n.td,{children:"$0.20/1M"}),(0,t.jsx)(n.td,{children:"Text, vision"}),(0,t.jsx)(n.td,{children:"Compact multimodal deployments"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ministral-8b-latest"})}),(0,t.jsx)(n.td,{children:"256k"}),(0,t.jsx)(n.td,{children:"$0.15/1M"}),(0,t.jsx)(n.td,{children:"$0.15/1M"}),(0,t.jsx)(n.td,{children:"Text, vision"}),(0,t.jsx)(n.td,{children:"Efficient on-prem/edge deployments"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ministral-3b-latest"})}),(0,t.jsx)(n.td,{children:"128k"}),(0,t.jsx)(n.td,{children:"$0.10/1M"}),(0,t.jsx)(n.td,{children:"$0.10/1M"}),(0,t.jsx)(n.td,{children:"Text, vision"}),(0,t.jsx)(n.td,{children:"Smallest multimodal deployments"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"open-mistral-nemo"})}),(0,t.jsx)(n.td,{children:"128k"}),(0,t.jsx)(n.td,{children:"$0.15/1M"}),(0,t.jsx)(n.td,{children:"$0.15/1M"}),(0,t.jsx)(n.td,{children:"Text"}),(0,t.jsx)(n.td,{children:"Multilingual and research workloads"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["\xb9 Enable adjustable reasoning with ",(0,t.jsx)(n.code,{children:"reasoning_effort: high"}),"."]}),"\n",(0,t.jsx)(n.admonition,{title:"Aliases move \u2014 pin a snapshot for stability",type:"note",children:(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"*-latest"})," and bare aliases follow whatever snapshot Mistral currently points them at, so their\nprice and behavior track the resolved model. Pin a dated snapshot (e.g. ",(0,t.jsx)(n.code,{children:"mistral-medium-2604"}),")\nwhen you need stable pricing and behavior."]})}),"\n",(0,t.jsx)(n.h4,{id:"model-aliases-and-snapshots",children:"Model aliases and snapshots"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Alias"}),(0,t.jsx)(n.th,{children:"Resolves to"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"mistral-medium-latest"}),", ",(0,t.jsx)(n.code,{children:"mistral-medium"}),", ",(0,t.jsx)(n.code,{children:"mistral-medium-3"}),", ",(0,t.jsx)(n.code,{children:"mistral-medium-3-5"}),", ",(0,t.jsx)(n.code,{children:"mistral-medium-3.5"})]}),(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"mistral-medium-2604"})," (Mistral Medium 3.5)"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mistral-large-latest"})}),(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"mistral-large-2512"})," (Mistral Large 3)"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"mistral-small-latest"}),", ",(0,t.jsx)(n.code,{children:"magistral-small-latest"})]}),(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"mistral-small-2603"})," (Mistral Small 4)"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"magistral-medium-latest"})}),(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"magistral-medium-2509"})," (Magistral Medium)"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"codestral-latest"}),", ",(0,t.jsx)(n.code,{children:"mistral-code-latest"}),", ",(0,t.jsx)(n.code,{children:"mistral-code-fim-latest"})]}),(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"codestral-2508"})," (Codestral)"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"devstral-latest"}),", ",(0,t.jsx)(n.code,{children:"devstral-medium-latest"}),", ",(0,t.jsx)(n.code,{children:"mistral-code-agent-latest"})]}),(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"devstral-2512"})," (Devstral 2)"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"open-mistral-nemo"}),", ",(0,t.jsx)(n.code,{children:"mistral-tiny-latest"}),", ",(0,t.jsx)(n.code,{children:"mistral-tiny-2407"})]}),(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"open-mistral-nemo-2407"})," (Mistral NeMo)"]})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"magistral-small-latest"})," alias now resolves to Mistral Small 4 (a hybrid model), not the\nstandalone Magistral Small reasoning snapshot. Enable Small 4's reasoning with\n",(0,t.jsx)(n.code,{children:"reasoning_effort: high"}),"."]}),"\n",(0,t.jsx)("span",{id:"legacy-models-deprecated-or-retired"}),"\n",(0,t.jsx)(n.h4,{id:"legacy-models",children:"Legacy models"}),"\n",(0,t.jsxs)(n.p,{children:["Promptfoo retains some older prices for estimating costs from past evals. Retired models reject new requests. Check ",(0,t.jsx)(n.a,{href:"https://docs.mistral.ai/getting-started/models/",children:"Mistral's model catalog"})," before using an older snapshot."]}),"\n",(0,t.jsx)(n.h3,{id:"embedding-models",children:"Embedding Models"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"mistral-embed"})," - $0.10/1M tokens - 8k context"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"codestral-embed"})," (",(0,t.jsx)(n.code,{children:"codestral-embed-2505"}),") - $0.15/1M tokens - code-optimized embeddings"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["Select an embedding model with the ",(0,t.jsx)(n.code,{children:"mistral
1:embedding:"})," prefix:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"providers:\n  - mistral:embedding:mistral-embed\n  - mistral:embedding:codestral-embed\n"})}),"\n",(0,t.jsx)(n.p,{children:"Here's an example config that compares different Mistral models:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"providers:\n  - mistral:mistral-medium-latest\n  - mistral:mistral-small-latest\n  - mistral:open-mistral-nemo-2407\n  - mistral:magistral-medium-latest\n"})}),"\n",(0,t.jsx)(n.h2,{id:"reasoning-models",children:"Reasoning Models"}),"\n",(0,t.jsxs)(n.p,{children:["Mistral's ",(0,t.jsx)(n.strong,{children:"Magistral"})," models are specialized native reasoning models. ",(0,t.jsx)(n.code,{children:"magistral-medium-latest"}),"\ncurrently points to the 2509 generation, which uses tokenized thinking chunks and a 128k\ncontext window. Mistral's public model card deprecated the standalone ",(0,t.jsx)(n.code,{children:"magistral-small-2509"}),"\nsnapshot on 2026-04-30 (retiring 2026-07-31); the ",(0,t.jsx)(n.code,{children:"magistral-small-latest"})," alias now resolves to\nMistral Small 4, whose reasoning mode you enable with ",(0,t.jsx)(n.code,{children:"reasoning_effort: high"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"key-features-of-magistral-models",children:"Key Features of Magistral Models"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Chain-of-thought reasoning"}),": Models provide step-by-step reasoning traces before arriving at final answers"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Multilingual reasoning"}),": Native reasoning capabilities across English, French, Spanish, German, Italian, Arabic, Russian, Chinese, and more"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Transparency"}),": Traceable thought processes that can be followed and verified"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Domain expertise"}),": Optimized for structured calculations, programmatic logic, decision trees, and rule-based systems"]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"magistral-model-variants",children:"Magistral Model Variants"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Magistral Medium"})," (",(0,t.jsx)(n.code,{children:"magistral-medium-latest"})," / ",(0,t.jsx)(n.code,{children:"magistral-medium-2509"}),") \u2014 native reasoning"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Mistral Small 4"})," (",(0,t.jsx)(n.code,{children:"mistral-small-latest"})," / ",(0,t.jsx)(n.code,{children:"magistral-small-latest"}),") \u2014 hybrid model; enable reasoning with ",(0,t.jsx)(n.code,{children:"reasoning_effort: high"})]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"usage-recommendations",children:"Usage Recommendations"}),"\n",(0,t.jsx)(n.p,{children:"For reasoning tasks, consider using these parameters for optimal performance:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"providers:\n  - id: mistral:magistral-medium-latest\n    config:\n      temperature: 0.7\n      top_p: 0.95\n      max_tokens: 40960 # Recommended for reasoning tasks\n"})}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"n"})," requests multiple completions where the target model supports them. Mistral notes\nthat ",(0,t.jsx)(n.code,{children:"mistral-large-2512"})," does not currently support ",(0,t.jsx)(n.code,{children:"n > 1"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"multimodal-capabilities",children:"Multimodal Capabilities"}),"\n",(0,t.jsx)(n.p,{children:"Mistral offers vision-capable models that can process both text and images:"}),"\n",(0,t.jsx)(n.h3,{id:"image-understanding",children:"Image Understanding"}),"\n",(0,t.jsxs)(n.p,{children:["Use a current multimodal chat model such as ",(0,t.jsx)(n.code,{children:"mistral-large-2512"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"providers:\n  - id: mistral:mistral-large-2512\n    config:\n      temperature: 0.7\n      max_tokens: 1000\n\ntests:\n  - vars:\n      prompt: 'What do you see in this image?'\n      image: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...'\n"})}),"\n",(0,t.jsx)(n.h3,{id:"supported-image-formats",children:"Supported Image Formats"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.strong,{children:"JPEG, PNG, GIF, WebP"})}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Maximum size"}),": 20MB per image"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Resolution"}),": Up to 2048x2048 pixels optimal"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"function-calling--tool-use",children:"Function Calling & Tool Use"}),"\n",(0,t.jsx)(n.p,{children:"Mistral models support advanced function calling for building AI agents and tools:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"providers:\n  - id: mistral:mistral-large-latest\n    config:\n      temperature: 0.1\n      tools:\n        - type: function\n          function:\n            name: get_weather\n            description: Get current weather for a location\n            parameters:\n              type: object\n              properties:\n                location:\n                  type: string\n                  description: City name\n                unit:\n                  type: string\n                  enum: ['celsius', 'fahrenheit']\n              required: ['location']\n\ntests:\n  - vars:\n      prompt: \"What's the weather like in Paris?\"\n    assert:\n      - type: contains\n        value: 'get_weather'\n"})}),"\n",(0,t.jsx)(n.h3,{id:"tool-calling-best-practices",children:"Tool Calling Best Practices"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Use ",(0,t.jsx)(n.strong,{children:"low temperature"})," (0.1-0.3) for consistent tool calls"]}),"\n",(0,t.jsxs)(n.li,{children:["Provide ",(0,t.jsx)(n.strong,{children:"detailed function descriptions"})]}),"\n",(0,t.jsxs)(n.li,{children:["Include ",(0,t.jsx)(n.strong,{children:"parameter validation"})," in your tools"]}),"\n",(0,t.jsxs)(n.li,{children:["Handle ",(0,t.jsx)(n.strong,{children:"tool call errors"})," gracefully"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"code-generation",children:"Code Generation"}),"\n",(0,t.jsx)(n.p,{children:"Mistral's Codestral models excel at code generation across 80+ programming languages:"}),"\n",(0,t.jsx)(n.h3,{id:"fill-in-the-middle-fim",children:"Fill-in-the-Middle (FIM
1)"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"providers:\n  - id: mistral:codestral-latest\n    config:\n      temperature: 0.2\n      max_tokens: 2000\n\ntests:\n  - vars:\n      prompt: |\n        <fim_prefix>def calculate_fibonacci(n):\n            if n <= 1:\n                return n\n        <fim_suffix>\n\n        # Test the function\n        print(calculate_fibonacci(10))\n        <fim_middle>\n    assert:\n      - type: contains\n        value: 'fibonacci'\n"})}),"\n",(0,t.jsx)(n.h3,{id:"code-generation-examples",children:"Code Generation Examples"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"tests:\n  - description: 'Python API endpoint'\n    vars:\n      prompt: 'Create a FastAPI endpoint that accepts a POST request with user data and saves it to a database'\n    assert:\n      - type: contains\n        value: '@app.post'\n      - type: contains\n        value: 'async def'\n\n  - description: 'React component'\n    vars:\n      prompt: 'Create a React component for a user profile card with name, email, and avatar'\n    assert:\n      - type: contains\n        value: 'export'\n      - type: contains\n        value: 'useState'\n"})}),"\n",(0,t.jsx)(n.h2,{id:"complete-working-examples",children:"Complete Working Examples"}),"\n",(0,t.jsx)(n.h3,{id:"example-1-multi-model-comparison",children:"Example 1: Multi-Model Comparison"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"description: 'Compare reasoning capabilities across Mistral models'\n\nproviders:\n  - mistral:magistral-medium-latest\n  - mistral:mistral-medium-3.5\n  - mistral:mistral-large-latest\n  - mistral:mistral-small-latest\n\nprompts:\n  - 'Solve this step by step: {{problem}}'\n\ntests:\n  - vars:\n      problem: \"A company has 100 employees. 60% work remotely, 25% work hybrid, and the rest work in office. If remote workers get a $200 stipend and hybrid workers get $100, what's the total monthly stipend cost?\"\n    assert:\n      - type: llm-rubric\n        value: 'Shows clear mathematical reasoning and arrives at correct answer ($13,500)'\n      - type: cost\n        threshold: 0.10\n"})}),"\n",(0,t.jsx)(n.h3,{id:"example-2-code-review-assistant",children:"Example 2: Code Review Assistant"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"description: 'AI-powered code review using Codestral'\n\nproviders:\n  - id: mistral:codestral-latest\n    config:\n      temperature: 0.3\n      max_tokens: 1500\n\nprompts:\n  - |\n    Review this code for bugs, security issues, and improvements:\n\n    ```{{language}}\n    {{code}}\n    ```\n\n    Provide specific feedback on:\n    1. Potential bugs\n    2. Security vulnerabilities  \n    3. Performance improvements\n    4. Code style and best practices\n\ntests:\n  - vars:\n      language: 'python'\n      code: |\n        import subprocess\n\n        def run_command(user_input):\n            result = subprocess.run(user_input, shell=True, capture_output=True)\n            return result.stdout.decode()\n    assert:\n      - type: contains\n        value: 'security'\n      - type: llm-rubric\n        value: 'Identifies shell injection vulnerability and suggests safer alternatives'\n"})}),"\n",(0,t.jsx)(n.h3,{id:"example-3-multimodal-document-analysis",children:"Example 3: Multimodal Document Analysis"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"description: 'Analyze documents with text and images'\n\nproviders:\n  - id: mistral:mistral-large-2512\n    config:\n      temperature: 0.5\n      max_tokens: 2000\n\ntests:\n  - vars:\n      prompt: |\n        Analyze this document image and:\n        1. Extract key information\n        2. Summarize main points\n        3. Identify any data or charts\n      image_url: 'https://example.com/financial-report.png'\n    assert:\n      - type: llm-rubric\n        value: 'Accurately extracts text and data from the document image'\n      - type: length\n        min: 200\n"})}),"\n",(0,t.jsx)(n.h2,{id:"authentication--setup",children:"Authentication & Setup"}),"\n",(0,t.jsx)(n.h3,{id:"environment-variables",children:"Environment Variables"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# Required\nexport MISTRAL_API_KEY="your-api-key-here"\n\n# Optional - for custom endpoints\nexport MISTRAL_API_BASE_URL="https://api.mistral.ai/v1"\nexport MISTRAL_API_HOST="api.mistral.ai"\n'})}),"\n",(0,t.jsx)(n.h3,{id:"getting-your-api-key",children:"Getting Your API Key"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Visit ",(0,t.jsx)(n.a,{href:"https://console.mistral.ai",children:"console.mistral.ai"})]}),"\n",(0,t.jsx)(n.li,{children:"Sign up or log in to your account"}),"\n",(0,t.jsxs)(n.li,{children:["Navigate to ",(0,t.jsx)(n.strong,{children:"API Keys"})," section"]}),"\n",(0,t.jsxs)(n.li,{children:["Click ",(0,t.jsx)(n.strong,{children:"Create new key"})]}),"\n",(0,t.jsx)(n.li,{children:"Copy and securely store your key"}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{title:"Security Best Practices",type:"warning",children:(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Never commit API keys to version control"}),"\n",(0,t.jsx)(n.li,{children:"Use environment variables or secure vaults"}),"\n",(0,t.jsx)(n.li,{children:"Rotate keys regularly"}),"\n",(0,t.jsx)(n.li,{children:"Monitor usage for unexpected spikes"}),"\n"]})}),"\n",(0,t.jsx)(n.h2,{id:"performance-optimization",children:"Performance Optimization"}),"\n",(0,t.jsx)(n.h3,{id:"model-selection-guide",children:"Model Selection Guide"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Use Case"}),(0,t.jsx)(n.th,{children:"Recommended Model"}),(0,t.jsx)(n.th,{children:"Why"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.strong,{children:"Cost-sensitive apps"})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mistral-small-latest"})}),(0,t.jsx)(n.td,{children:"Best price/performance ratio"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.strong,{children:"Complex reasoning"})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"magistral-medium-latest"})}),(0,t.jsx)(n.td,{children:"Step-by-step thinking"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.strong,{children:"Code generation"})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"codestral-latest"})}),(0,t.jsx)(n.td,{children:"Specialized for programming"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.strong,{children:"Vision tasks"})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mistral-large-2512"})}),(0,t.jsx)(n.td,{children:"Current multimodal model"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.strong,{children:"High-volume production"})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mistral-medium-latest"})}),(0,t.jsx)(n.td,{children:"Balanced cost and quality"})]})]})]}),"\n",(0,t.jsx)(n.h3,{id:"context-window-optimization",children:"Context Window Optimization"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"providers:\n  - id: mistral:magistral-medium-latest\n    config:\n      max_tokens: 8000 # Leave room for 128k input context\n      temperature: 0.7\n"})}),"\n",(0,t.jsx)(n.h3,{id:"cost-management",children:"Cost Management"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"# Monitor costs across models\ndefaultTest:\n  assert:\n    - type: cost\n      threshold: 0.05 # Alert if cost > $0.05 per test\n\nproviders:\n  - id: mistral:mistral-small-latest # Most cost-effective\n    config:\n      max_tokens: 500 # Limit output length\n"})}),"\n",(0,t.jsx)(n.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,t.jsx)(n.h3,{id:"common-issues",children:"Common Issues"}),"\n",(0,t.jsx)(n.h4,{id:"authentication-errors",children:"Authentication 
1Errors"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"Error: 401 Unauthorized\n"})}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Solution"}),": Verify your API key is correctly set:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"echo $MISTRAL_API_KEY\n# Should output your key, not empty\n"})}),"\n",(0,t.jsx)(n.h4,{id:"rate-limiting",children:"Rate Limiting"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"Error: 429 Too Many Requests\n"})}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Solutions"}),":"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Implement exponential backoff"}),"\n",(0,t.jsx)(n.li,{children:"Use smaller batch sizes"}),"\n",(0,t.jsx)(n.li,{children:"Consider upgrading your plan"}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["The Mistral provider has no ",(0,t.jsx)(n.code,{children:"timeout"})," config option. Request timeouts come from the\n",(0,t.jsx)(n.code,{children:"REQUEST_TIMEOUT_MS"})," environment variable (default 300000), and concurrency is controlled by the\n",(0,t.jsx)(n.code,{children:"--max-concurrency"})," flag:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"REQUEST_TIMEOUT_MS=600000 promptfoo eval --max-concurrency 1\n"})}),"\n",(0,t.jsx)(n.h4,{id:"context-length-exceeded",children:"Context Length Exceeded"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"Error: Context length exceeded\n"})}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Solutions"}),":"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Truncate input text"}),"\n",(0,t.jsx)(n.li,{children:"Use models with larger context windows"}),"\n",(0,t.jsx)(n.li,{children:"Implement text summarization for long inputs"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"providers:\n  - id: mistral:mistral-medium-latest # 256k context\n    config:\n      max_tokens: 4000 # Leave room for input\n"})}),"\n",(0,t.jsx)(n.h4,{id:"model-availability",children:"Model Availability"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"Error: Model not found\n"})}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Solution"}),": Check model names and use latest versions:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"providers:\n  - mistral:mistral-large-latest # \u2705 Use latest\n  # - mistral:mistral-large-2402  # \u274c Retired\n"})}),"\n",(0,t.jsx)(n.h3,{id:"debugging-tips",children:"Debugging Tips"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Enable debug logging"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"export DEBUG=promptfoo:*\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Test with simple prompts first"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"tests:\n  - vars:\n      prompt: 'Hello, world!'\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Check token usage"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"tests:\n  - assert:\n      - type: cost\n        threshold: 0.01\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"getting-help",children:"Getting Help"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Documentation"}),": ",(0,t.jsx)(n.a,{href:"https://docs.mistral.ai",children:"docs.mistral.ai"})]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Community"}),": ",(0,t.jsx)(n.a,{href:"https://discord.gg/mistralai",children:"Discord"})]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Support"}),": ",(0,t.jsx)(n.a,{href:"mailto:[email protected]",children:"[email protected]"})]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Status"}),": ",(0,t.jsx)(n.a,{href:"https://status.mistral.ai",children:"status.mistral.ai"})]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"working-examples",children:"Working Examples"}),"\n",(0,t.jsx)(n.p,{children:"Ready-to-use examples are available in our GitHub repository:"}),"\n",(0,t.jsxs)(n.h3,{id:"-complete-mistral-example-collection",children:["\ud83d\udccb ",(0,t.jsx)(n.a,{href:"https://github.com/promptfoo/promptfoo/tree/main/examples/mistral",children:"Complete Mistral Example Collection"})]}),"\n",(0,t.jsx)(n.p,{children:"Run any of these examples locally:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npx promptfoo@latest init --example mistral\n"})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"Individual Examples:"})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.a,{href:"https://github.com/promptfoo/promptfoo/blob/main/examples/mistral/promptfooconfig.aime2024.yaml",children:"AIME2024 Mathematical Reasoning"})})," - Evaluate Magistral models on advanced mathematical competition problems"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.a,{href:"https://github.com/promptfoo/promptfoo/blob/main/examples/mistral/promptfooconfig.comparison.yaml",children:"Model Comparison"})})," - Compare reasoning across Magistral and traditional models"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.a,{href:"https://github.com/promptfoo/promptfoo/blob/main/examples/mistral/promptfooconfig.tool-use.yaml",children:"Function Calling"})})," - Demonstrate tool use and function calling"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.a,{href:"https://github.com/promptfoo/promptfoo/blob/main/examples/mistral/promptfooconfig.json-mode.yaml",children:"JSON Mode"})})," - Structured output generation"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.a,{href:"https://github.com/promptfoo/promptfoo/blob/main/examples/mistral/promptfooconfig.code-generation.yaml",children:"Code Generation"})})," - Multi-language code generation with Codestral"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.a,{href:"https://github.com/promptfoo/promptfoo/blob/main/examples/mistral/promptfooconfig.reasoning.yaml",children:"Reasoning Tasks"})})," - Advanced step-by-step problem solving"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.a,{href:"https://github.com/promptfoo/promptfoo/blob/main/examples/mistral/promptfooconfig.multimodal.yaml",children:"Multimodal"})})," - Vision capabilities with a current multimodal model (",(0,t.jsx)(n.code,{children:"mistral-large-2512"}),")"]}),"\n"]}
1),"\n",(0,t.jsx)(n.h3,{id:"quick-start",children:"Quick Start"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"# Try the basic comparison\nnpx promptfoo@latest eval -c https://raw.githubusercontent.com/promptfoo/promptfoo/main/examples/mistral/promptfooconfig.comparison.yaml\n\n# Test mathematical reasoning with Magistral models\nnpx promptfoo@latest eval -c https://raw.githubusercontent.com/promptfoo/promptfoo/main/examples/mistral/promptfooconfig.aime2024.yaml\n\n# Test reasoning capabilities\nnpx promptfoo@latest eval -c https://raw.githubusercontent.com/promptfoo/promptfoo/main/examples/mistral/promptfooconfig.reasoning.yaml\n"})}),"\n",(0,t.jsx)(n.admonition,{title:"Contribute Examples",type:"tip",children:(0,t.jsxs)(n.p,{children:["Found a great use case? ",(0,t.jsx)(n.a,{href:"https://github.com/promptfoo/promptfoo/tree/main/examples",children:"Contribute your example"})," to help the community!"]})})]})}function m(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},43023(e,n,i){i.d(n,{R:()=>r,x:()=>a});var s=i(63696);const t={},l=s.createContext(t);function r(e){const n=s.useContext(l);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.