微信扫码
添加专属顾问
我要投稿
git clone https://github.com/eosphoros-ai/DB-GPT.git
# cd 到 DB-GPT 源码根目录
cd DB-GPT
# DB-GPT 要求python >= 3.10
conda create -n dbgpt_env python=3.10
conda activate dbgpt_env
# 这里选择代理模型类依赖安装
pip install -e ".[proxy]"
# 复制模板 env 文件为 .env
cp .env.template .env
# 使用 SiliconCloud 的代理模型
LLM_MODEL=siliconflow_proxyllm
# 配置具体使用的模型名称
SILICONFLOW_MODEL_VERSION=Qwen/Qwen2.5-Coder-32B-Instruct
SILICONFLOW_API_BASE=https://api.siliconflow.cn/v1
# 记得填写您在步骤2中获取的 API Key
SILICONFLOW_API_KEY={your-siliconflow-api-key}
# 配置使用 SiliconCloud 的 Embedding 模型
EMBEDDING_MODEL=proxy_http_openapi
PROXY_HTTP_OPENAPI_PROXY_SERVER_URL=https://api.siliconflow.cn/v1/embeddings
# 记得填写您在步骤2中获取的 API Key
PROXY_HTTP_OPENAPI_PROXY_API_KEY={your-siliconflow-api-key}
# 配置具体的 Embedding 模型名称
PROXY_HTTP_OPENAPI_PROXY_BACKEND=BAAI/bge-large-zh-v1.5
# 配置使用 SiliconCloud 的 rerank 模型
RERANK_MODEL=rerank_proxy_siliconflow
RERANK_PROXY_SILICONFLOW_PROXY_SERVER_URL=https://api.siliconflow.cn/v1/rerank
# 记得填写您在步骤2中获取的 API Key
RERANK_PROXY_SILICONFLOW_PROXY_API_KEY={your-siliconflow-api-key}
# 配置具体的 rerank 模型名称
RERANK_PROXY_SILICONFLOW_PROXY_BACKEND=BAAI/bge-reranker-v2-m3
dbgpt start webserver --port 5670
pip install "dbgpt>=0.6.3rc2" openai requests numpy
import asyncio
import os
from dbgpt.core import ModelRequest
from dbgpt.model.proxy import SiliconFlowLLMClient
model = "Qwen/Qwen2.5-Coder-32B-Instruct"
client = SiliconFlowLLMClient(
api_key=os.getenv("SILICONFLOW_API_KEY"),
model_alias=model
)
res = asyncio.run(
client.generate(
ModelRequest(
model=model,
messages=[
{"role": "system", "content": "你是一个乐于助人的 AI 助手。"},
{"role": "human", "content": "你好"},
]
)
)
)
print(res)
import os
from dbgpt.rag.embedding import OpenAPIEmbeddings
openai_embeddings = OpenAPIEmbeddings(
api_url="https://api.siliconflow.cn/v1/embeddings",
api_key=os.getenv("SILICONFLOW_API_KEY"),
model_name="BAAI/bge-large-zh-v1.5",
)
texts = ["Hello, world!", "How are you?"]
res = openai_embeddings.embed_documents(texts)
print(res)
import os
from dbgpt.rag.embedding import SiliconFlowRerankEmbeddings
embedding = SiliconFlowRerankEmbeddings(
api_key=os.getenv("SILICONFLOW_API_KEY"),
model_name="BAAI/bge-reranker-v2-m3",
)
res = embedding.predict("Apple", candidates=["苹果", "香蕉", "水果", "蔬菜"])
print(res)
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费POC验证,效果达标后再合作。零风险落地应用大模型,已交付160+中大型企业
2026-02-06
给自己搭一个 AI 搭档:OpenClaw 安装使用全记录
2026-02-06
Qwen3-TTS:2026年最强开源文本转语音模型完全指南
2026-02-06
OpenClaw 爆火之后,我们看到了这些创业信号
2026-02-05
闭门探讨:130位AI创业者,对Clawdbot和下一代AI产品的39条思考
2026-02-05
从Clawdbot到OpenClaw:爆款本地AI Agent的产品逻辑与争议
2026-02-05
Clawdbot 如何实现像人一样的长期记忆?
2026-02-05
全球最多下载中文开源数据集更新|OpenCSG持续打造中文高质量数据集开源底座
2026-02-05
【开源】12.1K Star!用 Markdown 给大模型装上“外挂大脑”,不写后端、不搭平台,这个开源项目让你用 Git 管理 AI 任务流
2025-11-19
2026-01-27
2025-12-22
2026-01-12
2025-12-10
2025-11-17
2026-01-29
2025-12-23
2026-01-28
2026-01-06
2026-02-05
2026-01-28
2026-01-26
2026-01-21
2026-01-21
2026-01-20
2026-01-16
2026-01-02