> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siflow.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# DB-GPT

> 了解如何在 DB-GPT 中配置 proxy/openai model provider，接入 siflow endpoint，让 chat-to-data、agents 和 RAG 应用使用算秩模型。

[DB-GPT](https://github.com/eosphoros-ai/DB-GPT) 是一个开源的 AI-native 数据应用框架，适用于 chat-to-data、agents、RAG 等场景。它的 `proxy/openai` model provider 面向任意 OpenAI-compatible endpoint，因此可以接入 siflow endpoint。

本文默认模型为 `glm-5.2`；完整模型列表和价格请查看 [模型广场](https://console.siflow.cn/model-inference/models)。

请按照 [官方指南](https://docs.dbgpt.site) 部署 DB-GPT。轻量级 `dbgpt-openai` 镜像是 proxy-only build，不需要本地 GPU 模型，适合作为接入 siflow endpoint 的基础镜像。

## 配置

DB-GPT 的模型在服务端 TOML 配置中定义，而不是在 UI 中配置。请使用 `proxy/openai` provider 和内置的 `configs/dbgpt-proxy-openai.toml` 配置。这是接入这类 OpenAI-compatible endpoint 的路径，proxy-only `dbgpt-openai` build 不需要本地 GPU 模型。

该配置已经从环境变量读取所有值，因此只需设置以下变量即可接入 siflow endpoint。启动服务时使用 `--config configs/dbgpt-proxy-openai.toml`。

```toml theme={null}
# configs/dbgpt-proxy-openai.toml (excerpt — values come from env)
[[models.llms]]
name = "${env:LLM_MODEL_NAME:-gpt-4o}"
provider = "${env:LLM_MODEL_PROVIDER:-proxy/openai}"
api_base = "${env:OPENAI_API_BASE:-https://api.openai.com/v1}"
api_key = "${env:OPENAI_API_KEY}"

[[models.embeddings]]
name = "${env:EMBEDDING_MODEL_NAME:-text-embedding-3-small}"
provider = "${env:EMBEDDING_MODEL_PROVIDER:-proxy/openai}"
api_url = "${env:EMBEDDING_MODEL_API_URL:-https://api.openai.com/v1/embeddings}"
api_key = "${env:OPENAI_API_KEY}"
```

在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建 API Key，然后设置：

```bash theme={null}
LLM_MODEL_NAME=glm-5.2
LLM_MODEL_PROVIDER=proxy/openai
OPENAI_API_BASE=https://api.siflow.cn/model-api/v1
OPENAI_API_KEY=<Your API Key>

# Embeddings (RAG / Knowledge Base) — point at a siflow embedding model
EMBEDDING_MODEL_NAME=Qwen/Qwen3-Embedding-8B
EMBEDDING_MODEL_PROVIDER=proxy/openai
EMBEDDING_MODEL_API_URL=https://api.siflow.cn/model-api/v1/embeddings
```

| 字段                        | 值                                                                          |
| ------------------------- | -------------------------------------------------------------------------- |
| `LLM_MODEL_NAME`          | 模型 ID，例如 `glm-5.2`。DB-GPT agents 和 data tools 需要选择原生支持 tool calling 的模型    |
| `LLM_MODEL_PROVIDER`      | `proxy/openai`                                                             |
| `OPENAI_API_BASE`         | siflow OpenAI-compatible endpoint：`https://api.siflow.cn/model-api/v1`     |
| `OPENAI_API_KEY`          | 创建的 API Key                                                                |
| `EMBEDDING_MODEL_API_URL` | siflow embeddings endpoint：`https://api.siflow.cn/model-api/v1/embeddings` |

## 验证

启动 Web 服务并打开 UI（默认 `http://localhost:5670`）。在 chat 中，model selector 显示 **glm-5.2**；发送一条消息，如果返回正常回复，即表示连接成功。

<img src="https://mintcdn.com/siflow/CfO6jliU08Hhf849/model-inference/media/db-gpt-chat-reply.png?fit=max&auto=format&n=CfO6jliU08Hhf849&q=85&s=a19e94bdacac0077fa9f5d8e14565b14" alt="DB-GPT 使用算秩 glm-5.2 模型进行对话" width="2988" height="1436" data-path="model-inference/media/db-gpt-chat-reply.png" />

回复可能会以 "DB-GPT assistant" 身份返回。这是 DB-GPT 自身的 agent 身份设定，不是路由问题；消息下方的 `Model: glm-5.2` 标签可以确认正在使用的模型。
