Repolode
huggingface

huggingface/chat-ui

A SvelteKit chat interface for LLMs that connects to any OpenAI-compatible API, and the codebase behind HuggingChat.

Open-source alternative to:ChatGPT

Stars
10,990
Forks
1,721
Open issues
316
Last commit
8 hours ago

What is it?

Chat UI is a web chat interface for large language models, built with SvelteKit and TypeScript. It is the codebase that powers the HuggingChat app on hf.co/chat, and it can be run locally or self-hosted for your own models.

The app talks only to OpenAI-compatible APIs. Set OPENAI_BASE_URL and OPENAI_API_KEY to point it at the Hugging Face Inference Providers router, a local llama.cpp or Ollama server, OpenRouter, or similar services. Available models are discovered from the endpoint's /models route. Chat history, users, settings and files are stored in MongoDB, which can be a managed Atlas cluster, a local container, or an embedded instance used when no connection string is set.

Optional features include MCP tool calling through configured Model Context Protocol servers, a server-side router that picks a model per message (for example, routing image inputs to a multimodal model), theming through PUBLIC_APP_* variables, and an experimental ML Intern mode for running machine-learning tasks on the Hugging Face Hub.

Key features

  • 01Connects to any OpenAI-compatible API via OPENAI_BASE_URL.
  • 02Discovers models from the endpoint's /models route.
  • 03Stores chat history and settings in MongoDB, with an embedded fallback for local development.
  • 04Supports MCP servers for tool calling with OpenAI function calling.
  • 05Includes an optional Omni router that picks a model per message.
  • 06Customizable app name, assets and description through environment variables.

Use cases

  • Running a ChatGPT-style interface in front of a self-hosted llama.cpp or Ollama server.
  • Building an internal chat front end for a team that uses an OpenAI-compatible gateway.
  • Starting point for a custom SvelteKit chat app with MongoDB-backed history.
  • Testing MCP tools with different models in a single chat interface.

Quick start

  1. 1

    Clone the repository

    git clone https://github.com/huggingface/chat-ui
  2. 2

    Enter the project folder

    cd chat-ui
  3. 3

    Install dependencies

    npm install
  4. 4

    Start the dev server and open the browser (after creating .env.local with OPENAI_BASE_URL and OPENAI_API_KEY)

    npm run dev -- --open

Things to know

  • Only works with OpenAI-compatible APIs; provider-specific integrations were removed.
  • Requires an API endpoint and key, such as a Hugging Face token or a local llama.cpp or Ollama server.
  • Chat history and settings need MongoDB, though a fallback embedded database is used when no URL is set.

Topics

FAQ

What is chat-ui?
A SvelteKit chat interface for LLMs that connects to any OpenAI-compatible API, and the codebase behind HuggingChat. Chat UI is a web chat interface for large language models, built with SvelteKit and TypeScript. It is the codebase that powers the HuggingChat app on hf.co/chat, and it can be run locally or self-hosted for your own models.
Is chat-ui free to use? What license does it have?
chat-ui is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is chat-ui still maintained?
Actively maintained. The last commit to chat-ui was on Oct 20, 2026.
What can I use chat-ui for?
Running a ChatGPT-style interface in front of a self-hosted llama.cpp or Ollama server. Building an internal chat front end for a team that uses an OpenAI-compatible gateway. Starting point for a custom SvelteKit chat app with MongoDB-backed history. Testing MCP tools with different models in a single chat interface.
How do I install chat-ui?
Clone the repository: git clone https://github.com/huggingface/chat-ui Enter the project folder: cd chat-ui Install dependencies: npm install Start the dev server and open the browser (after creating .env.local with OPENAI_BASE_URL and OPENAI_API_KEY): npm run dev -- --open
Where can I get chat-ui?
The source code and installation instructions are on GitHub: https://github.com/huggingface/chat-ui

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects