Overview
A responsive web client for LLM servers. PHP owns sign-in, sessions and all metadata, while a private FastAPI service owns every model call, SSE stream, tool loop and usage record. Conversations sync live across devices, and history is fitted to each model’s context window without deleting anything from the transcript.
Highlights
- The web server is the only public entry point; the model service listens on loopback behind it
- Identity crosses from PHP to Python only in short-lived signed tokens, with ownership re-checked on every object
- Provider keys held as libsodium secretbox ciphertext; one live run per conversation under a row lock, with stale runs reaped
- Context fitting elides old tool results first (about 79% of replayed history), then older messages
- Per-model reasoning effort from the live catalog, rate-limit budgets surfaced as run events, and remote MCP tool servers

