DB GPT本地安装部署

源码下载

复制代码
git clone https://github.com/eosphoros-ai/DB-GPT.git

Miniconda环境安装

Miniconda 安装

复制代码
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh

初始化Miniconda

复制代码
~/miniconda3/bin/conda init bash

使conda环境生效:

复制代码
source ~/.bashrc

之后就有conda基础环境了,会看到在终端用户名前面添加了(base)标志

创建Python虚拟环境

复制代码
python >= 3.10

conda create -n dbgpt_env python=3.10

conda activate dbgpt_env #之后conda环境就变成(dbgpt_env) tom@ubuntu:/home/apps$ 

# it will take some minutes

pip install -e ".[default]" -i https://mirrors.aliyun.com/pypi/simple/

复制环境变量

复制代码
cp .env.template  .env

模型部署

下载Embedding 模型

复制代码
cd DB-GPT

mkdir models and cd models

git lfs install

git clone https://huggingface.co/GanymedeNil/text2vec-large-chinese

下载模型比较慢,使用huggingface的镜像站

复制代码
git clone https://hf-mirror.com/GanymedeNil/text2vec-large-chinese

model.safetensor 和 pytorch_model.bin 文件较大可以手动下载放到text2vec-large-chinese文件目录里

配置代理

资源有限,此处采用代理模式安装,代理模式就是采用其他大模型厂商提供的API接口

此处采用智谱的glm-4模型

复制代码
LLM_MODEL=zhipu_proxyllmi
PROXYLLM_BACKEND=glm-4
EMBEDDING_MODEL=text2vec
PROXY_SERVER_URL=https://open.bigmodel.cn/api/paas/v4/chat/completions
ZHIPU_PROXY_API_KEY=

测试数据

加载默认的测试数据到SQLite数据库中

复制代码
bash ./scripts/examples/load_examples.sh

运行服务

复制代码
python dbgpt/app/dbgpt_server.py

访问

http://localhost:5670

相关推荐
普通网友4 分钟前
24年9月最新微软copilot国内Windows11强制开启使用教程方法
windows·ai·微软·copilot
网络研究院13 分钟前
2026年智能体人工智能的激增引发新的网络安全风险
网络·人工智能·安全·web安全·ai
阿杰学AI2 小时前
AI核心知识53——大语言模型之Structured CoT 超级模版(简洁且通俗易懂版)
人工智能·ai·语言模型·prompt·提示词·pe·structured cot
TDengine (老段)2 小时前
使用 deepseek 快速搭建 TDengine IDMP demo
大数据·数据库·科技·ai·时序数据库·tdengine·涛思数据
饭勺oO2 小时前
ACP:让 AI 编程工具配置从此告别碎片化 —— 一款开源的 AI 配置管理平台
ai
韩明君3 小时前
UML在AI中的识别
ai·uml
Code_流苏3 小时前
GPT-5.1深度解析:更智能更自然,日常体验依旧出色!
人工智能·gpt·ai·深度解析·gpt5.1·日常体验
Swizard3 小时前
告别“草率编程”:Vibe Engineering 如何重新定义资深工程师的护城河
ai·vibe coding·vibe engineering
风吹稻香飘3 小时前
【无标题】
人工智能·ai
CoderJia程序员甲3 小时前
GitHub 热榜项目 - 日榜(2025-12-14)
ai·llm·github