Add native DeepSeek provider via the Responses API - #755
Open
zhang0098 wants to merge 2 commits into
Open
Conversation
Add a fourth built-in provider that calls api.deepseek.com directly with a user-supplied DEEPSEEK_API_KEY over the OpenAI Responses wire: new deepseek, deepseek_api_key credential source, provider catalog and CLI wiring (login/logout/provider/models), a curated model catalog for deepseek-v4-flash/pro/vision-exp, and a permission reviewer on deepseek-v4-flash. The transport omits OpenAI-only fields DeepSeek ignores (include, service tier, parallel tool calls, verbosity), keeps the plaintext reasoning items that thinking-mode tool loops must pass back, and reuses the shared Responses reducer. The reducer now treats the phase on output_item.done as authoritative when it corrects a provisional phase from output_item.added; DeepSeek announces final_answer at item start and completes the same item as commentary before tool calls, which previously aborted every multi-turn tool loop with ResponsesTextConflict. Verified live against api.deepseek.com with a real key: provider selection, model listing, a read_file tool round trip, and a multi- round recovery session all complete; DeepSeek unit tests pass in isolation. Full CI still to run on this branch.
zhang0098
marked this pull request as ready for review
September 8, 2026 07:43
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 native model provider that fx talks to directly. Requests route straight from fx to the DeepSeek API (
api.deepseek.com) over the OpenAI Responses protocol with your own key, never through Vercel AI Gateway, OpenAI, or xAI.Registering DeepSeek with
fx login deepseekDeepSeek is pay-as-you-go and key-based, so there is no OAuth browser sign-in. Configure it from the terminal:
Notes on how this flow behaves, so the docs and copy stay honest:
fx login deepseekchecks theDEEPSEEK_API_KEYenvironment variable, fetches the authenticated DeepSeek model catalog with it, and persists only the provider/model selection (profile settings under~/.fx).~/.fxfile, and never sends it to Vercel, OpenAI, or xAI.fx logout deepseekprints that nothing is stored.fx login deepseekreportsfx needs a DeepSeek API key for this model. Set DEEPSEEK_API_KEY.when the variable is missing or empty, andfx provider deepseekand/providercan select DeepSeek the same way.What changes
deepseekprovider id wired into the CLI, TUI provider menu, model catalog, credential resolution, and permission review.src/gateway/deepseek.zig: DeepSeek transport over the Responses API, including streaming, tool use, and image input;src/gateway/deepseek_models.zig: authenticated model catalog;src/gateway/deepseek_permission_reviewer.zig: permission review for direct DeepSeek traffic.Verification
zig build -Doptimize=ReleaseSafesucceeds on this head; the built binary reports0.0.8and runs.Required label:
type: feature(external contributor cannot apply labels on this repo; please add it during review).