BerriAI/litellm · error · Exception
Unmapped model. Received={}. Expected={}
Error message
Unmapped model. Received={}. Expected={} What it means
Inside the amazon/titan batch loop, the model string did not equal any of the four hard-coded titan ids (amazon.titan-embed-image-v1, amazon.titan-embed-text-v1, amazon.titan-embed-text-v2:0, amazon.titan-embed-g1-text-02), so no request transformer could be chosen. Note the message template uses {} placeholders — it renders literally instead of interpolating, which is a minor logging bug in the source.
Source
Thrown at litellm/llms/bedrock/embed/embedding.py:440
transformed_request: AmazonEmbeddingRequest = (
AmazonTitanMultimodalEmbeddingG1Config()._transform_request(
input=i, inference_params=inference_params
)
)
elif model == "amazon.titan-embed-text-v1":
transformed_request = AmazonTitanG1Config()._transform_request(
input=i, inference_params=inference_params
)
elif model == "amazon.titan-embed-text-v2:0":
transformed_request = AmazonTitanV2Config()._transform_request(
input=i, inference_params=inference_params
)
elif model == "amazon.titan-embed-g1-text-02":
transformed_request = AmazonTitanG1Config()._transform_request(
input=i, inference_params=inference_params
)
else:
raise Exception(
"Unmapped model. Received={}. Expected={}".format(
model,
[
"amazon.titan-embed-image-v1",
"amazon.titan-embed-text-v1",
"amazon.titan-embed-text-v2:0",
"amazon.titan-embed-g1-text-02",
],
)
)
batch_data.append(transformed_request)
elif provider == "twelvelabs":
batch_data = []
for i in input:
twelvelabs_request = TwelveLabsMarengoEmbeddingConfig()._transform_request(
input=i,
inference_params=inference_params,
async_invoke_route=has_async_invoke,View on GitHub (pinned to 6c2dcb801b)
Solutions
- Use one of the four exact ids listed in the error: amazon.titan-embed-image-v1, amazon.titan-embed-text-v1, amazon.titan-embed-text-v2:0, amazon.titan-embed-g1-text-02.
- Strip/normalize the model string (whitespace, case) before calling.
- Upgrade litellm if AWS shipped a new titan embedding model.
Example fix
# before resp = litellm.embedding(model="bedrock/amazon.titan-embed-text-v1 ", input=["hi"]) # after resp = litellm.embedding(model="bedrock/amazon.titan-embed-text-v2:0", input=["hi"])
Defensive patterns
Strategy: validation
Validate before calling
TITAN_MODELS = {"amazon.titan-embed-image-v1", "amazon.titan-embed-text-v1", "amazon.titan-embed-text-v2:0", "amazon.titan-embed-g1-text-02"}
assert model.strip() in TITAN_MODELS, f"unsupported titan id: {model!r}" Type guard
def is_known_titan_id(model: str) -> bool:
return model.strip() in {
"amazon.titan-embed-image-v1",
"amazon.titan-embed-text-v1",
"amazon.titan-embed-text-v2:0",
"amazon.titan-embed-g1-text-02",
} Prevention
- Load model ids from config rather than typing them inline.
- Strip whitespace/case-normalize ids at the request boundary.
- Watch litellm release notes when AWS ships new titan variants.
When it happens
Trigger: Provider inference routed to the amazon family (model contains 'titan'/'amazon') but the exact id differs — e.g. 'amazon.titan-embed-text-v2:0 ' with whitespace, wrong casing, a regional suffix, or a new titan variant not in the list.
Common situations: Copy-pasting model ids with trailing whitespace or unicode quotes; newly launched titan embedding versions on an older litellm; case-mismatched ids.
Related errors
- No embedding data found in response: {response}
- Unable to determine bedrock embedding provider for model: {m
- Bedrock Invoke HTTPX: Unknown provider={provider}, model={mo
- Error processing={raw_response.text}, Received error={e}
- Invalid data URL format: {data_url[:50]}...
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/a4ac2c57563db19e.
Report an issue: GitHub.