From 7c751bfc021802595c8c2f718e0570da7f0f63d0 Mon Sep 17 00:00:00 2001 From: cat-shark <1716967236@qq.com> Date: Thu, 8 Oct 2026 12:29:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20LLM=20=E5=88=87=E6=8D=A2=E4=B8=BA=20Dee?= =?UTF-8?q?pSeek=20deepseek-flash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 6 +++--- src/llm/client.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d9aad9e..9e0b54e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,7 +11,7 @@ - 运行时:Node.js 20+ - 框架:Fastify 5 -- LLM:SiliconFlow OpenAI 兼容接口(Qwen/Qwen2.5-32B-Instruct) +- LLM:DeepSeek OpenAI 兼容接口(deepseek-flash / DeepSeek-V4.1-Flash) - 运行时依赖:除 fastify 外无其他外部依赖 ## 项目结构 @@ -60,9 +60,9 @@ lpt-ai/src/ ## LLM 配置 ```env -LLM_API_URL=https://api.siliconflow.cn/v1/chat/completions +LLM_API_URL=https://api.deepseek.com/v1/chat/completions LLM_API_KEY= # 必填,未配置时 /health 返回 llmAvailable: false -LLM_MODEL=Qwen/Qwen2.5-32B-Instruct +LLM_MODEL=deepseek-flash LLM_TIMEOUT_MS=60000 # 单次 LLM 调用超时 PORT=5199 ``` diff --git a/src/llm/client.ts b/src/llm/client.ts index 293ac11..cd3122e 100644 --- a/src/llm/client.ts +++ b/src/llm/client.ts @@ -1,5 +1,5 @@ /** - * LLM 客户端 — SiliconFlow OpenAI 兼容接口 + * LLM 客户端 — DeepSeek OpenAI 兼容接口 * * 设计要点: * - Key 从环境变量读取,永不写入代码或日志 @@ -21,9 +21,9 @@ export interface LlmConfig { export function loadConfig(): LlmConfig { return { - apiUrl: process.env.LLM_API_URL ?? "https://api.siliconflow.cn/v1/chat/completions", + apiUrl: process.env.LLM_API_URL ?? "https://api.deepseek.com/v1/chat/completions", apiKey: process.env.LLM_API_KEY ?? "", - model: process.env.LLM_MODEL ?? "Qwen/Qwen2.5-32B-Instruct", + model: process.env.LLM_MODEL ?? "deepseek-flash", timeoutMs: Number(process.env.LLM_TIMEOUT_MS ?? 120000), }; }