microsoft/semantic-kernel · error · NotSupportedException

Unsupported Meta model: {modelId}

Error message

Unsupported Meta model: {modelId}

What it means

CreateTextGenerationService routes Meta models to MetaService only when the model name starts with 'llama3-'. Any other Meta model name throws NotSupportedException.

Source

Thrown at dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/BedrockServiceFactory.cs:86

                    return new AnthropicService();
                }
                throw new NotSupportedException($"Unsupported Anthropic model: {modelId}");
            case "COHERE":
                if (modelName.StartsWith("command-r", StringComparison.OrdinalIgnoreCase))
                {
                    return new CohereCommandRService();
                }
                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>

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Use a Meta Llama 3 modelId such as 'meta.llama3-8b-instruct-v1:0'.
  2. Upgrade Connectors.Amazon for newer Meta model support.
  3. Verify the model name starts with 'llama3-'.

Example fix

// before
var modelId = "meta.llama2-13b-chat-v1:0";
// -> NotSupportedException: Unsupported Meta model

// after
var modelId = "meta.llama3-8b-instruct-v1:0";
Defensive patterns

Strategy: validation

Validate before calling

static bool IsSupportedMetaTextModel(string modelId)
{
    var (provider, name) = SplitModelId(modelId);
    return provider.Equals("meta", StringComparison.OrdinalIgnoreCase)
        && name.StartsWith("llama3-", StringComparison.OrdinalIgnoreCase);
}

Type guard

static bool IsSupportedMetaTextModel(string modelId)
{
    var (provider, name) = SplitModelId(modelId);
    return provider.Equals("meta", StringComparison.OrdinalIgnoreCase)
        && name.StartsWith("llama3-", StringComparison.OrdinalIgnoreCase);
}

Try / catch

try
{
    var text = await bedrockTextGen.GetTextContentAsync(prompt, settings, ct);
}
catch (NotSupportedException ex) when (ex.Message.Contains("Meta"))
{
    logger.LogError(ex, "Meta modelId '{Id}' not supported. Use llama3-*.", modelId);
    throw;
}

Prevention

When it happens

Trigger: Text generation with modelId provider 'meta' whose model-name segment does not start with 'llama3-' (e.g. 'meta.llama2-13b-chat-v1' or a future 'llama4-' model not yet supported).

Common situations: Using Llama 2 (not supported, only llama3-). Using a newer Llama family the connector version doesn't recognize. Typo in modelId.

Related errors


AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13). Data as JSON: /api/errors/caed10a642d2c4af. Report an issue: GitHub.