litellm/litellm-rust
Vineet Puranik 067c9bbc96
chore(rust): migrate the litellm-rust workspace (core, ai-gateway, python-bridge) from Rust edition 2021 to edition 2024 (#33940)
* chore(deps): update cargo.lock file after cargo update

* chore(rust): migrate workspace crates to edition 2024

* chore(rust): migrate workspace crates to edition 2024 + fix clippy warnings after 2024 update

* chore(rust): add rust version to cargo workspace file

* chore(rust): fix clippy collapsible if warning
2026-07-20 08:52:06 -07:00
..
crates chore(rust): migrate the litellm-rust workspace (core, ai-gateway, python-bridge) from Rust edition 2021 to edition 2024 (#33940) 2026-07-20 08:52:06 -07:00
.gitignore feat: add LiteLLM Rust workspace with Mistral OCR bridge (#31033) 2026-06-23 13:16:47 -07:00
ADDING_A_PROVIDER.md docs(rust): add provider abstraction standards (#33865) 2026-07-18 15:31:00 -07:00
AGENTS.md docs(litellm-rust): require the official Rust Style Guide in agent rules (#33867) 2026-07-18 22:25:11 +00:00
Cargo.lock chore(rust): migrate the litellm-rust workspace (core, ai-gateway, python-bridge) from Rust edition 2021 to edition 2024 (#33940) 2026-07-20 08:52:06 -07:00
Cargo.toml chore(rust): migrate the litellm-rust workspace (core, ai-gateway, python-bridge) from Rust edition 2021 to edition 2024 (#33940) 2026-07-20 08:52:06 -07:00
CLAUDE.md feat(rust): 1:1 port of OpenAI Responses API WebSockets to litellm-rust (#33849) 2026-07-19 01:55:35 +00:00
README.md refactor(litellm-rust): dissolve providers into core + ai-gateway (strict 3-crate layers) (#31218) 2026-06-24 12:22:43 -07:00

LiteLLM Rust

This workspace contains the staged Rust implementation for LiteLLM.

Rust starts as a pure transform core used by the existing Python host. Python continues to own auth, configuration, network I/O, retries, routing, logging, callbacks, spend tracking, and customer plugins until each Rust path has parity coverage and production evidence.

Crates

Crate Role Pure / I/O
litellm-core Translation layer — types, route contracts (traits), provider transforms (modules under providers/), and the router. Builds requests/responses; no network. Pure
litellm-ai-gateway Routes + host — the only crate that touches the network. HTTP/WebSocket I/O (modules under io/) plus the axum server binary (behind the server feature). I/O
litellm-python-bridge PyO3 cdylib exposing Rust to the litellm Python SDK — a thin adapter over litellm-ai-gateway's I/O. Binding

Dependency direction (acyclic): litellm-core ← litellm-ai-gateway ← litellm-python-bridge.

Layout

crates/
  core/           Route contracts, shared pure types, errors, and templates.
    src/ocr/
  providers/      Provider-specific pure transforms.
    src/mistral/ocr/transformation.rs
  python-bridge/  PyO3 bridge for Python LiteLLM.

The folder shape should follow the Python provider tree: providers/src/<provider>/<route>/transformation.rs. The bridge should expose one function per top-level route, starting with ocr(payload).

Checks

Run these before pushing Rust changes. GitHub Actions runs the same checks for changes under litellm-rust/.

cargo fmt --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace