{"name":"Chat UI: The Open Source Interface for LLMs, Powering HuggingChat","description":"Chat UI is an open-source SvelteKit application that provides a flexible chat interface for Large Language Models (LLMs). It serves as the foundation for HuggingChat, enabling users to interact with various OpenAI-compatible APIs. This project offers extensive customization and deployment options, making it ideal for developers building their own AI chat experiences.","github":"https://github.com/huggingface/chat-ui","url":"https://osrepos.com/repo/huggingface-chat-ui","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/huggingface-chat-ui","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/huggingface-chat-ui.md","json":"https://osrepos.com/repo/huggingface-chat-ui.json","topics":["chatgpt","huggingface","llm","svelte","sveltekit","typescript","ai","open-source"],"keywords":["chatgpt","huggingface","llm","svelte","sveltekit","typescript","ai","open-source"],"stars":null,"summary":"Chat UI is an open-source SvelteKit application that provides a flexible chat interface for Large Language Models (LLMs). It serves as the foundation for HuggingChat, enabling users to interact with various OpenAI-compatible APIs. This project offers extensive customization and deployment options, making it ideal for developers building their own AI chat experiences.","content":"## Introduction\n\nChat UI is an impressive open-source project by Hugging Face, serving as the foundational codebase for the popular HuggingChat application. Built with SvelteKit and TypeScript, it provides a highly customizable and extensible chat interface designed specifically for interacting with Large Language Models (LLMs). This project empowers developers to create their own AI chat experiences, offering seamless integration with various OpenAI-compatible APIs and robust features for managing chat history, users, and settings.\n\n## Installation\n\nGetting Chat UI up and running locally is straightforward. The project is designed to connect with OpenAI-compatible APIs, making it flexible for various LLM providers.\n\n**Step 1: Clone the repository and set up your environment variables.**\n\nFirst, clone the repository and navigate into its directory:\n\nbash\ngit clone https://github.com/huggingface/chat-ui\ncd chat-ui\n\n\nNext, create a `.env.local` file in the root of the project. This file will hold your API endpoint and key. For quick setup, you can use Hugging Face Inference Providers router:\n\nenv\nOPENAI_BASE_URL=https://router.huggingface.co/v1\nOPENAI_API_KEY=hf_************************ # Replace with your Hugging Face access token\n\n\n**Step 2: Install dependencies and launch the development server.**\n\nbash\nnpm install\nnpm run dev -- --open\n\n\nThis will start the development server, and Chat UI will be accessible in your browser, ready for you to start chatting.\n\n## Examples\n\nChat UI offers versatile integration options for various LLM providers and robust database solutions.\n\n**Connecting to Different LLM Providers:**\n\nThe `OPENAI_BASE_URL` and `OPENAI_API_KEY` in your `.env.local` file can be configured to work with a range of OpenAI-compatible services:\n\n| Provider                                | Example `OPENAI_BASE_URL`          | Example key env                                                         |\n| :-------------------------------------- | :--------------------------------- | :---------------------------------------------------------------------- |\n| Hugging Face Inference Providers router | `https://router.huggingface.co/v1` | `OPENAI_API_KEY=hf_xxx` (or `HF_TOKEN` legacy alias)                    |\n| llama.cpp server                        | `http://127.0.0.1:8080/v1`         | `OPENAI_API_KEY=sk-local-demo` (any string works; llama.cpp ignores it) |\n| Ollama                                  | `http://127.0.0.1:11434/v1`        | `OPENAI_API_KEY=ollama`                                                 |\n| OpenRouter                              | `https://openrouter.ai/api/v1`     | `OPENAI_API_KEY=sk-or-v1-...`                                           |\n| Poe                                     | `https://api.poe.com/v1`           | `OPENAI_API_KEY=pk_...`                                                 |\n\n**Database Options:**\n\nFor chat history, user data, and settings, Chat UI uses MongoDB. For local development, it can fall back to an embedded MongoDB. For production or team environments, you can configure it with:\n\n*   **MongoDB Atlas (managed):** Set `MONGODB_URL` to your Atlas connection string.\n*   **Local MongoDB (container):** Run `docker run -d -p 27017:27017 --name mongo-chatui mongo:latest` and set `MONGODB_URL=mongodb://localhost:27017`.\n\n**Advanced Features:**\n\nChat UI also supports advanced configurations like:\n\n*   **Theming:** Customize the app's name, assets, and data sharing options using environment variables.\n*   **LLM Router:** Implement server-side smart routing for LLMs using models like `katanemo/Arch-Router-1.5B`, allowing the UI to select the best model for each message.\n*   **MCP Tools (Model Context Protocol):** Integrate external tools and services, enabling models to perform actions like web searches and feed results back into the conversation using OpenAI function calling.\n\n## Why Use Chat UI?\n\nChat UI stands out as a robust and flexible solution for anyone looking to build or customize an AI chat application. Its key advantages include:\n\n*   **Open Source and Community-Driven:** Being open source, it benefits from community contributions and offers full transparency and control.\n*   **Proven Reliability:** It powers HuggingChat, demonstrating its stability and capability in a real-world, high-traffic environment.\n*   **Broad LLM Compatibility:** Its support for OpenAI-compatible APIs means you can easily integrate with a wide array of LLM providers, from commercial services to local models.\n*   **Developer-Friendly:** Built with SvelteKit and TypeScript, it offers a modern development experience, with clear installation steps and comprehensive documentation.\n*   **Rich Feature Set:** From basic chat functionality to advanced LLM routing, tool integration, and theming, Chat UI provides a comprehensive toolkit for sophisticated AI chat applications.\n\n## Links\n\n*   **GitHub Repository:** [https://github.com/huggingface/chat-ui](https://github.com/huggingface/chat-ui){:target=\"_blank\"}\n*   **HuggingChat Application:** [https://huggingface.co/chat](https://huggingface.co/chat){:target=\"_blank\"}","metrics":{"detailViews":8,"githubClicks":5},"dates":{"published":null,"modified":"2026-02-25T01:12:45.000Z"}}