litellm/tests/unit/proxy/pass_through_endpoints
izzybn 1323d0568c
fix(bedrock): log count-tokens pass-through 400s and 429s as stdout warnings (#53595)
* fix(bedrock): log a provider 4xx on the count-tokens pass-through as a warning

* fix(bedrock): keep count-tokens 401/403/404 at ERROR and send caller-error warnings to stdout

Only a Bedrock 400 or 429 on the count-tokens pass-through is a caller error.
A 401, 403 or 404 points at the deployment's own credentials, permissions or
model id, so it stays at ERROR with 5xx and proxy-side failures.

Caller-error warnings log through the stdout child logger, so collectors that
take severity from the stream no longer flag them as errors.

* fix(bedrock): keep count-tokens 400s for an invalid model id at ERROR

Bedrock answers a wrong deployment model id with a 400, "The provided
model identifier is invalid.", which is an operator fault. Keep that
400 at ERROR on stderr while other 400s and 429s stay stdout warnings,
and drop the logger comment that repeated the handler docstring.

* fix(bedrock): log only caller refusals as stdout warnings on every Bedrock count route

* fix(bedrock): keep count refusal logger names and mark caller errors for stdout

Caller-refused Bedrock counts kept their stdout routing but moved to the
"LiteLLM Proxy.stdout" logger, which changed the JSON component field and
let SDK users' "LiteLLM" logger level stop filtering the counter warning.
Both call sites now log through their original loggers and set a record
marker that LevelRoutingStreamHandler reads to pick stdout.

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-23 06:46:35 +00:00
..
llm_provider_handlers fix(gemini): bill batch embeddings from usageMetadata so media inputs are not free (#49682) 2026-11-23 04:02:39 +00:00
__init__.py test(proxy): move middleware, spend_tracking, pass_through, common_utils and root proxy tests into tests/unit/proxy (#44015) 2026-10-01 18:23:31 +00:00
test_carry_guardrail_logging_info.py test(proxy): move middleware, spend_tracking, pass_through, common_utils and root proxy tests into tests/unit/proxy (#44015) 2026-10-01 18:23:31 +00:00
test_codex_passthrough_endpoints.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_cursor_cli_passthrough_endpoints.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_deepgram_ws_passthrough_routes.py test(auth): use the production cache in auth fixtures (#52754) 2026-11-19 03:43:24 +00:00
test_injected_stream_usage.py fix(vllm): write spend log rows for /vllm passthrough calls to router models (#45733) 2026-10-14 12:40:48 -07:00
test_llm_pass_through_endpoints.py fix(bedrock): log count-tokens pass-through 400s and 429s as stdout warnings (#53595) 2026-11-23 06:46:35 +00:00
test_llm_passthrough_endpoints.py fix(proxy): close encoded and backslash paths that skip the Gemini pass-through file ownership check (#53210) 2026-11-20 15:08:57 -08:00
test_managed_id_rewriter.py fix(streaming): keep merged think tags balanced and split SSE lines only on CR/LF (#48755) 2026-10-28 17:00:29 -07:00
test_method_specific_routing.py test(proxy): move middleware, spend_tracking, pass_through, common_utils and root proxy tests into tests/unit/proxy (#44015) 2026-10-01 18:23:31 +00:00
test_pass_through_endpoints.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_passthrough_auth_default.py feat(auth): decide key and JWT authentication in a Rust core (#51374) 2026-11-17 14:07:47 +09:00
test_passthrough_endpoint_router.py feat(pass-through): add eu/jev decision API pass-through with spend tracking (#46875) 2026-10-29 17:52:43 -07:00
test_passthrough_endpoints_common_utils.py test(proxy): move middleware, spend_tracking, pass_through, common_utils and root proxy tests into tests/unit/proxy (#44015) 2026-10-01 18:23:31 +00:00
test_passthrough_guardrail_block_otel_span.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_passthrough_guardrails.py fix(responses): run the guardrails a Responses WebSocket frame selects (#48725) 2026-10-30 14:12:51 -07:00
test_passthrough_guardrails_field_targeting.py test(proxy): move middleware, spend_tracking, pass_through, common_utils and root proxy tests into tests/unit/proxy (#44015) 2026-10-01 18:23:31 +00:00
test_passthrough_post_call_guardrails.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_streaming_handler.py feat(anthropic): price Claude subscription OAuth allowance usage at $0, overage at API rates (#52901) 2026-11-19 15:08:39 -08:00
test_streaming_handler_interrupt.py feat(proxy): per-request header opts a stream into usage.cost without the global include_cost_in_streaming_usage flag (#50574) 2026-11-07 16:57:20 -08:00
test_success_handler.py feat(budgets): replace the python budget hold and settle engine with a rust engine admitted at auth (#51535) 2026-11-15 16:03:51 -08:00
test_upstream_usage_headers.py fix(otel): label configured pass-through routes litellm.passthrough and read the operation from the upstream (#48675) 2026-10-28 10:48:34 -07:00
test_vector_store_fallbacks.py feat(vector-stores): fail over native search passthrough to configured fallback stores (#52856) 2026-11-19 09:51:41 -08:00
test_vertex_ai_batch_passthrough.py refactor(router): move router callers onto the entry points and invert the proxy imports (#48847) 2026-10-29 17:26:33 +00:00
test_vertex_ai_live_passthrough.py test: move 81 legacy live tests in pass-through, spend, batches, audio, search, guardrails, image and ocr dirs offline (#45288) 2026-10-08 02:38:12 -07:00
test_vertex_passthrough_load_balancing.py fix(proxy): reserve least-busy picks on Vertex pass-through calls (#53588) 2026-11-23 04:21:20 +00:00
test_watsonx_proxy_route.py fix(watsonx): read pass-through credentials from use_in_pass_through deployments (#49462) 2026-10-31 11:53:25 -07:00