litellm/tests/unit/llms/bedrock
zoveki ebf4991f75
fix(gateway): serve messages drop, summary and timeout settings like Python (#51236)
* fix(gateway): fill messages settings from LITELLM_DROP_PARAMS, the request, and litellm_settings

* fix(gateway): honor a deployment's timeout over request_timeout on messages, read numeric settings flags, and delete drop paths in place

* feat(gateway): honor request drop_params, additional_drop_params, reasoning_auto_summary and request_timeout on /v1/messages

The standalone gateway answered 501 for a request's drop_params and
additional_drop_params, a deployment's additional_drop_params, and
litellm_settings.reasoning_auto_summary and request_timeout. It now reads
each the way the Python proxy does and keeps sending to Python only the
corners where the two would differ. The unsupported-param 400 hint now
also names the proxy config key.

* perf(core-utils): delete additional_drop_params paths in place

delete_nested_value rebuilt every object along a path, so each path cost
the width of the widest map it crossed. A request can now set its own
additional_drop_params on the native /v1/messages route, and 10,000 absent
paths over a 10,000-property tool schema took about 50 seconds. Paths are
now removed in place, an absent key costs one lookup, and key order is kept.

* fix(gateway): read request_timeout where Python does, answer timeouts 408, and drop paths in one pass

The Python lane's sampling and speed 400 hints also name the proxy config key

* fix(gateway): drop overlapping paths in one visit and share the drop hint across Anthropic and Bedrock errors

* fix(gateway): read REQUEST_TIMEOUT only from the process environment

Python reads REQUEST_TIMEOUT once when litellm is imported, before the proxy
exports the config's environment_variables, so a timeout the config exports
never applies there. The gateway now reads it from its own process
environment alone, so such a config no longer times out calls Python serves

* fix(core-utils): walk drop paths without building a tree, so a deep path cannot overflow the stack

* fix(core-utils): read each drop path segment once, so a long path under [*] cannot stall a request

The walk read the rest of every path again at each list element, so one path with a long field name under [*] hashed that name once per element. Paths now grow a tree only as deep as the body goes, with each field name numbered once and each object matched from its smaller side.

* fix(core-utils): cap the drop path routes that reach one value, so overlapping paths cannot stall a request

Paths mixing [*] and index steps reach one value through one node per distinct run, and that count
doubles with every level, so 65,536 overlapping paths over 100,000 list elements held a worker past
120s. At most 64 nodes may now reach one value, and past that the call answers 400 naming
additional_drop_params. A list also reads whichever is smaller now, its named indexes or its elements

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-25 09:26:12 +00:00
..
batches fix(batches): keep the endpoint a batch was created for on retrieve, cancel and cost polling (#50784) 2026-11-24 05:42:08 -08:00
chat fix(gateway): serve messages drop, summary and timeout settings like Python (#51236) 2026-11-25 09:26:12 +00:00
count_tokens fix(token_counter): count an Anthropic fallback block as zero on every count route (#54006) 2026-11-24 03:32:34 -08:00
embed fix(bedrock): accept the OpenAI SDK default encoding_format on Nova embeddings (#53755) 2026-11-23 10:00:50 -08:00
files fix(anthropic): answer 400 naming a malformed thinking_blocks instead of 500 (#53762) 2026-11-24 03:06:47 -08:00
image
image_edit refactor(rust_bridge): route every Rust-to-Python call through host modules (#50822) 2026-11-11 01:57:54 +00:00
image_generation
invoke_agent fix(sagemaker,bedrock): answer 502 when a 200 AWS event stream decodes to no events or ends mid-frame (#53482) 2026-11-22 23:59:32 +00:00
messages fix(bedrock): stop naming typed tools on Bedrock invoke /v1/messages so toolset entries reach Claude (#51756) 2026-11-24 02:44:38 -08:00
passthrough feat(bedrock): derive STS session tags and session name from caller identity (#52978) 2026-11-19 17:11:09 -08:00
realtime fix(realtime): enforce TPM limits during realtime sessions (#53689) 2026-11-24 05:15:04 -08:00
rerank
responses fix(bedrock): send native chat and Responses calls to aws_bedrock_runtime_endpoint like Converse (#50582) 2026-11-19 16:40:23 -08:00
search fix(streaming): keep merged think tags balanced and split SSE lines only on CR/LF (#48755) 2026-10-28 17:00:29 -07:00
vector_stores fix(bedrock): map OpenAI vector store search filters to AWS RetrievalFilter (#51291) 2026-11-14 13:39:43 -05:00
__init__.py
event_loop_probe.py test(bedrock): detect Vault reads on the event-loop thread (#47597) 2026-10-20 10:45:04 -07:00
slow_upstream.py fix(router)!: bound fake-streamed calls by the request timeout, not stream_timeout (#47162) 2026-10-17 22:08:02 +00:00
test_anthropic_beta_support.py refactor(llms): rename model-version transformation files to family names (#48509) 2026-10-26 18:53:16 -07:00
test_base_aws_llm.py fix(bedrock): treat an empty api_base or runtime endpoint as unset (#51244) 2026-11-24 00:36:07 +00:00
test_bedrock_common_utils.py fix(bedrock): keep shared $defs in Claude tool schemas and bound inlining for other models (#51137) 2026-11-24 04:42:19 -08:00
test_bedrock_model_listing.py fix(bedrock): discover models through the configured control-plane endpoint (#50840) 2026-11-24 14:09:25 -08:00
test_bedrock_ssl_verify.py
test_claude_platform_provider.py fix(anthropic): drop unsigned thinking blocks before /v1/messages reaches Claude (#51793) 2026-11-24 05:30:55 +00:00
test_converse_context_management.py
test_cost_calculation.py feat(cost): price Claude token calls, budget holds and auth price checks in Rust (#52484) 2026-11-23 22:00:28 +00:00
test_cross_region_inference_profile_mapping.py
test_guardrail_attachments.py fix(guardrails): scan or refuse attachments in the bedrock guardrail (#43383) 2026-10-10 16:48:37 -07:00
test_mantle.py feat(messages): serve bedrock mantle messages on rust only (#52328) 2026-11-18 17:36:06 -08:00
test_nova_imported_models.py fix(bedrock): route a Bedrock model id with no Invoke provider to Converse (#43290) 2026-10-30 06:27:59 -07:00
test_request_metadata.py feat(messages): serve bedrock claude_platform messages on rust only (#52681) 2026-11-19 14:34:02 -08:00
test_session_identity.py feat(bedrock): derive STS session tags and session name from caller identity (#52978) 2026-11-19 17:11:09 -08:00
test_web_identity_session_policy.py fix(bedrock): discover models through the configured control-plane endpoint (#50840) 2026-11-24 14:09:25 -08:00