Conversation
Give every user a lifetime 200,000-token allowance on deepseek-v4-flash via a platform DeepSeek key, so keyless users can build with zero setup. Their own keys always take precedence; explicit non-free picks are never silently swapped to/from free credits. - types: deepseek provider + catalog entry + FREE_DEEPSEEK_* consts; freeDeepseek on profile; deepseek_free_quota_exhausted error code - byok: DeepSeek key validator (api.deepseek.com/models) - db: free_deepseek_tokens_used counter (migration 0004) + atomic per-step metering in recordAgentRunUsage - agent-core: @ai-sdk/deepseek model wiring, non-thinking tool-loop - agent-worker: 3-case credential resolution (own key → platform-free flash → OpenRouter), creditSource threading, synchronous DO-local free-quota hard stop, $0 cost for free runs, canonical slug attribution - gateway/web: Models page free-credits row + usage meter + DeepSeek BYOK - ops: DEEPSEEK_PLATFORM_API_KEY Secrets Store binding + sync-secrets spec
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Every user gets a lifetime 200,000-token free allowance on
deepseek-v4-flashvia a platform DeepSeek key, so keyless users can build with zero setup. Their own keys always take precedence; explicit non-free picks are never silently swapped to/from free credits.Key decisions
agent-worker/llm-provider.ts): own key → platform-free flash → OpenRouter → error, gated on an explicitmodelExplicitflag (Auto vs explicit pick).@ai-sdk/deepseek@2.0.39) keeps the tool-loop clean; browser tools stay BYOK-only (platform key never reaches the sandbox).Already done on prod (this PR just deploys the code)
v2_entitlements.free_deepseek_tokens_used, verified; existing rows default 0).DEEPSEEK_PLATFORM_API_KEYcreated in CF Secrets Store (active); agent-worker binding resolves.deepseek-v4-flashcompletion, tool calling.Verification
pnpm turbo typecheck lint build→ 41/41 · 41/41 · 23/23. Reviewed across 3 Codex rounds (10 findings, 9 applied + 1 rejected with evidence).