BerriAI/litellm · error · Exception
Unable to map model response to known provider format. model
Error message
Unable to map model response to known provider format. model={model} What it means
After dispatching the raw Bedrock responses to the per-provider _transform_response handlers, the dispatcher found returned_response still None — meaning the provider selected for the model produced no mapped EmbeddingResponse. This is an internal mapping gap (or an unrecognized response shape) rather than a user input error in the usual sense.
Source
Thrown at litellm/llms/bedrock/embed/embedding.py:223
returned_response = AmazonTitanG1Config()._transform_response(response_list=response_list, model=model)
elif model == "amazon.titan-embed-text-v2:0":
returned_response = AmazonTitanV2Config()._transform_response(response_list=response_list, model=model)
elif model == "amazon.titan-embed-g1-text-02":
returned_response = AmazonTitanG1Config()._transform_response(response_list=response_list, model=model)
elif provider == "twelvelabs":
returned_response = TwelveLabsMarengoEmbeddingConfig()._transform_response(
response_list=response_list, model=model
)
elif provider == "nova":
returned_response = AmazonNovaEmbeddingConfig()._transform_response(
response_list=response_list, model=model, batch_data=batch_data
)
##########################################################
# Validate returned response
##########################################################
if returned_response is None:
raise Exception(f"Unable to map model response to known provider format. model={model}")
return returned_response
def _single_func_embeddings(
self,
client: HTTPHandler | None,
timeout: float | httpx.Timeout | None,
batch_data: list[dict],
credentials: Any,
extra_headers: dict | None,
endpoint_url: str,
aws_region_name: str,
model: str,
logging_obj: Any,
provider: BEDROCK_EMBEDDING_PROVIDERS_LITERAL,
api_key: str | None = None,
is_async_invoke: bool | None = False,
):
responses: Final[list[dict]] = []View on GitHub (pinned to 6c2dcb801b)
Solutions
- Upgrade litellm to the latest release — new Bedrock embedding models are added frequently.
- Print the exact model string passed (after async_invoke/ stripping) and compare with litellm's supported bedrock embedding providers (cohere, amazon, titan, twelvelabs, nova).
- If the model is genuinely unsupported, switch to a supported equivalent (e.g. amazon.titan-embed-text-v2:0).
- Report the model + raw response to the litellm repo if the model is listed as supported.
Example fix
# before resp = litellm.embedding(model="bedrock/<brand-new-embedding-model>", input=["hi"]) # after pip install -U litellm resp = litellm.embedding(model="bedrock/amazon.titan-embed-text-v2:0", input=["hi"])
Defensive patterns
Strategy: validation
Validate before calling
import litellm
from litellm.llms.bedrock.embed.embedding import BedrockEmbeddingConfig
SUPPORTED = {"cohere", "amazon", "titan", "twelvelabs", "nova"}
assert model.split("/")[-1].split(".")[0] in SUPPORTED or "titan" in model Type guard
def is_supported_bedrock_embedding_model(model: str) -> bool:
stem = model.removeprefix("bedrock/").removeprefix("async_invoke/")
return any(p in stem for p in ("cohere", "titan", "amazon", "twelvelabs", "nova")) Try / catch
try:
resp = litellm.embedding(model=model, input=["hi"])
except Exception as e:
if "Unable to map model response" in str(e):
log.warning("unsupported bedrock embedding model %s on litellm %s", model, litellm.__version__)
raise Prevention
- Pin the litellm version in CI and add a smoke test per model you use.
- Test new Bedrock embedding models against your installed litellm version before rollout.
- Keep a curated allow-list of validated model ids in config.
When it happens
Trigger: A model string that routes to a provider branch which returns None (e.g. a provider case that does not match, or a response payload shape the transformer does not recognize), so the final 'Validate returned response' guard fires.
Common situations: Using a newly released Bedrock embedding model not yet in the installed LiteLLM version's transformation map; a provider branch silently not setting returned_response; upgrading AWS model versions while running an older litellm release.
Related errors
- Invalid data URL format: {data_url[:50]}...
- Invalid data URL format (missing comma): {data_url[:50]}...
- output_s3_uri is required for async invoke requests
- No embedding data found in response: {response}
- Missing boto3 to call bedrock. Run 'pip install boto3'.
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/414758d6169bf154.
Report an issue: GitHub.