mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
* feat(gateway): forward HTTP requests to the Python proxy Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(gateway): preserve required forwarding headers and separate upgrades * test(gateway): clarify hash compatibility and relocate forwarding docs * test(gateway): define URL fragment forwarding behavior --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1.8 KiB
1.8 KiB
| name | description | metadata | ||
|---|---|---|---|---|
| rust-gateway | Add or change an HTTP route, extractor, response envelope, stream or router mount in the litellm-rust gateway crates (crates/gateway and crates/gateway-*). Use when adding an endpoint, parsing a request body, choosing an error envelope for an API surface, relaying SSE, or writing a router-level test |
|
Rust gateway
crates/gateway mounts endpoint routers and serves the listener. crates/gateway-inference, gateway-mcp and gateway-ui own their endpoints, gateway-auth is the inbound authentication middleware and gateway-management holds management logic that has no router yet. gateway-forward is the reverse proxy that relays every request to the Python proxy and has no routes of its own. A crate's AGENTS.md, where it has one, says what belongs in it. Read the reference for the part you are touching
- surfaces
- Each API surface mirrors the envelope the Python proxy returns there, so the shapes differ on purpose
- The error type string is derived from the status and provider bodies pass through bounded
- requests
- Extractors reject with the crate's
Error, handlers take the body as aResultwhen the error needs the request id - Every alias of a path is registered together, a known but unserved path goes to one handler
- Streams relay through
litellm_host_http::Sse, with the error frame rendered by the crate'sError
- Extractors reject with the crate's
- testing
- Build the router through
tests/supportand drive it withoneshot, assert the fields the surface promises
- Build the router through
How an error is classified before it reaches a response is the rust-error skill, in particular its gateway page. Axum's own conventions are in its docs