Chat UI 文档

🤗 Chat UI

Hugging Face's logo
加入 Hugging Face 社区

并获得增强的文档体验

开始使用

🤗 Chat UI

开源聊天界面,支持工具、网页搜索、多模态以及众多 API 提供商。该应用程序在后台使用 MongoDB 和 SvelteKit。您可以尝试名为 HuggingChat 的实时版本,网址是 hf.co/chat,或者设置您自己的实例

🔧 工具:自定义工具的函数调用,并支持零 GPU 空间

🔍 网页搜索:所有模型的自动化网页搜索、抓取和 RAG

🐙 多模态:接受支持提供商的图像文件上传

👤 OpenID:可选设置 OpenID 用于用户身份验证

工具
网页搜索

快速入门

得益于 Chat UI 对 llama.cpp 服务器的支持,您可以快速拥有一个本地运行的 Chat UI 和 LLM 文本生成服务器。

步骤 1(启动 llama.cpp 服务器)

# install llama.cpp
brew install llama.cpp
# start llama.cpp server (using hf.co/microsoft/Phi-3-mini-4k-instruct-gguf as an example)
llama-server --hf-repo microsoft/Phi-3-mini-4k-instruct-gguf --hf-file Phi-3-mini-4k-instruct-q4.gguf -c 4096

本地 LLaMA.cpp HTTP 服务器将在 https://:8080 启动。阅读更多此处

步骤 2(告诉 Chat UI 使用本地 llama.cpp 服务器)

将以下内容添加到您的 .env.local

MODELS=`[
  {
    "name": "Local microsoft/Phi-3-mini-4k-instruct-gguf",
    "tokenizer": "microsoft/Phi-3-mini-4k-instruct-gguf",
    "preprompt": "",
    "chatPromptTemplate": "<s>{{preprompt}}{{#each messages}}{{#ifUser}}<|user|>\n{{content}}<|end|>\n<|assistant|>\n{{/ifUser}}{{#ifAssistant}}{{content}}<|end|>\n{{/ifAssistant}}{{/each}}",
    "parameters": {
      "stop": ["<|end|>", "<|endoftext|>", "<|assistant|>"],
      "temperature": 0.7,
      "max_new_tokens": 1024,
      "truncate": 3071
    },
    "endpoints": [{
      "type" : "llamacpp",
      "baseURL": "https://:8080"
    }],
  },
]`

阅读更多此处

步骤 3(确保您本地运行着 MongoDb)

docker run -d -p 27017:27017 --name mongo-chatui mongo:latest

阅读更多此处

步骤 4(启动 Chat UI)

git clone https://github.com/huggingface/chat-ui
cd chat-ui
npm install
npm run dev -- --open

阅读更多此处

< > 在 GitHub 上更新