字
字节笔记本
2026年5月25日
Factory AI Droid 接入 DeepSeek V4:自定义模型配置指南
API中转
¥120
Factory AI Droid 是一个 AI 编程 Agent 平台,支持通过自定义模型配置接入第三方模型。以下是将 DeepSeek V4 Pro 和 V4 Flash 添加到 Droid 的完整步骤。
可用模型与端点
DeepSeek V4 支持 Anthropic 和 OpenAI 两种 Provider 类型:
| 模型 | Provider | Base URL |
|---|---|---|
| DeepSeek V4 Pro | Anthropic | https://api.deepseek.com/anthropic |
| DeepSeek V4 Flash | Anthropic | https://api.deepseek.com/anthropic |
| DeepSeek V4 Pro | OpenAI | https://api.deepseek.com |
| DeepSeek V4 Flash | OpenAI | https://api.deepseek.com |
配置自定义模型
将以下内容添加到 ~/.factory/settings.json 的 customModels 数组中:
json
{
"model": "deepseek-v4-pro",
"id": "custom:deepseek-v4-pro---Anthropic",
"index": 1,
"baseUrl": "https://api.deepseek.com/anthropic",
"apiKey": "<your DeepSeek API Key>",
"displayName": "DeepSeek V4 Pro",
"maxOutputTokens": 384000,
"noImageSupport": false,
"provider": "anthropic"
},
{
"model": "deepseek-v4-flash",
"id": "custom:deepseek-v4-flash---Anthropic",
"index": 2,
"baseUrl": "https://api.deepseek.com/anthropic",
"apiKey": "<your DeepSeek API Key>",
"displayName": "DeepSeek V4 Flash",
"maxOutputTokens": 384000,
"noImageSupport": false,
"provider": "anthropic"
}设为默认 Mission Model(可选)
在同一文件中更新 missionModelSettings:
json
"missionModelSettings": {
"workerModel": "custom:deepseek-v4-pro---Anthropic",
"workerReasoningEffort": "none",
"validationWorkerModel": "custom:deepseek-v4-flash---Anthropic",
"validationWorkerReasoningEffort": "none",
"skipUserTesting": true,
"skipScrutiny": true
}了解 Provider 类型
Factory 支持三种 Provider 类型:
anthropic:Anthropic Messages API,适用于 Anthropic 官方 API 或兼容代理openai:OpenAI Responses API,新模型如 GPT-5 和 Codex 必须使用此类型generic-chat-completion-api:OpenAI Chat Completions API,适用于 OpenRouter、Ollama 等
DeepSeek V4 同时支持 anthropic 和 openai 两种类型。
注意事项
- 将
<your DeepSeek API Key>替换为实际 Key,或使用环境变量语法:"apiKey": "${DEEPSEEK_API_KEY}" - 最大输出 tokens:384,000
- Model indices 在所有 custom models 中必须唯一
- 启动前设置环境变量:
export DEEPSEEK_API_KEY=your_key_here
故障排除
- 模型未出现在选择器中:检查 JSON 语法,验证必需字段都存在
- Invalid provider 错误:Provider 必须恰好是
anthropic、openai或generic-chat-completion-api - 认证错误:验证 API Key 有效且有可用配额
- 速率限制:检查 Provider 的速率限制和配额
分享: