Skip to content

feat(llm): switch default provider to DeepSeek - #65

Merged
shanchuann merged 1 commit into
mainfrom
docs/default-deepseek
Jun 7, 2026
Merged

shanchuann merged 1 commit into
mainfrom
docs/default-deepseek

Conversation

@shanchuann

Copy link
Copy Markdown
Owner

功能描述

把"默认 LLM provider"从小米 MiMo 切换为 DeepSeek,让 README / .env.example / factory 三处对齐——之前文档写默认 MiMo,但实际项目跑的是 DeepSeek。

实现思路

factory(代码契约):

  • `_auto_detect_provider()`:DeepSeek 优先(之前是 MiMo 优先)
  • 两个 key 都配 → 选 DeepSeek(之前选 MiMo)
  • 都没配 → fallback 到 `deepseek`(之前 `mimo`),让 `LLMConfigError` 里提的 provider 与文档一致
  • docstring 同步更新

测试:

  • `test_both_keys_present_prefers_mimo_when_unspecified` 改名为 `test_both_keys_present_prefers_deepseek_when_unspecified`,断言切换
  • 其他四条测试(单 key / 显式 env / 未知 provider / 无 key)行为不变

`.env.example`:DeepSeek 块挪到最上面 + 写明"默认";MiMo 块保留在下面作为备选;`STORY2SCRIPT_LLM_PROVIDER` 注释更新说明新的优先级。

README:

`docs/API.md`:环境变量表 `DEEPSEEK_API_KEY` 移到第一行 + 默认 provider;`STORY2SCRIPT_LLM_PROVIDER` 取值表序改成 `deepseek / mimo` 并显式写明双 key 时选哪个。

测试方式

  • `py -m pytest -q`:318 passed(含改写后的 factory 测试)
  • `py -m ruff check`:clean
  • 前端无变化(factory 在前端看到的就是 provider 名,前端徽标已经直接显示后端返回值)

依赖与复用声明

无新增第三方依赖。改动是"默认值翻转" + 文档同步,不引入任何能力。

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Code, env example, and docs all flagged MiMo as the default, but
the actual project setup (and the demo recording about to be made)
runs against DeepSeek. The factory's auto-detect order put MiMo
first and the no-key fallback was also MiMo — both wrong relative
to what the README says.

Realigns the factory and docs to match reality:

- factory: DEEPSEEK_API_KEY auto-detects deepseek; both keys
  configured picks deepseek; no key falls back to deepseek (so the
  resulting LLMConfigError mentions the documented default).
- test_factory: the both-keys-present test now pins deepseek and is
  renamed to match the new contract.
- .env.example: DeepSeek block moved to the top with the default
  notes; MiMo block kept underneath as the explicit alternative.
- README: every "默认走小米 MiMo" line, env-var example, key-prefix
  table, dependency table and FAQ row now lead with DeepSeek.
- docs/API.md: env table row order flipped, default-provider note
  rewritten so the new "both keys → deepseek" tiebreak is explicit.

318 backend tests still pass; the factory contract change is
covered by the rewritten test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shanchuann
shanchuann merged commit cec0eaa into main Jun 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant