Context
Part of #5016 (RFC: stacklok/toolhive-rfcs#70). Depends on #5028 (token lifecycle). Can be implemented in parallel with #5028 once #5027 is done.
Scope
- Localhost reverse proxy listening on
http://localhost:<port>/v1
- Strips incoming
Authorization header and injects a fresh OIDC bearer token from the token source
- Forwards requests to upstream gateway preserving original path, query string, headers, and body
- Passes through upstream responses faithfully: SSE streaming (chat completions), non-streaming JSON (embeddings, completions), error responses (4xx/5xx) — no buffering or body modification
- Loopback-only guard: reject startup if listen address is not a loopback interface
- Background process lifecycle management (start, stop, PID tracking)
thv llm proxy start — foreground variant with full log output for debugging
Acceptance Criteria
Dependencies
References
Context
Part of #5016 (RFC: stacklok/toolhive-rfcs#70). Depends on #5028 (token lifecycle). Can be implemented in parallel with #5028 once #5027 is done.
Scope
http://localhost:<port>/v1Authorizationheader and injects a fresh OIDC bearer token from the token sourcethv llm proxy start— foreground variant with full log output for debuggingAcceptance Criteria
http://localhost:<port>/v1, stripsAuthorization, injects fresh OIDC bearer token, forwards to upstream gateway — preserving path, query string, headers, and bodyDependencies
References