feat(ai-project-generator): add DeepSeek as a selectable LLM provider#203
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsopenaiProvider.js(same body shape,Bearerauth,response_format: json_object,choices[0].message+usage.*).DEEPSEEK_BASE_URL(defaulthttps://api.deepseek.com).temperaturefordeepseek-reasoner(thinking mode); sends it fordeepseek-chat/deepseek-v4-flash/deepseek-v4-pro.402+ quota-429βLLM_QUOTA_EXCEEDED,401/403βLLM_AUTH_FAILED,400βLLM_BAD_REQUEST,502/503βLLM_UNAVAILABLE, timeout βLLM_TIMEOUT.65536β above the orchestrator's32000default, under DeepSeek V4's 384K ceiling β so plan requests pass through unclamped.Registry β
llmProvider/index.jsdeepseekinSUPPORTED, added to the fallback chain andisAnyProviderConfigured().Config β
config.js+.env.exampleDEEPSEEK_API_KEY/DEEPSEEK_MODEL; documents model options, timeout, and base-URL overrides.Estimator fix β
EstimatedTime/aiTaskEstimator.jsmaxTokens1024 β 8192 and timeout 60s β 120s.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") βparseMinutesreturned null β no estimate was ever saved. This is why DeepSeek v4-pro plans had zero task estimates while GPT-4.1 worked.Verification
LLM_PROVIDER="deepseek"temperaturehandling (reasoner omits, others send)gpt-4.1unchanged β live call: 108 tokens,finish=stop, est=85Existing functionality
gpt-4.1produces identical results β the highermaxTokenscap is never hit, so zero cost/behavior change).Notes for testing
deepseek-chat/deepseek-reasonerare aliases that now resolve to V4-Flash;deepseek-v4-flash/deepseek-v4-proare the canonical names.deepseek-chat/v4-flashare the cheapest/fastest for estimates.π€ Generated with Claude Code