Providers

Mistral

European AI with Mistral Large, Medium, and Small models

🟣

Mistral

European AI - Mistral Large, Medium, Small

Mistral

French AI company with excellent models. Good for European data residency requirements.


Setup

1. Get API Key

Get your API key from console.mistral.ai

2. Add Environment Variable

# .env.local
MISTRAL_API_KEY=...

3. Configure Provider

<YourGPTProvider
  runtimeUrl="/api/chat"
  llm={{
    provider: 'mistral',
    model: 'mistral-large-latest',
  }}
>
  <CopilotChat />
</YourGPTProvider>

Available Models

ModelContextBest For
mistral-large-latest128KComplex reasoning
mistral-medium-latest32KBalanced
mistral-small-latest32KFast, efficient
codestral-latest32KCode generation
open-mixtral-8x22b64KOpen-weight flagship

Recommended: mistral-large-latest for quality, mistral-small-latest for cost efficiency.


Configuration Options

llm={{
  provider: 'mistral',
  model: 'mistral-large-latest',
  temperature: 0.7,
  maxTokens: 4096,
  topP: 1,
}}

European Data Residency

Mistral is based in France and offers European data processing:

// Good for GDPR compliance
<YourGPTProvider
  llm={{
    provider: 'mistral',
    model: 'mistral-large-latest',
  }}
  // Data stays in Europe
>

If you need European data residency for compliance, Mistral is an excellent choice.


Code Generation (Codestral)

Mistral's code-specialized model:

<YourGPTProvider
  llm={{
    provider: 'mistral',
    model: 'codestral-latest',
  }}
  systemPrompt="You are a coding assistant. Help users write and debug code."
>

Tool Calling

useToolWithSchema({
  name: 'translate_text',
  description: 'Translate text between languages',
  schema: z.object({
    text: z.string(),
    from: z.string(),
    to: z.string(),
  }),
  handler: async ({ text, from, to }) => {
    // Mistral handles European languages very well
    const translated = await translate(text, from, to);
    return { success: true, data: { translated } };
  },
});

Pricing

ModelInputOutput
mistral-large$2/1M tokens$6/1M tokens
mistral-small$0.2/1M tokens$0.6/1M tokens
codestral$0.2/1M tokens$0.6/1M tokens

Check Mistral pricing for current rates.


Next Steps

On this page