DB-GPT 最新0.7.0版本Windows 部署

部署运行你感兴趣的模型镜像

文档:官方文档

Data Agents

我这里就说下细节,我是

小兵我是在在服务器里部署的,不建议小的服务器部署,会GG了

1. 前置环境

因为DB-GPT 越来越强大了,只用pip来管理依赖包的话不太优雅,因此使用 uv 来管理。我最近写的项目也再慢慢转 uv 了,也推荐大家慢慢转过来。本教程讲解以 代理模型 为例, 也就是 openai-proxy

1.1 uv 安装
 

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
当然我这里用到的是conda来进行虚拟环境
1.2项目拉取
git clone https://github.com/eosphoros-ai/DB-GPT.git
cd DB-GPT

 

弄好后,记得把sqlite3 的数据也弄好哦,特别提醒

拉取完后,我是本地部署的

1.3Local(本地模型):
uv sync --all-packages --extra "base" --extra "cuda121" --extra "hf" --extra "rag" --extra "storage_chromadb" --extra "quant_bnb" --extra "dbgpts"

安装完包后

可以提前把模型下载

git clone https://www.modelscope.cn/Qwen/Qwen2.5-14B-Instruct.git

git clone https://hf-mirror.com/BAAI/bge-large-zh-v1.5.git

这里大概33G+,请耐心等待

2.最后

1步骤
cd E:\DB-GPT\

2进入环境
conda activate dbgpt_env_7

3.执行系统运行
uv run dbgpt start webserver --config .\configs\dbgpt-local-qwen.toml

这里提醒一下,local本地一定运行对应的配置文件

[system]
# Load language from environment variable(It is set by the hook)
language = "${env:DBGPT_LANG:-zh}"
api_keys = []
encrypt_key = "your_secret_key"

# Server Configurations
[service.web]
host = "0.0.0.0"
port = 5670

[service.web.database]
type = "sqlite"
path = "pilot/meta_data/dbgpt.db"

[rag.storage]
[rag.storage.vector]
type = "chroma"
persist_path = "pilot/data"

# Model Configurations
[models]
[[models.llms]]
name = "Qwen2.5-0.5B-Instruct"
provider = "hf"
# If not provided, the model will be downloaded from the Hugging Face model hub
# uncomment the following line to specify the model path in the local file system
# path = "the-model-path-in-the-local-file-system"
path = "models/Qwen2.5-0.5B-Instruct"

[[models.embeddings]]
name = "BAAI/bge-large-zh-v1.5"
provider = "hf"
# If not provided, the model will be downloaded from the Hugging Face model hub
# uncomment the following line to specify the model path in the local file system
# path = "the-model-path-in-the-local-file-system"
path = "models/BAAI/bge-large-zh-v1.5"

配置文件根据实际的情况来改

特别注意

# Model Configurations
[models]
[[models.llms]]
name = "Qwen2.5-0.5B-Instruct"
provider = "hf"
# If not provided, the model will be downloaded from the Hugging Face model hub
# uncomment the following line to specify the model path in the local file system
# path = "the-model-path-in-the-local-file-system"
path = "models/Qwen2.5-0.5B-Instruct"

[[models.embeddings]]
name = "BAAI/bge-large-zh-v1.5"
provider = "hf"
# If not provided, the model will be downloaded from the Hugging Face model hub
# uncomment the following line to specify the model path in the local file system
# path = "the-model-path-in-the-local-file-system"
path = "models/BAAI/bge-large-zh-v1.5"

这里的路径和模型名称一定要对上,否则无法加载

提示如果本地部署,内容不够建议32G以上,这是最少的。

您可能感兴趣的与本文相关的镜像

GPT-oss:20b

GPT-oss:20b

图文对话
Gpt-oss

GPT OSS 是OpenAI 推出的重量级开放模型,面向强推理、智能体任务以及多样化开发场景

### DB-GPT部署指南 DB-GPT 是一个开源的数据库领域大模型框架,旨在简化构建数据库大模型应用的过程。以下是详细的部署指南,涵盖从环境准备到运行的完整流程。 #### 1. 环境准备 在开始部署之前,需要确保服务器或本地机器满足以下要求: - 操作系统:Ubuntu 或其他支持的 Linux 发行版。 - Docker 和 Miniconda(可选)安装完成。 可以通过以下命令安装 `git` 和克隆 DB-GPT 源码[^2]: ```bash sudo apt update sudo apt install git git clone https://github.com/eosphoros-ai/DB-GPT.git cd DB-GPT ``` #### 2. 安装 Miniconda 环境 如果选择使用 Miniconda 来管理 Python 环境,可以按照以下步骤进行安装[^2]: ```bash wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.sh ``` 安装完成后,创建并激活虚拟环境: ```bash conda create -n db-gpt python=3.9 conda activate db-gpt ``` #### 3. 下载和配置源码 在克隆源码后,需要确保安装所有依赖项,并正确配置 `.env` 文件[^3]。执行以下命令以安装依赖项: ```bash pip install -r requirements.txt ``` `.env` 文件是项目的核心配置文件,通常包含以下内容: - 数据库连接信息 - 模型路径 - API 密钥(如 OpenAI、Hugging Face 等) 示例 `.env` 配置: ```env OPENAI_API_KEY=your_openai_api_key SQLITE_DB_PATH=./data/sqlite.db MODEL_PATH=./models/ ``` #### 4. 加载 SQLite 数据 DB-GPT 支持多种数据库类型,包括 SQLite。可以通过以下命令加载 SQLite 数据[^3]: ```python from db_gpt import DatabaseLoader loader = DatabaseLoader(db_type="sqlite", db_path="./data/sqlite.db") loader.load_data() ``` #### 5. 运行 DB-GPT 完成上述步骤后,可以通过以下命令启动 DB-GPT 应用程序[^4]: ```bash python app.py ``` 如果一切正常,应用程序将在默认端口上运行,可以通过浏览器访问界面。 #### 6. 常见问题与解决方案 - **Pydantic 版本问题**:确保安装的 Pydantic 版本与项目兼容。可以通过 `pip install pydantic==x.x.x` 解决[^3]。 - **Bash 报错**:检查环境变量是否正确设置,特别是 `.env` 文件中的路径和密钥[^3]。 --- ### 示例代码 以下是一个简单的代码示例,展示如何使用 DB-GPT 对 SQLite 数据库进行查询: ```python from db_gpt import QueryExecutor executor = QueryExecutor(db_type="sqlite", db_path="./data/sqlite.db") result = executor.execute_query("SELECT * FROM users LIMIT 10;") print(result) ``` ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

骑着牛的奇兵

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值