Internal Architecture
A maintainers-first summary of core boundaries and runtime data flow.
Core Boundaries
cmd/: process bootstrap and CLI entry.pkg/llmproxy/api: HTTP routing and middleware surfaces.pkg/llmproxy/runtimeand executors: provider translation + request execution.pkg/llmproxy/auth: credential loading, OAuth flows, refresh behavior.- Management/ops handlers: runtime control, introspection, and diagnostics.
Request Lifecycle (High Level)
- Request enters
/v1/*route. - Access middleware validates API key.
- Model/endpoint compatibility is resolved.
- Executor constructs provider-specific request.
- Response is normalized and returned.
- Metrics/logging capture operational signals.
Stability Contracts
/v1/chat/completionsand/v1/modelsare external compatibility anchors.- Management APIs should remain explicit about auth and remote-access rules.
- Routing changes must preserve predictable prefix/alias behavior.
Typical Change Risk Areas
- Model mapping and alias conflicts.
- OAuth token refresh edge cases.
- Streaming response compatibility.
- Backward compatibility for management endpoints.
Internal Validation Suggestions
bash
# quick smoke requests
curl -sS http://localhost:8317/health
curl -sS http://localhost:8317/v1/models -H "Authorization: Bearer <key>"
# docs validation from docs/
npm run docs:build