litellm/tests/integration/sdk
yujonglee 11af2eb22d
refactor(rust_bridge): route every Rust-to-Python call through host modules (#50822)
* refactor(rust_bridge): route every Rust-to-Python call through host modules

Rust now reaches Python only through litellm/rust_bridge/host/ (plus the
execution driver), and no Python module outside host/ imports it. Library
calls that reproduce Python behavior (httpx and OSError error text,
huggingface_hub downloads, the random generator, os.environ) go through
host functions too. The rule is written into host/AGENTS.md

The live litellm.model_cost table, its version and every Python writer move
to litellm_core_utils/model_cost_table.py, and host/model_cost.py keeps only
the functions Rust calls. The cost map fetch passes use_http_settings instead
of handing Rust an http_settings() snapshot

* refactor(rust_bridge): read REDIS_USERNAME from the process environment in Rust

The Redis bridge asked Python for all of os.environ to read one key. CPython's
os.environ writes through to the process environment, so Rust reads it with
ProcessEnvironment like the rest of the module. Also drops doc comments that
restated their code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(rust): raise the native extension size cap to 55 MB

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 01:57:54 +00:00
..
_model_cost_sdk_child.py refactor(model-cost): move the cost map inputs, fetch and register_model overlay into Rust (#50501) 2026-11-10 02:37:35 +00:00
conftest.py fix(tests): drain SDK logging before restoring callbacks (#46924) 2026-10-16 12:39:26 -07:00
test_aiohttp_session_rebuild_wire.py fix(aiohttp_transport): close an owned aiohttp session when its transport is collected (#48650) 2026-10-27 20:33:03 +00:00
test_anthropic_json_tool_cut_stream_sync_sdk.py fix(bedrock)!: keep Claude's thinking when response_format json_schema is set (#49696) 2026-11-05 04:07:11 +00:00
test_anthropic_messages_bridge_mid_stream_failure_sdk.py
test_azure_prompt_shield_tuple_messages.py
test_bedrock_converse_redacted_thinking_router_sdk.py test(anthropic, bedrock): audit #47489 (#48782) 2026-10-28 04:24:50 -07:00
test_bedrock_converse_stream_sync_decoder_wire.py fix(bedrock): send native structured output first on Opus 4.8 and Sonnet 5 and fall back to the json tool when Bedrock rejects it (#47100) 2026-10-18 00:06:07 +00:00
test_bedrock_model_discovery_sdk.py
test_bedrock_native_guardrail_shared_metadata_sdk.py fix(logging): bill each SDK call its own native Bedrock guardrail trace when calls share one metadata dict (LIT-10239) (#48923) 2026-10-28 15:11:26 -07:00
test_bedrock_native_output_fallback_sdk.py fix(bedrock): send native structured output first on Opus 4.8 and Sonnet 5 and fall back to the json tool when Bedrock rejects it (#47100) 2026-10-18 00:06:07 +00:00
test_bedrock_native_output_register_model_sdk.py refactor(rust_bridge): route every Rust-to-Python call through host modules (#50822) 2026-11-11 01:57:54 +00:00
test_cache_control_census_pydantic_messages_sdk.py
test_caching_redis_sdk.py
test_callback_logging_cache.py
test_databricks_json_schema_refs_sdk.py
test_device_code_login_guard_sdk.py test(copilot): align login guards with direct access tokens (#50285) 2026-11-05 15:38:33 -08:00
test_dual_cache_redis.py test(integration): empty the shared client cache before the tier pin batch test (#50854) 2026-11-10 00:34:27 -08:00
test_exa_search_envelope_sdk.py fix(exa): return highlights, highlight scores, score and the response envelope from Exa search (#47423) 2026-10-19 15:45:56 -07:00
test_gemini_long_decode_sync_sdk.py
test_gemini_tts_speech_logging_sdk.py fix(speech)!: correctly propagate spend logging and usage for Gemini TTS bridge (#44551) 2026-10-19 23:02:11 +00:00
test_generic_api_callback.py
test_google_genai_adapter_stream_usage_sdk.py
test_http2_wire.py test(http2): drain client traffic after sending GOAWAY (#50972) 2026-11-10 18:31:57 +00:00
test_huggingface_tokenizer_downloads_sdk.py fix(token_counter): count DeepSeek V4 text with DeepSeek's own tokenizer (#47353) 2026-10-20 03:43:35 +00:00
test_idle_upstream_reconnect_sdk.py
test_interception_converted_stream_options_sdk.py
test_langfuse_otel_trace_fields_sdk.py fix(langfuse_otel)!: derive trace-level name, input, output and tags on traces litellm starts (#42705) 2026-10-27 10:34:55 -07:00
test_langfuse_redaction_sdk.py
test_local_sandbox_sdk.py test(harness): audit #47530 (#48751) 2026-10-28 01:57:41 -07:00
test_model_cost_fetch_sdk.py refactor(rust_bridge): route every Rust-to-Python call through host modules (#50822) 2026-11-11 01:57:54 +00:00
test_model_cost_sdk.py refactor(model-cost): move the cost map inputs, fetch and register_model overlay into Rust (#50501) 2026-11-10 02:37:35 +00:00
test_ocr_matrix_sdk.py
test_ollama_embedding_wire.py fix(ollama): forward embedding credentials, headers and timeout (#48707) 2026-10-28 09:32:47 -07:00
test_openai_realtime_http_ca_bundle_wire.py feat(realtime)!: support latest OpenAI audio models (#35600) 2026-11-03 07:27:52 +00:00
test_openai_sdk_client_sessions_wire.py
test_owned_redis_ports.py
test_prometheus_copilot_session_auth_failure_sdk.py fix(prometheus): count provider-side 401s in LLM failure and deployment metrics (#46668) 2026-10-26 17:57:06 -07:00
test_provider_budget_redis.py
test_provider_error_and_extra_body_families_wire.py
test_redis_breaker_metrics_multiprocess_sdk.py
test_redis_cluster_iam_auth.py
test_redis_service_metrics.py
test_response_cache_sync_sdk.py
test_responses_bridge_stream_errors_sdk.py
test_responses_bridge_sync_reasoning_sdk.py fix(bedrock)!: keep reasoning, thinking blocks and the json_mode finish_reason on fake streams (#46863) 2026-10-16 17:27:57 +00:00
test_responses_bridge_tool_search_sdk.py
test_router_behavior_wire.py
test_router_budget_limiter_wire.py
test_router_concurrent_deployment_delete_sdk.py test(integration): recognize the model list's lock in the held write helper (#50974) 2026-11-10 10:52:27 -08:00
test_router_cooldown_fallback_sdk.py refactor(router): route the router family through RoutingContext and close the outside surface (#49118) 2026-10-30 19:18:54 -07:00
test_router_include_fallback_errors_wire.py test(router): expect no fallback errors header for non-bool include_fallback_errors (#50259) 2026-11-05 15:34:08 -08:00
test_router_lowest_latency_wire.py
test_router_redis_tls_url.py
test_router_silent_model_shadow_sdk.py fix(logging): mark mirrored silent_model calls with is_silent_experiment in spend logs (#48888) 2026-10-29 05:12:50 -07:00
test_router_sync_stream_fallback_wire.py
test_router_tool_call_stream_fallback_budget_wire.py
test_router_unsupported_params_fallback_wire.py
test_sagemaker_embedding_sdk.py
test_slack_daily_report_redis.py
test_stream_error_api_base_sdk.py fix(streaming): report the deployment's api_base when a stream fails mid-way (#47045) 2026-10-17 15:41:24 +00:00
test_stream_open_error_provider_headers_sdk.py
test_sync_stream_connection_release_wire.py test(streaming): pin that a stream stuck on one chunk closes its provider stream and logs one failure (#38753) 2026-10-26 18:03:37 +00:00
test_text_completion_stream_rebuild_sdk.py fix(streaming): keep finish_reason and provider usage when rebuilding streamed text completions (#44349) 2026-10-20 05:31:39 +00:00
test_tool_loop_responses_history_replay_sdk.py fix(responses): replay the original Responses item order, phase, and boundaries on the next chat turn (#48912) 2026-10-29 00:56:02 -07:00
test_tool_loop_server_tool_replay_sdk.py
test_topaz_image_variation_trailing_slash_sdk.py
test_unset_effort_tool_bridge_wire.py fix(responses): keep unset-effort gpt-5.4/5.5 tool calls on chat completions (#50968) 2026-11-10 18:33:27 +00:00
test_usage_based_routing_sdk_redis_reads.py test(integration): repair tests that merged changes left stale (#50782) 2026-11-10 01:08:35 +00:00
test_usage_routing_counter_ttl.py
test_vertex_batch_row_line_errors_sdk.py
test_vertex_gemini_image_batch_cost_sdk.py
test_vertex_gemini_stream_timeout_wire.py
test_vertex_partner_count_tokens_sdk.py fix(responses)!: count input tokens the way inference sends the request (#47363) 2026-10-20 15:13:59 +00:00