{"record":{"id":"1dec1cbcf09bd4df","repo":"microsoft/semantic-kernel","slug":"unsupported-mistral-model-modelid","errorCode":null,"errorMessage":"Unsupported Mistral model: {modelId}","messagePattern":"Unsupported Mistral model: (.+?)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/BedrockServiceFactory.cs","lineNumber":93,"sourceCode":"                }\n                if (modelName.StartsWith(\"command-\", StringComparison.OrdinalIgnoreCase))\n                {\n                    return new CohereCommandService();\n                }\n                throw new NotSupportedException($\"Unsupported Cohere model: {modelId}\");\n            case \"META\":\n                if (modelName.StartsWith(\"llama3-\", StringComparison.OrdinalIgnoreCase))\n                {\n                    return new MetaService();\n                }\n                throw new NotSupportedException($\"Unsupported Meta model: {modelId}\");\n            case \"MISTRAL\":\n                if (modelName.StartsWith(\"mistral-\", StringComparison.OrdinalIgnoreCase)\n                    || modelName.StartsWith(\"mixtral-\", StringComparison.OrdinalIgnoreCase))\n                {\n                    return new MistralService();\n                }\n                throw new NotSupportedException($\"Unsupported Mistral model: {modelId}\");\n            default:\n                throw new NotSupportedException($\"Unsupported model provider: {modelProvider}\");\n        }\n    }\n\n    /// <summary>\n    /// Gets the model service for body conversion.\n    /// </summary>\n    /// <param name=\"modelId\">The model to get the service for.</param>\n    /// <returns><see cref=\"IBedrockChatCompletionService\"/> object</returns>\n    /// <exception cref=\"NotSupportedException\">Thrown if provider or model is not supported for chat completion.</exception>\n    internal IBedrockChatCompletionService CreateChatCompletionService(string modelId)\n    {\n        (string modelProvider, string modelName) = this.GetModelProviderAndName(ScrubCrossRegionPrefix(modelId));\n\n        switch (modelProvider.ToUpperInvariant())\n        {\n            case \"AI21\":","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/BedrockServiceFactory.cs#L75-L111","documentation":"CreateTextGenerationService routes Mistral models to MistralService when the model name starts with 'mistral-' or 'mixtral-'. Any other Mistral model name throws NotSupportedException.","triggerScenarios":"Text generation with modelId provider 'mistral' whose model-name segment starts with neither 'mistral-' nor 'mixtral-' (e.g. a different Mistral naming convention).","commonSituations":"A new Mistral model family not yet recognized by the installed connector. Typo in modelId. Wrong provider segment.","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-'."],"exampleFix":"// before\nvar modelId = \"mistral.large-2407-v1:0\"; // not a recognized prefix\n\n// after\nvar modelId = \"mistral.mistral-large-2407-v1:0\";","handlingStrategy":"validation","validationCode":"static bool IsSupportedMistralTextModel(string modelId)\n{\n    var (provider, name) = SplitModelId(modelId);\n    return provider.Equals(\"mistral\", StringComparison.OrdinalIgnoreCase)\n        && (name.StartsWith(\"mistral-\", StringComparison.OrdinalIgnoreCase)\n            || name.StartsWith(\"mixtral-\", StringComparison.OrdinalIgnoreCase));\n}","typeGuard":"static bool IsSupportedMistralTextModel(string modelId)\n{\n    var (provider, name) = SplitModelId(modelId);\n    return provider.Equals(\"mistral\", StringComparison.OrdinalIgnoreCase)\n        && (name.StartsWith(\"mistral-\", StringComparison.OrdinalIgnoreCase)\n            || name.StartsWith(\"mixtral-\", StringComparison.OrdinalIgnoreCase));\n}","tryCatchPattern":"try\n{\n    var text = await bedrockTextGen.GetTextContentAsync(prompt, settings, ct);\n}\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"Mistral\"))\n{\n    logger.LogError(ex, \"Mistral modelId '{Id}' not supported. Use mistral-* or mixtral-*.\", modelId);\n    throw;\n}","preventionTips":["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."],"tags":["csharp","dotnet","semantic-kernel","bedrock","aws","mistral","model-id","not-supported"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}