litellm/litellm-rust/crates/python-bridge
yassin 5605b6d0eb refactor(rust): rescope /v1/messages admission to a Python-called Rust token counter
Drop the gateway-side admission layer (identity cache, /key/info lookups,
process-local budget/TPM/RPM limits) and keep only the CPU work in Rust: a
typed litellm-core token counter that parses the raw body once and counts
input tokens with the GIL released, exposed as TokenCounter in the PyO3
bridge. The Python proxy's existing auth dependency passes the raw body
into budget reservation, which uses the Rust count for models on the
Anthropic tokenizer and falls back to Python for anything Rust declines,
when the bridge is disabled, or when the native module is unavailable.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-09 19:19:54 +00:00
..
benches refactor(rust): extract domain-neutral Python interop 2026-09-02 12:16:26 -07:00
src refactor(rust): rescope /v1/messages admission to a Python-called Rust token counter 2026-09-09 19:19:54 +00:00
tests refactor(rust): extract domain-neutral Python interop 2026-09-02 12:16:26 -07:00
AGENTS.md refactor(rust): extract domain-neutral Python interop 2026-09-02 12:16:26 -07:00
build.rs feat: package Rust OCR bridge in LiteLLM wheel (#31267) 2026-06-25 12:32:55 -07:00
Cargo.toml refactor(tests): restructure rust python harness around strategy definitions (#39628) 2026-09-03 21:15:01 -07:00
CLAUDE.md refactor(rust): extract domain-neutral Python interop 2026-09-02 12:16:26 -07:00