feat: add DeepSeek provider support across the gateway#3234
feat: add DeepSeek provider support across the gateway#3234etnperlong wants to merge 7 commits intomaximhq:mainfrom
Conversation
|
|
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (18)
✅ Files skipped from review due to trivial changes (6)
🚧 Files skipped from review as they are similar to previous changes (12)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds DeepSeek as a built-in provider: implements a DeepSeekProvider (chat, streaming, list-models), wires it into the provider factory, adds tests, docs, UI icons/constants, config/OpenAPI/schema entries, and exposes DEEPSEEK_API_KEY and api.deepseek.com in CI workflows. ChangesDeepSeek Provider Implementation & Integration
Sequence DiagramsequenceDiagram
participant Client
participant BifrostCore
participant DeepSeekProvider
participant DeepSeekAPI
rect rgba(100, 150, 255, 0.5)
Note over Client,DeepSeekAPI: Chat Completion Flow
Client->>BifrostCore: ChatCompletion(deepseek/<model>, messages)
BifrostCore->>DeepSeekProvider: ChatCompletion(key, request)
DeepSeekProvider->>DeepSeekProvider: build headers (Authorization Bearer from key)
DeepSeekProvider->>DeepSeekAPI: POST /chat/completions (body, headers)
DeepSeekAPI->>DeepSeekProvider: JSON response {choices: [...]}
DeepSeekProvider->>BifrostCore: BifrostChatResponse
BifrostCore->>Client: Unified response
end
rect rgba(150, 200, 100, 0.5)
Note over Client,DeepSeekAPI: Model Listing Flow
Client->>BifrostCore: ListModels()
BifrostCore->>DeepSeekProvider: ListModels()
DeepSeekProvider->>DeepSeekAPI: GET /models
DeepSeekAPI->>DeepSeekProvider: {data: [{id}, ...]}
DeepSeekProvider->>BifrostCore: BifrostListModelsResponse
BifrostCore->>Client: Unified model list
end
rect rgba(200, 150, 100, 0.5)
Note over Client,DeepSeekAPI: Streaming Chat Flow
Client->>BifrostCore: ChatCompletionStream(...)
BifrostCore->>DeepSeekProvider: ChatCompletionStream(...)
DeepSeekProvider->>DeepSeekAPI: POST /chat/completions?stream=true
DeepSeekAPI->>DeepSeekProvider: SSE / chunked stream
DeepSeekProvider->>BifrostCore: chan BifrostStreamChunk
BifrostCore->>Client: Stream chunks
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.1)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Confidence Score: 4/5Safe to merge for the gateway integration itself; the live CI integration test may fail if DEEPSEEK_API_KEY is populated and the referenced model names are not yet active on the DeepSeek API The core Go adapter, schema registration, and UI wiring are structurally correct and follow established provider patterns. The open concern is that the integration test targets deepseek-v4-flash and deepseek-v4-pro, model identifiers that do not appear in DeepSeek's current public documentation — if the CI secret is set, every live scenario in the comprehensive test suite will hit an invalid-model error from the API core/providers/deepseek/deepseek_test.go and docs/providers/supported-providers/deepseek.mdx — both use the unverified model names that may not yet resolve against the live DeepSeek API Important Files Changed
Reviews (7): Last reviewed commit: "fix: use correct keys field in DeepSeek ..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release-pipeline.yml:
- Line 215: The workflow sets DEEPSEEK_API_KEY but the blocked-job
allowed-endpoints lists do not include the DeepSeek API host, causing outbound
calls to be blocked; update each allowed-endpoints list used by DeepSeek-calling
jobs to include the DeepSeek API host (e.g., api.deepseek.ai) so requests using
DEEPSEEK_API_KEY can reach the provider, and make the same addition for the
other allowed-endpoints occurrences referenced in the review.
In `@core/providers/deepseek/deepseek_test.go`:
- Around line 81-86: In the httptest handler closure inside deepseek_test.go
where the test server is created (the http.HandlerFunc passed to
httptest.NewServer), replace the fatal test helpers (require.Equal) with
non-fatal assertions (assert.Equal) for the URL path and Authorization header
checks so failures don't call t.FailNow from a goroutine; update imports to
include testify/assert if needed and use assert.Equal(t, "/chat/completions",
r.URL.Path) and assert.Equal(t, "Bearer test-api-key",
r.Header.Get("Authorization")) (same for the other handler at line ~112) so
assertion failures are reported without terminating the goroutine.
In `@docs/providers/supported-providers/deepseek.mdx`:
- Around line 85-112: Replace the standalone example blocks in the DeepSeek docs
with Mintlify tabbed sections labeled "Web UI", "API", and "config.json": move
the current curl request and any UI usage into the "Web UI" and "API" tabs as
appropriate, and place the JSON config example under the "config.json" tab
(preserve the exact JSON content). Ensure the "config.json" example validates
against transports/config.schema.json and update headings or brief descriptions
inside each tab to match existing style guidelines.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a4812c2a-f98c-46c9-b9e6-9efb5654da7e
📒 Files selected for processing (18)
.github/workflows/pr-tests.yml.github/workflows/release-pipeline.ymlcore/bifrost.gocore/providers/deepseek/cachedcontents.gocore/providers/deepseek/deepseek.gocore/providers/deepseek/deepseek_test.gocore/schemas/bifrost.godocs/deployment-guides/config-json/schema-reference.mdxdocs/docs.jsondocs/openapi/openapi.jsondocs/openapi/schemas/inference/common.yamldocs/overview.mdxdocs/providers/supported-providers/deepseek.mdxdocs/providers/supported-providers/overview.mdxtransports/config.schema.jsonui/lib/constants/config.tsui/lib/constants/icons.tsxui/lib/constants/logs.ts
|
I checked the model-name concern against the current DeepSeek docs before changing anything. Right now the official docs list References used:
All three are on |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/providers/supported-providers/deepseek.mdx (1)
112-130: ⚡ Quick winConsider adding a
network_configexample to theconfig.jsontab.Line 55 explicitly tells users to override
network_config.base_urlto access DeepSeek's beta endpoints (https://api.deepseek.com/beta), but theconfig.jsontab doesn't illustrate this. Users following the tab to configure DeepSeek will miss this unless they also read the prose above.📄 Suggested addition
{ "providers": { "deepseek": { "api_keys": [ { "value": "env.DEEPSEEK_API_KEY" } - ] + ], + "network_config": { + "base_url": "https://api.deepseek.com/beta" + } } } }(Remove
network_configfrom the snippet if it is not a valid schema field, or show it commented-out with a note.)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/providers/supported-providers/deepseek.mdx` around lines 112 - 130, Update the config.json example in the config.json Tab of the deepseek.mdx docs to include a network_config example that shows overriding network_config.base_url (e.g., pointing to https://api.deepseek.com/beta) so users see how to target the beta endpoint; if network_config is not part of the real schema, include it as a commented-out example or annotated snippet instead and add a brief inline note. Reference the existing config.json Tab and the network_config.base_url field so the change is made alongside the "providers.deepseek" api_keys example.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/providers/supported-providers/deepseek.mdx`:
- Line 83: The docs line claiming "deepseek-chat and deepseek-reasoner remain
legacy compatibility aliases" is incorrect and understates that those names will
be retired; update the text in docs/providers/supported-providers/deepseek.mdx
to mark `deepseek-chat` and `deepseek-reasoner` as deprecated and being retired
on July 24, 2026, and explicitly instruct users to migrate to
`deepseek-v4-flash` and `deepseek-v4-pro`; ensure the sentence replaces the
alias wording and includes the retirement date and recommended replacements.
---
Nitpick comments:
In `@docs/providers/supported-providers/deepseek.mdx`:
- Around line 112-130: Update the config.json example in the config.json Tab of
the deepseek.mdx docs to include a network_config example that shows overriding
network_config.base_url (e.g., pointing to https://api.deepseek.com/beta) so
users see how to target the beta endpoint; if network_config is not part of the
real schema, include it as a commented-out example or annotated snippet instead
and add a brief inline note. Reference the existing config.json Tab and the
network_config.base_url field so the change is made alongside the
"providers.deepseek" api_keys example.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 34c4bfa6-f95e-42ae-950e-9250ee3c10d9
📒 Files selected for processing (3)
.github/workflows/release-pipeline.ymlcore/providers/deepseek/deepseek_test.godocs/providers/supported-providers/deepseek.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
- core/providers/deepseek/deepseek_test.go
- .github/workflows/release-pipeline.yml
| "deepseek": { | ||
| "api_keys": [ | ||
| { | ||
| "value": "env.DEEPSEEK_API_KEY" | ||
| } | ||
| ] | ||
| } |
There was a problem hiding this comment.
The
config.json example uses "api_keys" as the field name, but the transport config schema (config.schema.json) defines the field as "keys" and marks it as required. Every other provider doc (vertex, runway, bedrock, azure, etc.) also uses "keys". A user who copies this snippet verbatim will get a silently ignored config — DeepSeek keys won't be registered and all requests will fail with an auth/missing-provider error.
| "deepseek": { | |
| "api_keys": [ | |
| { | |
| "value": "env.DEEPSEEK_API_KEY" | |
| } | |
| ] | |
| } | |
| "deepseek": { | |
| "keys": [ | |
| { | |
| "value": "env.DEEPSEEK_API_KEY" | |
| } | |
| ] | |
| } |
There was a problem hiding this comment.
Good catch — fixed in 1848aa4. Changed api_keys to keys to match the transport config schema and the pattern used in all other provider docs.
1848aa4 to
836ccb0
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/providers/supported-providers/deepseek.mdx`:
- Around line 44-50: Add a single clarifying sentence in the DeepSeek provider
docs that explicitly distinguishes DeepSeek's upstream root-based endpoints
(e.g., "/chat/completions" and "/models") from the Bifrost gateway paths (which
use the "/v1/..." prefix such as "/v1/chat/completions"), so readers understand
the examples under "API" refer to the Bifrost gateway while the listed DeepSeek
paths are the upstream provider paths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9dbfe00f-28b6-404e-ad5c-e7fc1a5bf5cb
📒 Files selected for processing (18)
.github/workflows/pr-tests.yml.github/workflows/release-pipeline.ymlcore/bifrost.gocore/providers/deepseek/cachedcontents.gocore/providers/deepseek/deepseek.gocore/providers/deepseek/deepseek_test.gocore/schemas/bifrost.godocs/deployment-guides/config-json/schema-reference.mdxdocs/docs.jsondocs/openapi/openapi.jsondocs/openapi/schemas/inference/common.yamldocs/overview.mdxdocs/providers/supported-providers/deepseek.mdxdocs/providers/supported-providers/overview.mdxtransports/config.schema.jsonui/lib/constants/config.tsui/lib/constants/icons.tsxui/lib/constants/logs.ts
✅ Files skipped from review due to trivial changes (4)
- docs/docs.json
- core/providers/deepseek/cachedcontents.go
- docs/openapi/schemas/inference/common.yaml
- core/bifrost.go
🚧 Files skipped from review as they are similar to previous changes (12)
- docs/providers/supported-providers/overview.mdx
- docs/deployment-guides/config-json/schema-reference.mdx
- docs/openapi/openapi.json
- .github/workflows/pr-tests.yml
- transports/config.schema.json
- ui/lib/constants/config.ts
- docs/overview.mdx
- ui/lib/constants/logs.ts
- core/schemas/bifrost.go
- core/providers/deepseek/deepseek_test.go
- .github/workflows/release-pipeline.yml
- core/providers/deepseek/deepseek.go
836ccb0 to
762453d
Compare
Use the shared OpenAI-compatible handlers so DeepSeek models can be routed through Bifrost with the provider's root-path API surface and conservative operation support.
Expose DeepSeek consistently in config metadata, docs, UI, and CI so the new provider can be configured, discovered, and tested like the existing providers.
762453d to
79fa819
Compare
Summary
Adds DeepSeek as a first-class provider and wires it through the core gateway, HTTP transport, docs, config schema, and UI metadata so it can be selected and used consistently across the product.
Changes
Type of change
Affected areas
How to test
go version make test-core PROVIDER=deepseek make build cd ui npm run build