BerriAI/litellm · error · BedrockError
Bedrock Invoke HTTPX: Unknown provider={provider}, model={mo
Error message
Bedrock Invoke HTTPX: Unknown provider={provider}, model={model}. Try calling via converse route - `bedrock/converse/<model>`. What it means
Raised by BaseAmazonInvokeConfig.transform_request when the provider segment parsed from the model string (bedrock/<provider>.<model>) does not match any known Invoke-API transformation (anthropic, cohere, ai21, meta/llama, mistral, amazon, openai, deepseek_r1, twelvelabs). It is a BedrockError 404 with a message that suggests using the Converse route instead.
Source
Thrown at litellm/llms/bedrock/chat/invoke_transformations/base_invoke_transformation.py:269
elif provider == "twelvelabs":
return litellm.AmazonTwelveLabsPegasusConfig().transform_request(
model=model,
messages=messages,
optional_params=optional_params,
litellm_params=litellm_params,
headers=headers,
)
elif provider == "openai":
# OpenAI imported models use OpenAI Chat Completions format
return litellm.AmazonBedrockOpenAIConfig().transform_request(
model=model,
messages=messages,
optional_params=optional_params,
litellm_params=litellm_params,
headers=headers,
)
else:
raise BedrockError(
status_code=404,
message=f"Bedrock Invoke HTTPX: Unknown provider={provider}, model={model}. Try calling via converse route - `bedrock/converse/<model>`.",
)
return request_data
def transform_response(
self,
model: str,
raw_response: httpx.Response,
model_response: ModelResponse,
logging_obj: LiteLLMLoggingObj,
request_data: dict,
messages: list[AllMessageValues],
optional_params: dict,
litellm_params: dict,
encoding: Any,
api_key: str | None = None,View on GitHub (pinned to 6c2dcb801b)
Solutions
- Switch the model string to bedrock/converse/<model> as the message suggests - Converse handles all providers uniformly.
- Upgrade litellm to a version that maps the new provider.
- Fix typos in the provider segment of the model ID (e.g. bedrock/meta.llama3-..., bedrock/cohere.command-...).
- For imported OpenAI models on Bedrock use the bedrock/openai.* naming supported by recent litellm.
Example fix
# before resp = litellm.completion(model="bedrock/<newprovider>.<new-model>", messages=msgs) # after resp = litellm.completion(model="bedrock/converse/<newprovider>.<new-model>", messages=msgs)
Defensive patterns
Strategy: validation
Validate before calling
KNOWN_PROVIDERS = {"anthropic", "cohere", "ai21", "meta", "llama", "mistral", "amazon", "openai", "deepseek_r1", "twelvelabs"}
def normalize_bedrock_model(model: str) -> str:
provider = model.split("/", 1)[-1].split(".", 1)[0]
if provider not in KNOWN_PROVIDERS:
return f"bedrock/converse/{model.split('/', 1)[1]}" # unknown to invoke -> converse
return model Type guard
def is_invoke_supported(model: str) -> bool:
try:
provider = model.split("/", 1)[1].split(".", 1)[0]
except IndexError:
return False
return provider in {"anthropic", "cohere", "ai21", "meta", "llama", "mistral", "amazon", "openai", "deepseek_r1", "twelvelabs"} Try / catch
from litellm.exceptions import BedrockError
try:
resp = litellm.completion(model=model, messages=msgs)
except BedrockError as e:
if e.status_code == 404 and "Unknown provider" in str(e):
resp = litellm.completion(model=model.replace("bedrock/", "bedrock/converse/", 1), messages=msgs)
else:
raise Prevention
- Default to the bedrock/converse/ prefix for all new models.
- Maintain a validated model catalog in your app and reject unknown model strings early.
When it happens
Trigger: Using a model string like bedrock/myvendor.custom-model-v1 or bedrock/<unrecognized>.<model> through the legacy invoke path, including new providers (e.g. newly launched Bedrock models) not yet mapped in the installed litellm version.
Common situations: AWS launches a new provider/model before litellm adds the invoke transformer, typo in the model string provider segment, or attempting bedrock/openai.* without the openai mapping in older versions.
Related errors
- Error processing={raw_response.text}, Received error={e}
- Unexpected mistral completion response
- Error parsing received text={outputText}.\nError-{e}
- Model needs to be set for bedrock
- BedrockException: Context Window Error - {error_str}
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/556747d3e412725a.
Report an issue: GitHub.