litellm/litellm-rust/crates/python-bridge/src
Yujong Lee 9bc6426ae1 refactor(python-bridge): bind OCR arguments once in Rust
The request crossed the boundary four times: Python bind_request into a
dataclass, Rust re-reading each field back with its own precedence rules,
a BridgeOcrRequest copy, then the core request. The dataclass was retained
for the whole call only so map_failure could read model and kwargs at the
end.

Add a route-agnostic Signature binder that reproduces Python's positional
and keyword binding rules and TypeError messages, and project straight
from the bound arguments into the core request. This removes the Python
LiteLLMOcrRequest dataclass, bind_request, PythonOcrInput, BridgeOcrRequest,
and the retained boundary_request, document, api_key and callback_inputs
Python objects. api_key for pre_call now comes from core's resolved
connection, matching the legacy handler, and core no longer carries
retained_fields or retains_document since the bridge stopped re-aliasing.
2026-09-16 17:50:11 +00:00
..
lifecycle refactor(python-bridge): bind OCR arguments once in Rust 2026-09-16 17:50:11 +00:00
routes refactor(python-bridge): bind OCR arguments once in Rust 2026-09-16 17:50:11 +00:00
auth.rs wip 2026-09-16 17:50:10 +00:00
constants.rs feat(rust_bridge): count budget-check input tokens in Rust on all LLM routes (#40381) 2026-09-10 13:56:30 -07:00
diagnostics.rs refactor(python-bridge): split routes and add shared function tracing (#39031) 2026-09-02 16:26:35 -07:00
errors.rs refactor(rust): localize route errors 2026-09-16 17:50:10 +00:00
execution.rs refactor(rust): localize route errors 2026-09-16 17:50:10 +00:00
lib.rs cleanup dead code 2026-09-16 17:50:11 +00:00
marshal.rs wip 2026-09-16 17:50:11 +00:00
token_counter.rs feat(rust): count tiktoken cl100k_base admission tokens in Rust (#40777) 2026-09-11 23:47:05 +00:00