# Repository Briefing: huggingface/chat-ui
> Source: https://repoforai.com/repo/huggingface/chat-ui (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/huggingface/chat-ui
- **Official Docs / Website**: https://huggingface.co/chat
- **Category**: Chat UI & AI Apps (聊天界面与 AI 应用)
- **Primary Language**: TypeScript
- **License**: Apache-2.0
- **Engineering Health**: A+ (93/100 · Maintenance 35/35 · Adoption 24/25 · Releases 14/20 · License 20/20)
- **Latest Release**: v0.10.0 (2026-05-11) — https://github.com/huggingface/chat-ui/releases
- **Review Snapshot**: 2026-12-01
- **Deployment / Stack Signals**: Docker, Self-Hosted, API
- **Momentum**: 11,070 ★ total (+3 24h / +16 7d) · 1,729 forks
- **Topics**: `chatgpt`, `hacktoberfest`, `huggingface`, `llm`, `svelte`, `svelte-kit`, `sveltekit`, `tailwindcss`, `typescript`
- **When to Use**: Best for: Teams that already have, or plan to operate, an OpenAI-compatible endpoint and want a branded chat workspace with control over application data, optional model routing, and MCP tools. Skip if: You want a fully managed assistant, a single package that also runs the models, or direct integrations with providers that do not expose the compatible API.

## Overview
```text
### Architecture & Core Mechanics
Hugging Face Chat UI is the TypeScript/SvelteKit application behind HuggingChat. It handles the browser-facing conversation experience and server-side orchestration, while a separate OpenAI-compatible backend performs inference. The `openai` dependency matches that API boundary: the application discovers models at `${OPENAI_BASE_URL}/models` and streams responses from the selected model. MongoDB is the application’s persistence layer for chat history, users, settings, files, and statistics.

MCP provides a separate extension path for tools, backed by `@modelcontextprotocol` packages. Chat UI exposes tools to the model through OpenAI-style function calling, calls the relevant MCP server, and feeds the result back to the model. The optional Omni router is local server-side logic rather than another inference service: it selects a route based on request signals and sends the resulting model request through the configured API base URL.

### Key Capabilities & Differentiators
The backend can be a hosted endpoint such as the Hugging Face Inference Providers router, OpenRouter, or Poe, or a separately operated service such as llama.cpp server or Ollama’s OpenAI-compatible endpoint. `MODELS` can override discovered metadata in JSON5 but no longer defines legacy provider integrations or discovers GGUF files. Users can override tool-calling and image-input capability flags per model; those flags do not add missing backend features. v0.10.0 adds per-model reasoning controls, effort settings on capable models, and a bounded viewport for streamed reasoning.

Omni can direct image requests to a multimodal model and requests with MCP enabled to a tool-capable model. Its policy file defines primary and optional fallback models by route; failures can trigger those fallbacks and then a configured global fallback. The UI can display the route and model used. Separately, experimental ML Intern runs machine-learning tasks through Hugging Face Jobs and sandboxes with a per-conversation compute budget.

### Trade-offs & Limitations
Compared with ChatGPT, Chat UI gives operators control over the chat interface, branding, application database, and choice of compatible inference endpoint. In exchange, they must operate the app and database and separately manage local inference capacity or hosted API usage. A shared OpenAI-compatible interface reduces integration work, but compatibility is not all-or-nothing: test model discovery, streaming, image input, and tools against the actual endpoint. Omni can select among models exposed behind one API base URL; it does not independently connect to multiple provider endpoints.

Self-hosting the app is not the same as keeping inference and tools on premises. Prompts or files can reach the configured model provider, tool arguments can reach MCP servers, and optional Hugging Face token forwarding introduces an additional credential boundary. Decide which MCP servers users may add and whether to enable token forwarding before a shared rollout. Apache-2.0 covers the application code, not third-party model licenses or service terms.

### Hardware & Deployment Guide
For local development, install the Node.js dependencies with `npm install`, configure `OPENAI_BASE_URL` and `OPENAI_API_KEY` in `.env.local`, and run `npm run dev` (port 5173 by default). With no `MONGODB_URL`, embedded MongoDB persists to `./db`. The `ghcr.io/huggingface/chat-ui-db` image bundles MongoDB, listens on port 3000, and uses a volume mounted at `/data`. The root `docker-compose.yml` is a development-only MongoDB 8 replica-set service, not a full-stack deployment; the external database guidance names MongoDB 6/7, so validate the database version against the application release you pin.

For a source build, use `npm run build` and select a SvelteKit adapter if the target runtime requires one; `npm run preview` is for checking the build. Node.js and MongoDB need capacity for concurrent streams and stored data, while any GPU requirement belongs to the chosen inference backend. v0.9.6 brought API and data-loading refactors, and v0.10.0 expanded the reasoning UI. Before upgrading, verify that older provider-specific configurations have been migrated to the OpenAI-compatible model discovery path.
```

## Key Capabilities
```text
- Model discovery: Populates the picker from `${OPENAI_BASE_URL}/models` and supports JSON5 metadata overrides through `MODELS`.
- Persistence: MongoDB stores conversations, users, settings, files, and statistics; the local embedded fallback persists to `./db`.
- Routing: The optional Omni alias selects default, multimodal, or agentic routes from request signals and tries configured fallbacks through the same API base URL.
- Tool integration: MCP servers expose tools that the model invokes via OpenAI-style function calling; results return to the conversation.
- Reasoning controls: v0.10.0 adds per-model reasoning toggles, adjustable effort on capable models, and a fixed-height reasoning stream viewport.
- Experimental ML workflow: ML Intern can launch Hugging Face Jobs and sandbox runs with a compute budget set per conversation.
```

## Quick Start / Clone
```bash
git clone https://github.com/huggingface/chat-ui
cd chat-ui
npm install
npm run dev -- --open
```
