Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(rust_bridge): keep the Messages route on Python until the Rust path is ready (#42517)

devin-ai-integration[bot]85ed18e8f2e5
diff --git a/litellm/rust_bridge/catalog.py b/litellm/rust_bridge/catalog.py
index d7479631e04..d6cbe17d790 100644
--- a/litellm/rust_bridge/catalog.py
+++ b/litellm/rust_bridge/catalog.py
@@ -93,9 +93,9 @@ Rules: TypeAlias = tuple[Rule, ...]
RULES: Final[Rules] = (
RouteRule(Route.OCR, Rollout.RUST_REQUIRED, providers=frozenset({"aws_textract"})),
RouteRule(Route.OCR, Rollout.RUST_OPT_OUT),
- RouteRule(Route.MESSAGES, Rollout.RUST_OPT_IN),
- RouteRule(Route.TOKEN_COUNTER, Rollout.RUST_OPT_IN),
- RouteRule(Route.TOKENIZER, Rollout.RUST_OPT_IN),
+ RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY),
+ RouteRule(Route.TOKEN_COUNTER, Rollout.PYTHON_ONLY),
+ RouteRule(Route.TOKENIZER, Rollout.PYTHON_ONLY),
RouteRule(Route.TRANSCRIPTION, Rollout.RUST_REQUIRED, providers=frozenset({"bedrock"})),
CacheRule(Rollout.PYTHON_ONLY, backends=frozenset({LiteLLMCacheType.LOCAL})),
CacheRule(Rollout.PYTHON_ONLY, backends=frozenset({LiteLLMCacheType.REDIS})),
diff --git a/tests/test_litellm/rust_bridge/test_catalog.py b/tests/test_litellm/rust_bridge/test_catalog.py
index 82e3766e8a2..b6b486e73f0 100644
--- a/tests/test_litellm/rust_bridge/test_catalog.py
+++ b/tests/test_litellm/rust_bridge/test_catalog.py
@@ -53,10 +53,6 @@ def test_shipped_decisions(
enabled: Final = environment == "1" if environment is not None else process is not False
assert catalog.rollout(context) is Rollout.RUST_OPT_OUT
assert catalog.decision(context) is (Decision.RUST_WITH_FALLBACK if enabled else Decision.PYTHON)
- elif route in (Route.MESSAGES, Route.TOKEN_COUNTER, Route.TOKENIZER):
- enabled: Final = environment == "1" if environment is not None else process is True
- assert catalog.rollout(context) is Rollout.RUST_OPT_IN
- assert catalog.decision(context) is (Decision.RUST_WITH_FALLBACK if enabled else Decision.PYTHON)
elif route is Route.TRANSCRIPTION and provider == "bedrock":
assert catalog.rollout(context) is Rollout.RUST_REQUIRED
assert catalog.decision(context) is Decision.RUST_REQUIRED