litellm/tests/test_litellm/rust_bridge
Yujong Lee c404bed9f0 feat(rust): add Amazon Textract to litellm.ocr and sign provider requests after host hooks
Add an aws_textract OCR provider on the Rust route, with no Python path. The
detect-document-text model returns plain lines and analyze-document renders
layout and tables as markdown. Both use Textract's synchronous API, so a
multi-page PDF or TIFF is rejected with an error that names the single-page
limit. A call with no region fails instead of falling back to Bedrock's default

SigV4 covers the request body, and host hooks can rewrite that body before it
is sent. litellm-http now has OutboundRequest, which serializes the body once,
shows those bytes to a RequestSigner and is the only thing a route can send.
Chat, audio transcription and OCR build it after their hooks ran, so a callback
that redacts the body still produces a valid Bedrock or Textract signature

ChatCompletionsAuth and AudioTranscriptionAuth are replaced by
litellm_auth::RequestAuth, and one helper in core turns it into a signed or
unsigned request. Audio transcription now signs only the AWS header set and
rejects a forwarded header that SigV4 computes, the same as chat

The OCR catalog routes aws_textract as Rust required, and the dispatch context
reads the provider from the model prefix so a provider scoped rule can match
2026-09-19 09:11:52 -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 fix(ocr): map Rust upstream 401/403 to the public auth exceptions 2026-09-18 21:40:13 +00: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 add streaming message 2026-09-18 15:45:08 -07: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 add streaming message 2026-09-18 15:45:08 -07:00
test_catalog.py feat(rust): add Amazon Textract to litellm.ocr and sign provider requests after host hooks 2026-09-19 09:11:52 -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): route-neutral callback contract 2026-09-18 15:43:08 -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 add streaming message 2026-09-18 15:45:08 -07:00
test_settings.py fix(rust): read OCR secrets from the process environment and decline when a secret manager is readable 2026-09-19 08:32:46 -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