How kapo-solothurn-ai-poc/librechat works
Project type and purpose
• LibreChat is a full-stack, open-source AI chat platform built as a monorepo.
• It includes a React/Vite single-page application (client/) and a Node.js/Express API server (api/) plus auxiliary packages (packages/data-provider, packages/mcp).
• Purpose: provide ChatGPT-style UI, multi-model AI integration, agents/tools, code execution, file handling, and multi-user, token-based access.
File structure
Top-level directories
• client/ — React-based SPA: UI components, contexts, hooks, data-provider queries/mutations, styling, routes, tests.
• api/ — Backend monolith:
– app/clients: adapters for OpenAI, Anthropic, Google, Ollama, plugins, streaming, agents & tools.
– cache/: Redis/Mongo caches & keyv wrappers.
– config/: app-wide configuration (paths, parsers, logging).
– lib/db: MongoDB connection.
– models/: Mongoose schemas and business logic (User, Conversation, Token, ToolCall, etc).
– server/: Express controllers, routes, middleware, services (AuthService, AgentService, RunManager, FileService, TokenService...).
– utils/: helpers, email templates, queue, streaming, importer.
• packages/ — shared libraries:
– data-provider: client data access layer (generic SDK for GraphQL/REST).
– mcp: Model Context Protocol tools.
• charts/, .devcontainer/, Dockerfile(s), helm charts: Docker/Kubernetes deployment.
• e2e/, test/, jest.config: end-to-end and unit test frameworks.
• config/: CLI scripts for admin tasks (user creation, balance, banner).
• utils/docker/, deploy-compose.yml: DevOps scripts.
README for additional insights
• Stack: React + Vite + Tailwind (client), Node.js + Express + Mongoose + Redis + Meilisearch (api), Docker, Helm, Kubernetes.
• Features: AI endpoint abstraction, agent/tool plugin system, code interpreter sandbox, file uploads, SSE streaming.
• External integrations: OAuth2 (GitHub, Google, Apple, LDAP), AI providers (OpenAI, Anthropic, AWS Bedrock, Google Vertex AI, custom endpoints).
• Multi-tenant, token-based moderation, search, internationalization.
Essential details
• Major folder as a component (client/src/providers, api/app/clients, api/server/services, api/models).
• Don’t omit the shared packages (data-provider SDK, mcp)—they form part of the extensibility architecture.
• Deployment targets: Docker containers, Kubernetes pods via Helm.
• CI/CD pipelines (.github/workflows) externally if needed for a deployment view.