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

相关推荐
duration~6 小时前
SpringAI集成MCP
人工智能·后端·spring·ai
leiya_16312 小时前
私有化部署本地大模型+function Calling+本地数据库
人工智能·ai·大模型
Dajiaonew13 小时前
Spring AI RAG 检索增强 应用
java·人工智能·spring·ai·langchain
暮小暮1 天前
从ChatGPT到智能助手:Agent智能体如何颠覆AI应用
人工智能·深度学习·神经网络·ai·语言模型·chatgpt
CoderJia程序员甲1 天前
GitHub 热榜项目 - 日榜(2025-08-14)
ai·github·开源项目·github热榜
liuhenghui52012 天前
神经网络 常见分类
ai
迈火2 天前
ComfyUI-3D-Pack:3D创作的AI神器
人工智能·gpt·3d·ai·stable diffusion·aigc·midjourney
CoderJia程序员甲2 天前
GitHub 热榜项目 - 日榜(2025-08-16)
人工智能·ai·开源·github
ejinxian3 天前
AI Agents 2025年十大战略科技趋势
人工智能·ai·ai agents
东方不败之鸭梨的测试笔记3 天前
智能测试用例生成工具设计
人工智能·ai·langchain