Architecture
Rust proxy architecture
The backend is a modular monolith: small Rust modules with explicit service boundaries and a single binary.
Request path
- gateway parses the incoming path and chooses OpenAI-compatible or Anthropic upstreams.
- context derives model, prompt, preview, and input hashes from provider payloads.
- trace ingestion queues persistence work so the proxy hot path does not block on SQLite.
- cache stores and replays identical request bodies for local iteration.
Trace services
| Module | Responsibility |
|---|---|
| capture | Build TraceCapture from request metadata and body previews. |
| summarize | Extract response text, token counts, language, and tool ids. |
| store | Convert captures and outcomes into trace_calls rows. |
| query | Read trace snapshots and session lists for the UI API. |
| replay | Replay selected nodes and invalidate downstream branches. |