mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-25 22:20:43 +00:00
* fix(bedrock): send native chat and responses calls to aws_bedrock_runtime_endpoint like converse A deployment that set both api_base and aws_bedrock_runtime_endpoint sent Converse calls to the runtime endpoint but native Chat Completions calls to a full chat/completions api_base, and Responses calls to any api_base. Both native routes now take the host from get_runtime_endpoint, so the runtime endpoint (deployment value, else AWS_BEDROCK_RUNTIME_ENDPOINT) wins on every route. With no runtime endpoint, api_base works as before. Responses also strips a chat/completions suffix from the host, so a full chat URL api_base reaches /openai/v1/responses on that host instead of a doubled path that AWS answers with UnknownOperationException. * fix(bedrock): keep the env runtime endpoint behind api_base, treat an empty endpoint as unset, trim a responses route on native chat Only the deployment's own aws_bedrock_runtime_endpoint now wins over api_base on native chat and Responses. The AWS_BEDROCK_RUNTIME_ENDPOINT env var keeps the rank each route gave it before, so a full chat/completions api_base still wins over it on native chat and any api_base wins over it on Responses An empty aws_bedrock_runtime_endpoint counts as unset on native chat, as it already did on Responses, and a runtime endpoint ending in a responses route is trimmed before native chat adds its chat/completions path * fix(bedrock): name the host a Bedrock call went to in the api base header x-litellm-model-api-base now names the scheme and host of the URL a Bedrock call went to when that host differs from api_base, and keeps api_base otherwise. Adds tests that a caller api_base never moves a deployment pinned to aws_bedrock_runtime_endpoint and that native chat skips an unused region when api_base is set * fix(bedrock): trim a full route URL api_base before adding the Converse path * test(bedrock): type the runtime endpoint tests * fix(bedrock): trim an /openai/v1 api_base on the Converse fallback and keep credentials out of the reported host A json_object request on a Bedrock GPT deployment whose api_base ends in /openai/v1 fell back to Converse at /openai/v1/model/<id>/converse and failed. Converse now trims that base path too. The reported api_base origin drops any user and password from the runtime endpoint URL. --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| core | ||
| __init__.py | ||
| test_enforce_model_rate_limits.py | ||
| test_io_token_rate_limits.py | ||
| test_router.py | ||
| test_router_callback_hook_sequence.py | ||
| test_router_endpoints.py | ||
| test_router_entry_points.py | ||
| test_router_facade.py | ||
| test_router_fallbacks.py | ||
| test_router_fuzz_regressions_rust_only.py | ||
| test_router_get_deployments.py | ||
| test_router_helper_utils.py | ||
| test_router_host.py | ||
| test_router_max_parallel_requests.py | ||
| test_router_provider_endpoints.py | ||
| test_router_retries.py | ||
| test_router_surface_check.py | ||
| test_router_timeout.py | ||
| test_router_vector_store_endpoints.py | ||