microsoft/semantic-kernel · error · NotSupportedException
Unsupported Mistral model: {modelId}
Error message
Unsupported Mistral model: {modelId} What it means
CreateTextGenerationService routes Mistral models to MistralService when the model name starts with 'mistral-' or 'mixtral-'. Any other Mistral model name throws NotSupportedException.
Source
Thrown at dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/BedrockServiceFactory.cs:93
}
if (modelName.StartsWith("command-", StringComparison.OrdinalIgnoreCase))
{
return new CohereCommandService();
}
throw new NotSupportedException($"Unsupported Cohere model: {modelId}");
case "META":
if (modelName.StartsWith("llama3-", StringComparison.OrdinalIgnoreCase))
{
return new MetaService();
}
throw new NotSupportedException($"Unsupported Meta model: {modelId}");
case "MISTRAL":
if (modelName.StartsWith("mistral-", StringComparison.OrdinalIgnoreCase)
|| modelName.StartsWith("mixtral-", StringComparison.OrdinalIgnoreCase))
{
return new MistralService();
}
throw new NotSupportedException($"Unsupported Mistral model: {modelId}");
default:
throw new NotSupportedException($"Unsupported model provider: {modelProvider}");
}
}
/// <summary>
/// Gets the model service for body conversion.
/// </summary>
/// <param name="modelId">The model to get the service for.</param>
/// <returns><see cref="IBedrockChatCompletionService"/> object</returns>
/// <exception cref="NotSupportedException">Thrown if provider or model is not supported for chat completion.</exception>
internal IBedrockChatCompletionService CreateChatCompletionService(string modelId)
{
(string modelProvider, string modelName) = this.GetModelProviderAndName(ScrubCrossRegionPrefix(modelId));
switch (modelProvider.ToUpperInvariant())
{
case "AI21":View on GitHub (pinned to c028a0c7dc)
Solutions
- Use a recognized Mistral modelId such as 'mistral.mistral-7b-instruct-v0:2' or 'mistral.mixtral-8x7b-instruct-v0:1'.
- Upgrade Connectors.Amazon for newer Mistral model support.
- Verify the model name starts with 'mistral-' or 'mixtral-'.
Example fix
// before var modelId = "mistral.large-2407-v1:0"; // not a recognized prefix // after var modelId = "mistral.mistral-large-2407-v1:0";
Defensive patterns
Strategy: validation
Validate before calling
static bool IsSupportedMistralTextModel(string modelId)
{
var (provider, name) = SplitModelId(modelId);
return provider.Equals("mistral", StringComparison.OrdinalIgnoreCase)
&& (name.StartsWith("mistral-", StringComparison.OrdinalIgnoreCase)
|| name.StartsWith("mixtral-", StringComparison.OrdinalIgnoreCase));
} Type guard
static bool IsSupportedMistralTextModel(string modelId)
{
var (provider, name) = SplitModelId(modelId);
return provider.Equals("mistral", StringComparison.OrdinalIgnoreCase)
&& (name.StartsWith("mistral-", StringComparison.OrdinalIgnoreCase)
|| name.StartsWith("mixtral-", StringComparison.OrdinalIgnoreCase));
} Try / catch
try
{
var text = await bedrockTextGen.GetTextContentAsync(prompt, settings, ct);
}
catch (NotSupportedException ex) when (ex.Message.Contains("Mistral"))
{
logger.LogError(ex, "Mistral modelId '{Id}' not supported. Use mistral-* or mixtral-*.", modelId);
throw;
} Prevention
- Verify the Mistral model name starts with 'mistral-' or 'mixtral-'.
- Validate modelId before creating the service.
- Upgrade the connector for newly added Mistral naming variants.
When it happens
Trigger: Text generation with modelId provider 'mistral' whose model-name segment starts with neither 'mistral-' nor 'mixtral-' (e.g. a different Mistral naming convention).
Common situations: A new Mistral model family not yet recognized by the installed connector. Typo in modelId. Wrong provider segment.
Related errors
- Unsupported AI21 model: {modelId}
- Unsupported Amazon model: {modelId}
- Unsupported Anthropic model: {modelId}
- Unsupported Cohere model: {modelId}
- Unsupported Meta model: {modelId}
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/1dec1cbcf09bd4df.
Report an issue: GitHub.