litellm/tests/unit/rust_bridge/host
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
..
routes fix(anthropic-messages): apply additional_drop_params before the unsupported param checks (#50753) 2026-11-10 01:35:35 +00:00
__init__.py refactor(rust_bridge): route Python state reads through host modules (#45689) 2026-10-11 14:10:16 -07:00
test_cache.py fix(messages): write the native unary cache entry after the router stamps it like python (#50426) 2026-11-10 00:24:21 +00:00
test_callbacks_legacy_python.py fix(messages): bill a native stream the client abandoned like python (#50425) 2026-11-10 00:24:21 +00:00
test_model_capabilities.py perf(router): skip unused deployment reads in the callback filter step and cache anthropic capability probes (#50641) 2026-11-08 17:59:55 -08:00
test_model_cost.py refactor(rust_bridge): route every Rust-to-Python call through host modules (#50822) 2026-11-11 01:57:54 +00:00
test_preflight.py refactor(rust_bridge): route every Rust-to-Python call through host modules (#50822) 2026-11-11 01:57:54 +00:00
test_redis_credentials.py feat(redis): extend the native Redis foundation for the store families (#50169) 2026-11-06 12:30:07 +09:00
test_redis_events.py feat(redis): serve the proxy's common Redis call with Rust stores (#50170) 2026-11-06 06:01:11 +00:00
test_secret_manager.py refactor(rust_bridge): route every Rust-to-Python call through host modules (#50822) 2026-11-11 01:57:54 +00:00
test_settings.py feat(redis): serve the proxy's common Redis call with Rust stores (#50170) 2026-11-06 06:01:11 +00:00