Skip to content

feat(models): add fireworks deepseek-v4-pro and together-ai deepseek-v4-flash mappings - #3431

Closed
vicovaro wants to merge 5 commits into
theopenco:mainfrom
vicovaro:feat/add-deepseek-v4-missing-providers
Closed

vicovaro wants to merge 5 commits into
theopenco:mainfrom
vicovaro:feat/add-deepseek-v4-missing-providers

Conversation

@vicovaro

@vicovaro vicovaro commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Note: any deepseek-v4-flash usage implicitly resolves to the -0731 deployment — see #3341 (closed).

What & why

Adds the two missing DeepSeek V4 provider mappings: Fireworks for V4 Pro and Together AI for V4 Flash. Both providers already serve the sibling DeepSeek V4 model in the catalog (Fireworks hosts V4 Flash, Together hosts V4 Pro); this PR closes the gaps.

Only packages/models/src/models/deepseek.ts changes — catalog metadata, no gateway logic.

Changes (two commits)

Commit Model Provider externalId Input/Cached/Output per 1M Context Notes
feat(models): add fireworks deepseek-v4-pro mapping deepseek-v4-pro fireworks accounts/fireworks/models/deepseek-v4-pro $1.74 / $0.145 / $3.48 up to 1M FP8; priority service tier at 1.5x (same as its V4 Flash sibling); function calling + JSON supported
feat(models): add together-ai deepseek-v4-flash mapping deepseek-v4-flash together-ai deepseek-ai/DeepSeek-V4-Flash-0731 $0.14 / $0.03 / $0.28 163K mirrors the Together V4 Pro deployment conventions (thinking switch, reasoningOutput: "omit"); Together's card lists Chat + Reasoning only — no function calling / JSON mode

References

Tests to run as reviewers

TEST_MODELS="fireworks/deepseek-v4-pro,together-ai/deepseek-v4-flash" pnpm test:e2e

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added Fireworks support for DeepSeek V4 Pro with priority-tier pricing.
    • Added extended reasoning and JSON/schema output options through Fireworks.
    • Added Together AI support for DeepSeek V4 Flash with configurable reasoning controls.
    • Added options to disable thinking and omit reasoning output with Together AI.
    • Together AI does not support tool usage or JSON/schema output for this model.
    • These provider options are now available when configuring supported DeepSeek models.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 40329479-e948-4ae6-ac76-d30013e24fe7

📥 Commits

Reviewing files that changed from the base of the PR and between db25758 and 0c64953.

📒 Files selected for processing (1)
  • packages/models/src/models/deepseek.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/models/src/models/deepseek.ts

Walkthrough

Added Fireworks support for DeepSeek V4 Pro and Together AI support for DeepSeek V4 Flash. Each provider includes model-specific pricing, context, reasoning, and output capability settings.

Changes

DeepSeek V4 provider configurations

Layer / File(s) Summary
Fireworks DeepSeek V4 Pro configuration
packages/models/src/models/deepseek.ts
Adds priority-tier pricing, a 1M-token context limit, reasoning effort options, and JSON/schema output support.
Together AI DeepSeek V4 Flash configuration
packages/models/src/models/deepseek.ts
Adds pricing and context limits, selected reasoning efforts, disabled-thinking support, omitted reasoning output, and disables tools and JSON output.

Estimated code review effort: 3 (Moderate) | ~15–30 minutes

Possibly related PRs

Suggested reviewers: steebchen

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies both DeepSeek V4 provider mappings added by the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

vicovaro and others added 2 commits August 5, 2026 14:17
Adds Fireworks as a provider for DeepSeek V4 Pro
(accounts/fireworks/models/deepseek-v4-pro), 1.74 / 3.48 per 1M
tokens with 0.145 cached input, up to 1M context.

Co-Authored-By: Claude <noreply@anthropic.com>
Adds Together AI as a provider for DeepSeek V4 Flash
(deepseek-ai/DeepSeek-V4-Flash-0731), 0.14 / 0.28 per 1M tokens
with 0.03 cached input.

Co-Authored-By: Claude <noreply@anthropic.com>
@vicovaro
vicovaro force-pushed the feat/add-deepseek-v4-missing-providers branch from abf4f05 to adb923c Compare August 5, 2026 18:27
@vicovaro
vicovaro marked this pull request as ready for review August 5, 2026 18:44
@smakosh
smakosh self-requested a review August 8, 2026 11:29
@smakosh
smakosh requested a review from steebchen August 8, 2026 11:57

@smakosh smakosh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on my end

@smakosh

smakosh commented Aug 8, 2026

Copy link
Copy Markdown
Member

Synced this with main and resolved the conflict — it was an append collision in packages/models/src/models/deepseek.ts where your new together-ai V4 Flash mapping landed on the same line as main's new ranoai mapping. Both are kept. Net diff against main is still exactly your 37 added lines, full build and the models unit tests pass.

I also pushed one commit adding the why-comment for the serviceTierMultipliers: { priority: 1.5 } override on the new Fireworks mapping, since it silently contradicts the 1.25 default in providers.ts and our catalogue rules require a comment on non-obvious values.

Three things I couldn't verify without provider keys — could you confirm before this merges?

1. Together externalId — deepseek-ai/DeepSeek-V4-Flash-0731

This is the only dated Together id in the entire catalogue, and it's byte-identical to the deepinfra mapping's id a few entries above. Every other together-ai externalId (including your V4 Pro sibling, deepseek-ai/DeepSeek-V4-Pro) is undated. The Together adapter forwards externalId verbatim as requestBody.model, so if Together's serverless id is actually undated, every request to this mapping 404s upstream. Worth a live curl against Together's /v1/models to confirm the exact string.

2. tools: false / jsonOutput: false

Your V4 Pro mapping on the same provider declares tools, jsonOutput and jsonOutputSchema all true. The description cites Together's model card showing Chat + Reasoning tags only, but the card's tags aren't always a reliable signal for function calling on DeepSeek deployments. These flags aren't cosmetic: provider-filter-reasons.ts drops the mapping from routing for any tool-calling or structured-output request, and a pinned request 400s in validate-model-capabilities.ts before reaching upstream — so if Together does support them, this mapping never serves the most common agent workload. If the flags are right, please add a comment recording what the deployment actually rejects (per the catalogue comment rule).

3. reasoningEfforts on the Fireworks V4 Pro mapping

The list omits "minimal". Its V4 Flash sibling omits the same value and documents why (Fireworks rejects "minimal" for this model), but that comment is explicitly scoped to that model. I didn't add a matching comment here because I can't confirm the Pro deployment behaves the same way — if you verified it, please add the note; if it was mirrored from the Flash mapping on assumption, "minimal" may need to go back in.

Also worth double-checking requiresDisableThinkingParam: true holds for the Flash deployment — the rationale comment in prepare-request-body.ts enumerates the stacks that need it as "DeepSeek V4 Pro, MiniMax M3 and Kimi", so if Flash belongs there too that comment should be widened to just "DeepSeek V4".

Copy link
Copy Markdown
Member

Superseded by #3484 — closing this one in favour of it. Thanks @vicovaro; your two commits are carried over there unchanged, with authorship preserved.

I ran the e2e suite you suggested against both mappings. Everything passed, but the run also surfaced one thing e2e structurally cannot catch, so I folded a fix into the successor PR rather than merging as-is.

together-ai/deepseek-v4-flash was under-declaring capabilities. This PR sets tools: false, jsonOutput: false, citing Together's model card listing Chat + Reasoning only. The live deployment does more than the card advertises:

  • Tools — returns a well-formed tool_calls, finish_reason: "tool_calls"
  • JSON mode (response_format: json_object) — honoured
  • JSON schema (response_format: json_schema) — honoured, schema respected

That also matches the together-ai V4 Pro mapping, which already declares all three. Worth noting for future mappings: a false capability flag generates no e2e test case, so a green run says nothing about a capability declared false — the suite went from 110 to 119 passing tests once the flags were corrected, and those 9 tests had simply never been generated before.

The other small thing: both new mappings copied trimmed reasoningEfforts lists from their siblings without the siblings' explanatory comments. Restored in #3484, since a bare ["none", "xhigh", "max"] reads like an oversight a future reader would "fix" by adding the missing tiers back.

One open question I left alone: the description here calls the Fireworks Pro deployment FP8, but no quantization field is set, Fireworks' /v1/models doesn't report one, and the Fireworks V4 Flash sibling doesn't declare one either — so I didn't want to assert it. If you can confirm from the deployment, it'd be a good follow-up.


Generated by Claude Code

@steebchen steebchen closed this Aug 8, 2026
steebchen added a commit that referenced this pull request Aug 8, 2026
Supersedes #3431. Carries @vicovaro's two DeepSeek V4 provider mappings
unchanged (their commits are preserved with authorship intact), rebuilt
on current `main`, plus one capability correction found while verifying
the mappings against the live providers.

## What & why

Adds the two missing DeepSeek V4 provider mappings — **Fireworks** for
V4 Pro and **Together AI** for V4 Flash. Both providers already serve
the sibling V4 model in the catalogue, so this closes the gaps. Only
`packages/models/src/models/deepseek.ts` changes; no gateway logic.

| Model | Provider | `externalId` | Input / Cached / Output per 1M |
Context |
|---|---|---|---|---|
| deepseek-v4-pro | fireworks |
`accounts/fireworks/models/deepseek-v4-pro` | $1.74 / $0.145 / $3.48 |
1M |
| deepseek-v4-flash | together-ai | `deepseek-ai/DeepSeek-V4-Flash-0731`
| $0.14 / $0.03 / $0.28 | 163K |

## Capability correction on top of #3431

#3431 declared the Together V4 Flash mapping `tools: false, jsonOutput:
false`, on the basis that Together's model card lists Chat + Reasoning
only. Probing the live deployment shows the card understates it:

- **Tools** — returns a well-formed `tool_calls` with `finish_reason:
"tool_calls"`
- **JSON mode** (`response_format: json_object`) — honoured
- **JSON schema** (`response_format: json_schema`) — honoured, schema
respected

This matches the `together-ai` V4 Pro mapping, which already declares
all three. The mapping now sets `tools: true`, `jsonOutput: true`,
`jsonOutputSchema: true`.

The practical effect of the original values was not mis-billing but
silent under-routing: the gateway would have steered tool-calling and
JSON traffic away from Together for this model, users pinning
`together-ai/deepseek-v4-flash` would lose those features, and — because
a `false` flag generates no test case — e2e would never have covered
those paths.

Both mappings also had trimmed `reasoningEfforts` lists copied from
their siblings without the siblings' explanatory comments; those are
restored, per the repo convention that a non-obvious restricted list
keeps its rationale.

Not changed: the Fireworks Pro mapping carries no `quantization` field.
#3431's description called it FP8, but Fireworks' `/v1/models` reports
no quantization and the Fireworks V4 Flash sibling doesn't declare one
either, so it seemed wrong to assert it in the catalogue. Worth a
follow-up if someone can confirm from the deployment.

## Verification

`TEST_MODELS="fireworks/deepseek-v4-pro,together-ai/deepseek-v4-flash"
pnpm test:e2e`

```
Test Files  29 passed | 2 skipped (31)
     Tests  119 passed | 91 skipped (210)
```

Zero failures. The correction raises the count from 110 to 119 — the 9
additional tests are exactly the Together paths the `false` flags had
suppressed: `chat-json` 6→10, `chat-toolcalls` 4→6,
`chat-toolcalls-result` 3→4, `responses` 8→10.

Also verified: both `externalId`s resolve upstream; per-token cost math
matches the declared rates exactly (106 prompt tokens → $0.00001484 at
$0.14/M, 82 completion → $0.00002296 at $0.28/M); the Fireworks
`priority` tier resolves and applies its 1.5× multiplier in both sync
and streaming; `requiresDisableThinkingParam` and `reasoningOutput:
"omit"` behave correctly on Together (reasoning tokens counted, no
reasoning text emitted); Fireworks streams `reasoning_content` as
expected. `packages/models` catalogue specs pass (131 tests).

---
_Generated by [Claude
Code](https://claude.ai/code/session_01GNFpeYxUh39cCdbp7Ttjud)_

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
  * Added Fireworks as a provider for DeepSeek V4 Pro.
  * Added Together AI as a provider for DeepSeek V4 Flash.
* Added support for provider-specific pricing, capacity, reasoning, tool
use, and JSON output capabilities.


<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Li Tai Chen <dev@taichen.li>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: smakosh <ismai23l@hotmail.com>
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.

3 participants