Add LiteLLM Rust workspace with Mistral OCR bridge - #31014
Closed
ishaan-berri wants to merge 1 commit into
Closed
Conversation
Contributor
|
Too many files changed for review. ( |
Contributor
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ishaan-berri
force-pushed
the
codex/litellm-rust-mistral-ocr
branch
2 times, most recently
from
June 22, 2026 22:50
18e1b86 to
c64c8ab
Compare
ishaan-berri
force-pushed
the
codex/litellm-rust-mistral-ocr
branch
4 times, most recently
from
June 22, 2026 23:08
dead94b to
59e7308
Compare
| if _RUST_MODULE_LOAD_ATTEMPTED: | ||
| return _RUST_MODULE | ||
|
|
||
| _RUST_MODULE_LOAD_ATTEMPTED = True |
ishaan-berri
force-pushed
the
codex/litellm-rust-mistral-ocr
branch
from
June 22, 2026 23:26
59e7308 to
ce27d80
Compare
Contributor
Author
Contributor
Author
|
Closing this fork-sourced PR in favor of #31032, which comes from BerriAI/litellm. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
litellm-rust/workspace with only the crates needed for the first bridge:core,providers, andpython-bridge.core/src/ocr/owns OCR shared types and theOcrProviderConfigtemplate trait.providers/src/mistral/ocr/transformation.rsmirrorslitellm/llms/mistral/ocr/transformation.py.providers/src/ocr.rsowns Rust-side OCR provider/operation dispatch.ocr(payload), and delegates OCR routing to Rust.litellm/rust_bridge/as the Python-side bridge package with an explicit OCR provider rollout enum and Python fallback behavior.litellm/ocr/main.pysmall: after normal provider resolution, it askslitellm.rust_bridge.ocrfor a Rust-backed config; disabled, unavailable, or unsupported Rust paths return the existing Python config unchanged.cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings, andcargo test --workspaceon Rust changes.Verification
uv run black litellm/rust_bridge litellm/ocr/main.py tests/test_litellm/llms/mistral/ocr/test_mistral_ocr_rust_bridge.pyuv run ruff check litellm/rust_bridge litellm/ocr/main.py tests/test_litellm/llms/mistral/ocr/test_mistral_ocr_rust_bridge.pyuv run pytest tests/test_litellm/llms/mistral/ocr/test_mistral_ocr_transformation.py tests/test_litellm/llms/mistral/ocr/test_mistral_ocr_rust_bridge.py -qcd litellm-rust && cargo fmt --checkcd litellm-rust && cargo clippy --workspace --all-targets -- -D warningscd litellm-rust && cargo test --workspaceScope
This PR keeps the rollout narrow: Mistral OCR only, route-level Python hook, Python fallback for every disabled/unavailable Rust path. Future OCR providers should add
providers/src/<provider>/ocr/transformation.rsand register the provider in the Rust OCR dispatcher plus the Python rollout enum.