ruflo/src/ruvocal/docs/source/developing/architecture.md
This document provides a high-level overview of the Chat UI codebase. If you're looking to contribute or understand how the codebase works, this is the place for you!
Chat UI provides a simple interface connecting LLMs to external tools via MCP. The project uses MongoDB and SvelteKit with Tailwind.
Key architectural decisions:
/models endpointroutesAll routes rendered with SSR via SvelteKit. The majority of backend and frontend logic lives here, with shared modules in lib (client) and lib/server (server).
textGenerationProvides a standard interface for chat features including model output, tool calls, and streaming. Outputs MessageUpdates for fine-grained status updates (new tokens, tool results, etc.).
endpointsProvides the streaming interface for OpenAI-compatible endpoints. Models are fetched and cached from ${OPENAI_BASE_URL}/models.
mcpImplements MCP client functionality for tool discovery and execution. See MCP Tools for configuration.
llmRouterIntelligent routing logic that selects the best model for each request. Uses the Arch router model for classification. See LLM Router for details.
migrationsMongoDB migrations for maintaining backwards compatibility across schema changes. Any schema changes must include a migration.
npm install
npm run dev
The dev server runs at http://localhost:5173 with hot reloading.