Skip to content

feat(ai-project-generator): add DeepSeek as a selectable LLM provider#203

Merged
parth0025 merged 1 commit into
stagingfrom
feat/deepseek-llm-provider
Jun 1, 2026
Merged

feat(ai-project-generator): add DeepSeek as a selectable LLM provider#203
parth0025 merged 1 commit into
stagingfrom
feat/deepseek-llm-provider

Conversation

@parth0025
Copy link
Copy Markdown
Collaborator

Summary

Adds DeepSeek as a third LLM provider for the AI-Powered Project Creation feature, alongside the existing OpenAI and Anthropic providers. Selectable via LLM_PROVIDER="deepseek". Also fixes a latent bug in the AI task time estimator that affected all thinking models.

Changes

New provider β€” llmProvider/deepseekProvider.js

  • DeepSeek exposes an OpenAI-compatible Chat Completions API, so this mirrors openaiProvider.js (same body shape, Bearer auth, response_format: json_object, choices[0].message + usage.*).
  • Configurable base URL via DEEPSEEK_BASE_URL (default https://api.deepseek.com).
  • Omits temperature for deepseek-reasoner (thinking mode); sends it for deepseek-chat / deepseek-v4-flash / deepseek-v4-pro.
  • Full error mapping β†’ friendly codes: 402 + quota-429 β†’ LLM_QUOTA_EXCEEDED, 401/403 β†’ LLM_AUTH_FAILED, 400 β†’ LLM_BAD_REQUEST, 502/503 β†’ LLM_UNAVAILABLE, timeout β†’ LLM_TIMEOUT.
  • Output clamp 65536 β€” above the orchestrator's 32000 default, under DeepSeek V4's 384K ceiling β€” so plan requests pass through unclamped.

Registry β€” llmProvider/index.js

  • Registered deepseek in SUPPORTED, added to the fallback chain and isAnyProviderConfigured().

Config β€” config.js + .env.example

  • Exposes DEEPSEEK_API_KEY / DEEPSEEK_MODEL; documents model options, timeout, and base-URL overrides.

Estimator fix β€” EstimatedTime/aiTaskEstimator.js

  • Raised the estimate call's maxTokens 1024 β†’ 8192 and timeout 60s β†’ 120s.
  • Why: thinking models (deepseek-reasoner, deepseek-v4-pro, OpenAI o-series) spend their output budget on hidden reasoning before the visible JSON. At 1024 the answer came back empty (finish_reason="length") β†’ parseMinutes returned null β†’ no estimate was ever saved. This is why DeepSeek v4-pro plans had zero task estimates while GPT-4.1 worked.

Verification

Check Result
Provider selection via LLM_PROVIDER="deepseek" βœ…
Per-model temperature handling (reasoner omits, others send) βœ…
Output clamp pass-through (32000 unclamped; >ceiling β†’ 65536) βœ…
Live DeepSeek auth (401) + quota (402) error mapping βœ…
Estimator sends 8192 + persists end-to-end βœ…
gpt-4.1 unchanged β€” live call: 108 tokens, finish=stop, est=85 βœ…
Bonus: same fix repairs OpenAI o-series estimator path βœ…

Existing functionality

  • OpenAI and Anthropic providers are untouched and verified unchanged (gpt-4.1 produces identical results β€” the higher maxTokens cap is never hit, so zero cost/behavior change).

Notes for testing

  • DeepSeek's deepseek-chat / deepseek-reasoner are aliases that now resolve to V4-Flash; deepseek-v4-flash / deepseek-v4-pro are the canonical names.
  • Thinking models (reasoner, v4-pro) are slower and bill reasoning tokens; deepseek-chat/v4-flash are the cheapest/fastest for estimates.

πŸ€– Generated with Claude Code

Adds DeepSeek (LLM_PROVIDER="deepseek") alongside the existing OpenAI and
Anthropic providers for the AI-Powered Project Creation feature.

New provider β€” Modules/AIProjectGenerator/llmProvider/deepseekProvider.js
- OpenAI-compatible Chat Completions API (same body shape, Bearer auth,
  response_format json_object, choices[0].message + usage.*)
- Configurable base URL (DEEPSEEK_BASE_URL), default https://api.deepseek.com
- Omits temperature for deepseek-reasoner (thinking mode); sends it for
  deepseek-chat / deepseek-v4-flash / deepseek-v4-pro
- Full error mapping: 402 + quota-429 -> LLM_QUOTA_EXCEEDED, 401/403 ->
  LLM_AUTH_FAILED, 400 -> LLM_BAD_REQUEST, 502/503 -> LLM_UNAVAILABLE,
  timeout -> LLM_TIMEOUT
- Output clamp set to 65536 (well above the orchestrator's 32000 default,
  under DeepSeek V4's 384K ceiling) so plan requests pass through unclamped

Registry β€” llmProvider/index.js
- Registered "deepseek" in SUPPORTED; added to fallback chain and
  isAnyProviderConfigured()

Config β€” config.js + .env.example
- Exposes DEEPSEEK_API_KEY / DEEPSEEK_MODEL
- Documents all DeepSeek vars (model options, timeout, base URL)

Estimator fix β€” Modules/EstimatedTime/aiTaskEstimator.js
- Raised the estimate call's maxTokens 1024 -> 8192 and timeout 60s -> 120s.
  Thinking models (deepseek-reasoner, deepseek-v4-pro, OpenAI o-series)
  spend their output budget on hidden reasoning before the visible JSON;
  at 1024 the answer came back EMPTY and no estimate was saved. Verified
  safe + unchanged for gpt-4.1 (non-thinking: stops at ~108 tokens, zero
  cost change) and now also fixes the same latent bug for OpenAI o-series.

Verified: provider selection, per-model temperature handling, output clamp
pass-through, and a live gpt-4.1 estimate call (108 tokens, finish=stop).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@parth0025 parth0025 self-assigned this Jun 1, 2026
@parth0025 parth0025 merged commit 0085e1b into staging Jun 1, 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