litellm/tests/test_litellm/rust_bridge
Yujong Lee 63d994ade4 refactor(rust): run OCR through a route-neutral callback contract and a legacy Logging adapter
Extracted from #41733 without the router loop, the cache machine layer, streaming, or the
error, timeout and route-pruning work that moved to #41745

litellm-callbacks holds the contract a native call and its host share: Machine, HostOp,
CallEvent, the in-process run loop, and Passthrough, which is built only by comparing the
caller's inputs with the body the route sends, so a route can never mark a key it rewrote.
litellm-host-python (formerly python-interop) owns the CPython driver and the Execution
handle, and litellm-callbacks-legacy is the @client wrapper as the native call sees it:
function_setup, the deployment hooks, pre_call and post_call, the success and failure fan-out
and the deferred proxy release. OCR is the one route on it, and the old core and bridge
lifecycles are gone

The passthrough rule is the structural fix for the bug #41719 patched in core and #41716
reworks: an inlined remote document no longer counts as the caller's value, so the legacy
adapter never hands the caller's URL back into the body. core/tests/ocr/passthrough.rs pins
it for every route and document source, including that unchanged values stay passthrough,
and callbacks-legacy/tests/payload.rs pins the adapter side with a real pre_call callback

Python OCR integration tests that only exercised core behavior now live as Rust tests, so
tests/test_litellm_rust keeps the cases that need the full Python stack
2026-09-17 21:13:16 -07:00
..
chat_completions refactor(rust): run OCR through a route-neutral callback contract and a legacy Logging adapter 2026-09-17 21:13:16 -07:00
messages refactor(rust): run OCR through a route-neutral callback contract and a legacy Logging adapter 2026-09-17 21:13:16 -07:00
ocr refactor(rust): run OCR through a route-neutral callback contract and a legacy Logging adapter 2026-09-17 21:13:16 -07:00
responses refactor(rust): run OCR through a route-neutral callback contract and a legacy Logging adapter 2026-09-17 21:13:16 -07:00
__init__.py refactor(rust_bridge): group route modules into packages and split ocr into main and rust 2026-09-16 20:34:51 +00:00
native_route_wheel_test.py fix(rust_bridge): qualify runtime calls in dispatch and drop OCR transport rows from wheel matrix 2026-09-16 23:16:31 +00:00
stubtest.ini build(rust-bridge): add typed _native stub and validate it with mypy.stubtest 2026-09-15 03:54:16 +00:00
test_bindings.py test(rust_bridge): cover binding validation, async upstream errors, and OCR preparation failures 2026-09-16 23:04:38 +00:00
test_catalog.py cleanup 2026-09-16 14:38:59 -07:00
test_configuration.py fix(rust_bridge): let LITELLM_RUST win over litellm.rust() for optional tiers 2026-09-16 19:45:11 +00:00
test_dispatch.py test(rust_bridge): cover binding validation, async upstream errors, and OCR preparation failures 2026-09-16 23:04:38 +00:00
test_failures.py refactor(rust_bridge): give chat completions, messages and responses the ocr dispatch shape 2026-09-16 15:02:12 -07:00
test_legacy_callbacks.py refactor(rust): run OCR through a route-neutral callback contract and a legacy Logging adapter 2026-09-17 21:13:16 -07:00
test_lifecycle.py refactor(rust): run OCR through a route-neutral callback contract and a legacy Logging adapter 2026-09-17 21:13:16 -07:00
test_runtime.py bring x-litellm-rust 2026-09-16 17:28:36 -07:00
test_token_counter.py feat(rust): count tiktoken cl100k_base admission tokens in Rust (#40777) 2026-09-11 23:47:05 +00:00
test_verify_linux_native_wheel.py test(build): keep wheel checks outside package 2026-09-02 12:16:25 -07:00