MistralProvider
European AI models for prose generation – structured output coverage is uneven, so prefer Gemini for blocks and layouts.
Use Mistral through its OpenAI-compatible API. Configuration mirrors OpenAIProvider – only the default base URL and model differ.
final class MistralProvider extends OpenAIProvider
{
public const DEFAULT_BASE_URL = 'https://api.mistral.ai/v1';
public const DEFAULT_MODEL = 'mistral-small-latest';
}
Configuration
config.php
return [
'johannschopplich.copilot' => [
'provider' => 'mistral',
'providers' => [
'mistral' => [
'apiKey' => env('MISTRAL_API_KEY'),
'model' => 'mistral-small-latest',
],
],
],
];
Mistral's structured output coverage varies by model. Smaller models in particular may emit looser JSON than the schema requires – the provider rethrows as
ProviderException(reason: 'response was not a JSON object') when this happens. For blocks and layouts, prefer Gemini.