Chat UI 文档

🤗 Chat UI

Hugging Face's logo
加入 Hugging Face 社区

并获得增强的文档体验

开始使用

🤗 Chat UI

开源聊天界面,支持工具、网页搜索、多模态和许多 API 提供商。该应用在后台使用 MongoDB 和 SvelteKit。试用该应用的在线版本 HuggingChat (hf.co/chat)设置您自己的实例

🔧 工具:使用自定义工具进行函数调用,并支持 Zero GPU spaces

🔍 网页搜索:适用于所有模型的自动网页搜索、抓取和 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 服务器将在 http://localhost: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": "http://localhost: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 上更新