litellm/litellm-rust/.agents/skills/rust-gateway/SKILL.md
yujonglee 40be7fa1a8
feat(gateway): forward HTTP requests to the Python proxy (#49604)
* 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>
2026-11-05 19:03:34 +00:00

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
internal
true

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 a Result when 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's Error
  • testing
    • Build the router through tests/support and drive it with oneshot, assert the fields the surface promises

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