Views
No views yet

[!NOTE] Chat UI only supports OpenAI-compatible APIs viaOPENAI_BASE_URLand the/modelsendpoint. Provider-specific integrations (legacyMODELSenv var, GGUF discovery, embeddings, web-search helpers, etc.) are removed, but any service that speaks the OpenAI protocol (llama.cpp server, Ollama, OpenRouter, etc. will work by default).
[!NOTE] The old version is still available on the legacy branch
.env.local:1OPENAI_BASE_URL=https://router.huggingface.co/v1
2OPENAI_API_KEY=hf_************************OPENAI_API_KEY can come from any OpenAI-compatible endpoint you plan to call. Pick the combo that matches your setup and drop the values into .env.local:| Provider | Example OPENAI_BASE_URL | Example key env |
|---|---|---|
| Hugging Face Inference Providers router | https://router.huggingface.co/v1 | OPENAI_API_KEY=hf_xxx (or HF_TOKEN legacy alias) |
llama.cpp server (llama.cpp --server --api) | http://127.0.0.1:8080/v1 | OPENAI_API_KEY=sk-local-demo (any string works; llama.cpp ignores it) |
| Ollama (with OpenAI-compatible bridge) | http://127.0.0.1:11434/v1 | OPENAI_API_KEY=ollama |
| OpenRouter | https://openrouter.ai/api/v1 | OPENAI_API_KEY=sk-or-v1-... |
| Poe | https://api.poe.com/v1 | OPENAI_API_KEY=pk_... |
.env template for the full list of optional variables you can override.1git clone https://github.com/huggingface/chat-ui
2cd chat-ui
3npm install
4npm run dev -- --open[!TIP] For quick local development, you can skip this section. WhenMONGODB_URLis not set, Chat UI falls back to an embedded MongoDB that persists to./db.
0.0.0.0/0 for development) to the network access list.MONGODB_URL in .env.local. Keep the default MONGODB_DB_NAME=chat-ui or change it per environment.docker run -d -p 27017:27017 --name mongo-chatui mongo:latestMONGODB_URL=mongodb://localhost:27017 in .env.local.1npm install
2npm run devhttp://localhost:5173 by default. Use npm run build / npm run preview for production builds.chat-ui-db image bundles MongoDB inside the container:1docker run \
2 -p 3000:3000 \
3 -e OPENAI_BASE_URL=https://router.huggingface.co/v1 \
4 -e OPENAI_API_KEY=hf_*** \
5 -v chat-ui-data:/data \
6 ghcr.io/huggingface/chat-ui-db:latest.env.local can be provided as -e flags.1PUBLIC_APP_NAME=ChatUI
2PUBLIC_APP_ASSETS=chatui
3PUBLIC_APP_DESCRIPTION="Making the community's best AI chat models available to everyone."
4PUBLIC_APP_DATA_SHARING=PUBLIC_APP_NAME The name used as a title throughout the app.PUBLIC_APP_ASSETS Is used to find logos & favicons in static/$PUBLIC_APP_ASSETS, current options are chatui and huggingchat.PUBLIC_APP_DATA_SHARING Can be set to 1 to add a toggle in the user settings that lets your users opt-in to data sharing with models creator.${OPENAI_BASE_URL}/models, and you can optionally override their metadata via the MODELS env var (JSON5). Legacy provider‑specific integrations and GGUF discovery are removed. Authorization uses OPENAI_API_KEY (preferred). HF_TOKEN remains a legacy alias.LLM_ROUTER_ROUTES_PATH. No sample file ships with this branch, so you must point the variable to a JSON array you create yourself (for example, commit one in your project like config/routes.chat.json). Each route entry needs name, description, primary_model, and optional fallback_models.LLM_ROUTER_ARCH_BASE_URL (OpenAI-compatible /chat/completions) and LLM_ROUTER_ARCH_MODEL (e.g. router/omni). The Arch call reuses OPENAI_API_KEY for auth.other to a concrete route via LLM_ROUTER_OTHER_ROUTE (default: casual_conversation). If Arch selection fails, calls fall back to LLM_ROUTER_FALLBACK_MODEL.LLM_ROUTER_ARCH_TIMEOUT_MS (default 10000).PUBLIC_LLM_ROUTER_ALIAS_ID (default omni), PUBLIC_LLM_ROUTER_DISPLAY_NAME (default Omni), and optional PUBLIC_LLM_ROUTER_LOGO_URL.OPENAI_BASE_URL. On errors, it tries route fallbacks.LLM_ROUTER_ENABLE_MULTIMODAL=true and the user sends an image, the router bypasses Arch and uses the model specified in LLM_ROUTER_MULTIMODAL_MODEL. Route name: multimodal.LLM_ROUTER_ENABLE_TOOLS=true and the user has at least one MCP server enabled, the router bypasses Arch and uses LLM_ROUTER_TOOLS_MODEL. If that model is missing or misconfigured, it falls back to Arch routing. Route name: agentic.1# JSON array of servers: name, url, optional headers
2MCP_SERVERS=[
3 {"name": "Web Search (Exa)", "url": "https://mcp.exa.ai/mcp"},
4 {"name": "Hugging Face MCP Login", "url": "https://hf.co/mcp?login"}
5]
6
7# Forward the signed-in user's Hugging Face token to the official HF MCP login endpoint
8# when no Authorization header is set on that server entry.
9MCP_FORWARD_HF_USER_TOKEN=trueLLM_ROUTER_ENABLE_TOOLS=true and choose a tools‑capable target with LLM_ROUTER_TOOLS_MODEL=<model id or name>.+ menu in the chat input to add servers, toggle them on, and run Health Check. The server card lists available tools.npm run buildnpm run preview.To deploy your app, you may need to install an adapter for your target environment.