**首先 Chatbot UI是适合所有人的开源AI聊天应用程序
开源地址** GitHub - mckaywrigley/chatbot-ui: AI chat for any model.
基本 配置需求
需要nvm 和 node (目前我的node是18.20.5)
请全程配置vpn , 尽量减少因网络问题而产生的其他问题
具体配置步骤 (按照 顺序且每一步都必不可少)
1. 克隆地址
html
git clone https://github.com/mckaywrigley/chatbot-ui.git
2.安装依赖
html
npm install
3.安装supabase并在本地运行
3.1安装docker(docker适配于mac Linux,在window上可能会有一些问题)
3. 1 . 1 docker ps 或者 docker images 有内容返回表示安装成功
html
docker ps 或者 docker images
3.2安装scoop
3.2.1 打开powershell 输入 Set-ExecutionPolicy RemoteSigned -Scope CurrentUser (用于打开权限)
html
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
3.2.2 下载scoop,可能会出现问题,我搜集了四种下载方法,有一种能下载即可
html
irm get.scoop.sh | iex
iwr -useb get.glimmer.ltd | iex
irm https://ghproxy.com/raw.githubusercontent.com/duzyn/scoop-cn/master/install.ps1 | iex
irm https://cdn.jsdelivr.net/gh/duzyn/scoop-cn/install.ps1 | iex
3.2. 3 下载scoop的必装软件
html
scoop install aria2 git 7zip
3.2. 4 scoop -v 检查是否安装成功
3.3用 scoop 安装supabase CLI
3 .3.1 mac / linux:
html
brew install supabase/tap/supabase
window:
html
scoop bucket add supabase https://github.com/supabase/scoop-bucket.git
scoop install supabase
3.3. 2 启动supabase
去本地根目录的终端中执行 supabase start 或者去本地根目录 \supabase\docker中执行 docker-compose up -d , 启动成功后终端和docker内容如下
4 .填写 机密
4 .1 在本地 根目录创建 .env.local并 终端运行
html
cp .env.local.example .env.local
4 . 2 执行 supabase status 后 , 将里面的信息替换到. env.local和.env.local.example
javascript
// 这是.env.local的内容
# Supabase Public
NEXT_PUBLIC_SUPABASE_URL= http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
# Supabase Private
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
# Ollama
NEXT_PUBLIC_OLLAMA_URL=http://localhost:11434
# API Keys (Optional: Entering an API key here overrides the API keys globally for all users.)
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
GOOGLE_GEMINI_API_KEY=
MISTRAL_API_KEY=
GROQ_API_KEY=
PERPLEXITY_API_KEY=
OPENROUTER_API_KEY=
# OpenAI API Information
NEXT_PUBLIC_OPENAI_ORGANIZATION_ID=sk-sBY_jJMt61s-JSN5HMrDFdalEVvaIJyRFQklxLS_oTT3BlbkFJRBpdVILQZKJTbJbGlNxb4IdGAcAtXOOgp8li0KcToA
# Azure API Information
AZURE_OPENAI_API_KEY=
AZURE_OPENAI_ENDPOINT=
AZURE_GPT_35_TURBO_NAME=
AZURE_GPT_45_VISION_NAME=
AZURE_GPT_45_TURBO_NAME=
AZURE_EMBEDDINGS_NAME=
# General Configuration (Optional)
EMAIL_DOMAIN_WHITELIST=
EMAIL_WHITELIST=
# File size limit for uploads in bytes
NEXT_PUBLIC_USER_FILE_SIZE_LIMIT=10485760
-----------------------------------------------------------------------------------------
// 这是.env.local.example的内容
# Supabase Public
NEXT_PUBLIC_SUPABASE_URL= http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
# Supabase Private
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
# Ollama
NEXT_PUBLIC_OLLAMA_URL=http://localhost:11434
# API Keys (Optional: Entering an API key here overrides the API keys globally for all users.)
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
GOOGLE_GEMINI_API_KEY=
MISTRAL_API_KEY=
GROQ_API_KEY=
PERPLEXITY_API_KEY=
OPENROUTER_API_KEY=
# OpenAI API Information
NEXT_PUBLIC_OPENAI_ORGANIZATION_ID=
# Azure API Information
AZURE_OPENAI_API_KEY=
AZURE_OPENAI_ENDPOINT=
AZURE_GPT_35_TURBO_NAME=
AZURE_GPT_45_VISION_NAME=
AZURE_GPT_45_TURBO_NAME=
AZURE_EMBEDDINGS_NAME=
# General Configuration (Optional)
EMAIL_DOMAIN_WHITELIST=
EMAIL_WHITELIST=
# File size limit for uploads in bytes
NEXT_PUBLIC_USER_FILE_SIZE_LIMIT=10485760
4. 3 在本地 根目录 \supabase \ migrations\20240108234540_setup.sql将 service_role_key TEXT := 更换成 supabase status中的service_role_key
5. 安装Ollama https://github.com/ollama/ollama#macos
6. 运行项目 npm run chat
前端地址是 http://localhost:3000/
后端GUI是 http://localhost:54323/project/default/editor