Chat UI is a SvelteKit application that powers HuggingChat and talks to any OpenAI-compatible API for model chat, routing, tools, and optional ML Intern workflows.
Overview
Chat UI provides a web chat interface for large language models. It is the codebase behind HuggingChat on hf.co/chat and discovers models from an OpenAI-compatible /models endpoint using OPENAI_BASE_URL and OPENAI_API_KEY (including Hugging Face Inference Providers, Ollama, llama.cpp servers, and OpenRouter).
Chat history, users, settings, and files use MongoDB; without MONGODB_URL the app embeds a local MongoDB under ./db. Optional Docker image chat-ui-db bundles MongoDB. An Omni virtual model alias can route messages locally to default, multimodal, or agentic routes. MCP servers expose tools via OpenAI function calling. ML Intern is an experimental mode for Hub-oriented ML tasks when enabled.
You configure .env.local, install npm dependencies, and run the dev server; production builds use npm run build and preview. Theming and model metadata overrides use documented PUBLIC_* and MODELS environment variables.
Key features
- OpenAI-compatible API client
- MongoDB or embedded local database
- Optional Docker image with MongoDB
- Omni local LLM routing
- MCP tool calling in chat
- Model discovery from /models
- ML Intern experimental mode
- SvelteKit web frontend
Use cases
- Self-hosted LLM chat frontend
- Private HuggingChat-style deployment
- Multi-model chat with routing
- Teams using MCP tools in chat
- Local dev against Ollama or HF APIs