DEV.co
AI Frameworks · huggingface

chat-ui

Chat UI is an open-source TypeScript/SvelteKit application that provides a web interface for interacting with LLMs via OpenAI-compatible APIs. It powers HuggingChat and supports multiple backend providers including Ollama, llama.cpp, and OpenRouter without requiring provider-specific code.

Source: GitHub — github.com/huggingface/chat-ui
10.8k
GitHub stars
1.7k
Forks
TypeScript
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryhuggingface/chat-ui
Ownerhuggingface
Primary languageTypeScript
LicenseApache-2.0 — OSI-approved
Stars10.8k
Forks1.7k
Open issues251
Latest releasev0.10.0 (2026-05-11)
Last updated2026-07-05
Sourcehttps://github.com/huggingface/chat-ui

What chat-ui is

A SvelteKit-based frontend built in TypeScript with Tailwind CSS that communicates exclusively through OpenAI-compatible REST endpoints. Features MongoDB for chat history and user state, supports optional Model Context Protocol (MCP) servers for tool calling, and includes a local heuristic router for request-based model selection without a separate routing service.

Quickstart

Get the chat-ui source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/huggingface/chat-ui.gitcd chat-ui# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Self-hosted LLM Interface

Deploy locally alongside llama.cpp, Ollama, or other OpenAI-compatible servers to provide a polished web UI for private inference without cloud dependencies.

Multi-model Aggregation UI

Route requests across multiple API providers (OpenRouter, Poe, HF Inference) using a single unified chat interface with per-request model selection and fallback logic.

Tool-enabled Chatbot with MCP Integration

Build autonomous agents that invoke external tools (web search, knowledge bases) via preconfigured or user-added MCP servers, with results fed back to the LLM for function calling.

Implementation considerations

  • MongoDB (6.0+) must be provisioned externally or embedded; for production, use MongoDB Atlas or a managed instance to avoid laptop-based deployments.
  • OpenAI-compatible endpoint must be available and stable; test fallback model configuration for resilience before exposing to end users.
  • MCP server integration requires explicit allowlisting via JSON config and optional HF token forwarding; validate security model for untrusted or user-supplied servers.
  • Router policy file (LLM_ROUTER_ROUTES_PATH) is mandatory for Omni/smart routing; omitting it disables request-based routing entirely.
  • Environment variables control theming, model discovery, and routing; no in-app admin panel for runtime configuration changes—redeploy or orchestrate via container restarts.

When to avoid it — and what to weigh

  • Non-OpenAI-compatible Backends — The codebase removed provider-specific integrations (legacy MODELS env, GGUF discovery). If your LLM backend does not speak OpenAI protocol, significant refactoring is required.
  • Simple Chatbot with Zero Infrastructure — Requires MongoDB setup (local or managed), Node.js runtime, and environment configuration. Not suitable for minimal deployments or fully managed SaaS alternatives.
  • Proprietary/Closed-source Modifications — Apache 2.0 license requires source disclosure and patent indemnification clauses; if you need to hide modifications or restrict derivative use, this is not a fit.
  • Non-English or Highly Customized UX — Internationalization support and custom branding are configurable but require understanding of SvelteKit templates and static asset management; significant UX divergence is non-trivial.

License & commercial use

Apache License 2.0 (OSI-approved permissive open-source license). Permits commercial use, modification, and redistribution under these conditions: retain attribution, disclose source changes, include original license text, and grant patent indemnification to users.

Commercial use is permitted under Apache 2.0. You may build and sell products using Chat UI provided you include the Apache 2.0 license, acknowledge the original work, and disclose any modifications. No warranty or liability assumption is provided. Clarify your exact derivative use case to ensure compliance.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

OpenAI-compatible API keys stored in environment variables; protect .env.local and use secrets management in production. MongoDB connection string requires network isolation or Atlas firewall rules. MCP servers can execute arbitrary operations; only allowlist trusted servers and validate server responses. Frontend is SvelteKit SPA; no CSRF/CORS tokens mentioned—verify CORS policy for cross-origin API calls. Chat history persists unencrypted in MongoDB by default—assess data sensitivity and consider encryption at rest. No authentication/authorization built-in; users are identified by session/cookie; no role-based access control documented.

Alternatives to consider

Open WebUI

Broader backend support (Ollama-native, GGUF discovery, multiple providers), in-app admin panel, built-in authentication. Heavier (Python/Docker-first), less TypeScript/frontend-focused. Trade-off: more features vs. lighter codebase.

Promptly (by Langchain)

Framework-agnostic, integrates LangChain chains, supports multiple LLM backends, includes prompt versioning. Requires more setup and coding. Trade-off: maximum flexibility vs. ready-to-deploy simplicity.

SillyTavern

Focus on roleplay/character-driven chat, rich UI customization, local-first (browser storage), no backend required. Lacks professional UX, MongoDB, tool integration. Trade-off: niche use case vs. enterprise readiness.

Software development agency

Build on chat-ui with DEV.co software developers

Get started in minutes with Chat UI. Clone the repo, configure your OpenAI-compatible endpoint, and launch a production-grade chat application with MongoDB persistence and MCP tool support.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

chat-ui FAQ

Can I use Chat UI without MongoDB?
For development, yes—Chat UI falls back to an embedded MongoDB that persists to ./db. For production, you must configure an external MongoDB 6.0+ instance via MONGODB_URL.
Which LLM providers are supported?
Any service compatible with OpenAI API (base URL + /models endpoint). Directly tested: Hugging Face Inference Providers, Ollama, llama.cpp, OpenRouter, Poe. Provider-specific integrations were removed; only OpenAI-compatible endpoints are supported.
How do I add custom tools or integrations?
Use Model Context Protocol (MCP) servers. Preconfigure via MCP_SERVERS env var (JSON array) or let users add via UI. Each server exposes tools that Chat UI surfaces; results are fed back to LLM for function calling.
Is Chat UI production-ready?
It powers HuggingChat on hf.co/chat, so the codebase is production-tested by Hugging Face. However, deployment security (secrets, MongoDB access, MCP server validation) is your responsibility. Review and harden environment, access controls, and data sensitivity before exposing to end users.

Software developers & web developers for hire

DEV.co helps companies turn open-source tools like chat-ui into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your ai frameworks stack.

Deploy Your LLM Chat Interface

Get started in minutes with Chat UI. Clone the repo, configure your OpenAI-compatible endpoint, and launch a production-grade chat application with MongoDB persistence and MCP tool support.