Skip to content

feat(concentrate): add Concentrate provider - #5049

Draft
AjayK47 wants to merge 6 commits into
anomalyco:devfrom
AjayK47:concentrate-provider
Draft

feat(concentrate): add Concentrate provider#5049
AjayK47 wants to merge 6 commits into
anomalyco:devfrom
AjayK47:concentrate-provider

Conversation

@AjayK47

@AjayK47 AjayK47 commented Aug 19, 2026

Copy link
Copy Markdown

Registers Concentrate as an OpenAI-compatible aggregator with an initial set of eight models. The remaining catalog follows in separate batches so each change stays small enough to review.

The sync joins the public model list with each model's detail endpoint and derives pricing, limits, modalities, tool calling, structured output and attachment support from that data. Capabilities and limits come from the aggregate list/detail payloads rather than a single upstream route, so a capability-thin route cannot narrow what the gateway accepts, and output limits are capped by canonical models.dev metadata.

Three rules encode the gateway's serving reality rather than its catalog:

  • Pricing defaults to the cheapest advertised route, but IDs whose live traffic is relayed elsewhere are pinned to the observed serving route, so published cost matches what callers are charged.
  • The gateway-level capability is authoritative for structured output. A route can advertise json_schema while the relay in front of it does not expose the feature.
  • Context pricing tiers at or above a model's own window are dropped, because such a band can never be entered.

Reasoning controls are authored per model from the host's declared route metadata rather than inferred from the gateway's normalization enum, which silently accepts unsupported effort values. Every published effort value is backed by a route that declares it, and narrower or empty sets carry a leading comment with the API evidence. New remote models are reported instead of created automatically so each one gets that review first.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [medium] [possible mistake] providers/concentrate/models/claude-sonnet-5.toml:4 - Check: Relay reasoning_options must match the lab + same-surface peer baseline for this host. Why: anthropic/claude-sonnet-5 and established relays (e.g. OpenRouter, CrossModel) use toggle + effort low|medium|high|xhigh|max. This file ships effort only, with no leading wire-path comment explaining a host-specific narrower surface, so callers may miss an on/off control Concentrate actually exposes (its own schema models thinking.types.enabled). Action: Verify Concentrate’s Chat API for this ID; if thinking can be disabled separately from effort, add toggle plus a top-of-file wire comment; if not, keep effort-only and document the exact API evidence in a leading comment.
  • [medium] [possible mistake] providers/concentrate/models/deepseek-v3-0324.toml:2 - Check: Provider overrides of attachment / [modalities] must be real host deltas. Why: Lab deepseek/deepseek-v3-0324 is text-only with attachment = false, and other hosts of this checkpoint do not advertise PDF. Claiming attachment = true and input = ["text", "pdf"] is a unique capability expansion without PR-mapped evidence. Action: Confirm Concentrate accepts PDF (or other non-text) input on deepseek-v3-0324; if not, drop attachment and the modalities override so the lab text-only surface is inherited.
  • [low] [possible mistake] providers/concentrate/models/grok-4.5.toml:10 - Check: Published cost should match the billed cheapest/serving route. Why: Input/output (2/6) and the 200k tier (4/12) match xAI/OpenRouter, but cache_read is 0.5 (tier 1) versus first-party/peer 0.3 (tier 0.6). That split is suspicious if the same route set is used. Action: Verify Concentrate’s cache-read price for grok-4.5 (and the tier) from the detail/pricing payload and correct or cite the route that bills these cache rates.
  • [low] [possible mistake] providers/concentrate/provider.toml:5 - Check: Material catalog data should cite direct provider pricing/docs/API evidence in the PR. Why: New provider costs, modality deltas, and per-model reasoning sets cannot be reviewed from the PR body alone (it describes sync policy but does not map sources to these eight models’ prices/controls). Action: Add PR citations (and/or leading TOML comments) for pricing and reasoning surfaces, stating which claim each source supports.

@AjayK47
AjayK47 force-pushed the concentrate-provider branch from cf5ab7d to 1604c3b Compare August 19, 2026 12:20
@github-actions

Copy link
Copy Markdown
Contributor

Checking a few remaining peer cost values for consistency.One clear reasoning-options mismatch remains against lab and peer baselines.## Action items

  • [medium] [possible mistake] providers/concentrate/models/grok-4.5.toml:858 - Check: Relay reasoning_options must match the lab/same-surface peer baseline for the model, with extra effort levels only when this host documents them or they show a live, meaningful effect. Why: First-party xAI and established relays (OpenRouter, Vercel, Kilo, CrossModel, etc.) publish Grok 4.5 as low / medium / high only; xhigh is the Grok 4.6 surface. This file adds xhigh with a route-metadata note but no live probe (unlike claude-sonnet-5), so clients may be offered a level the gateway only normalizes. Action: Confirm reasoning_effort=xhigh is honored with a distinct effect on Concentrate for this ID (and cite that), or drop xhigh to match lab/peers ["low", "medium", "high"].

@AjayK47
AjayK47 force-pushed the concentrate-provider branch from 1604c3b to 53c615a Compare August 19, 2026 12:45
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/concentrate/provider.toml:1 - Check: New provider.toml must include required doc. Why: Schema requires a non-empty doc URL for every provider; this file only sets name, env, npm, and api, so generation/bun validate will reject the provider. Action: Add doc pointing at Concentrate’s public model/API docs (e.g. models list or chat-completions reference).
  • [medium] [violation] packages/core/src/sync/providers/concentrate.ts:360 - Check: Output limit must stay a finite positive number when capping against canonical metadata. Why: buildConcentrateModel always passes canonicalOutputLimit(baseModel), which returns undefined when the lab entry has no numeric limit.output. That disables the default parameter and makes Math.min(max_tokens, undefined)NaN, so sync can write an invalid limit.output. Action: Only apply the canonical ceiling when it is a number (e.g. outputLimit === undefined ? model.summary.max_tokens : Math.min(...)), and cover the undefined path in the unit tests.

@AjayK47

AjayK47 commented Aug 19, 2026

Copy link
Copy Markdown
Author

Both of these look like false positives:

  • provider.toml already sets doc = "https://concentrate.ai/docs", and bun validate passes on this branch.
  • The NaN case cannot happen — canonicalOutputLimit returning undefined triggers the default parameter, so Math.min gets max_tokens rather than undefined. Checked both paths: undefined ceiling gives limit.output = 64000, a 32000 ceiling caps to 32000.

No changes for those two. Earlier findings are addressed: claude-sonnet-5 now publishes the none off switch, grok-4.5 is back to low/medium/high, and source links were added per model.

@AjayK47
AjayK47 marked this pull request as draft August 19, 2026 12:56
@AjayK47
AjayK47 marked this pull request as ready for review August 19, 2026 12:56
@github-actions

Copy link
Copy Markdown
Contributor

Checking the logo content more carefully and whether initial model files omit sync-derived limits that should be present.

Register Concentrate as an OpenAI-compatible aggregator with an initial set
of eight models. The remaining catalog follows in separate batches so each
change stays small enough to review.

The sync joins the public model list with each model's detail endpoint and
derives pricing, limits, modalities, tool calling, structured output and
attachment support from that data. Capabilities and limits come from the
aggregate list/detail payloads rather than a single upstream route, so a
capability-thin route cannot narrow what the gateway accepts, and output
limits are capped by canonical models.dev metadata.

Three rules encode the gateway's serving reality rather than its catalog:

- Pricing defaults to the cheapest advertised route, but IDs whose live
  traffic is relayed elsewhere are pinned to the observed serving route, so
  published cost matches what callers are charged.
- The gateway-level capability is authoritative for structured output. A
  route can advertise json_schema while the relay in front of it does not
  expose the feature.
- Context pricing tiers at or above a model's own window are dropped,
  because such a band can never be entered.

Reasoning controls are authored per model from the host's declared route
metadata rather than inferred from the gateway's normalization enum, which
silently accepts unsupported effort values. Every published effort value is
backed by a route that declares it, and narrower or empty sets carry a
leading comment with the API evidence. New remote models are reported
instead of created automatically so each one gets that review first.
@AjayK47
AjayK47 force-pushed the concentrate-provider branch from 53c615a to c605979 Compare August 19, 2026 13:51
@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

@github-actions github-actions Bot added the reviewer: ready Automated review found no actionable items label Aug 19, 2026
@AjayK47
AjayK47 marked this pull request as draft August 19, 2026 15:21
fill="currentColor" was resolving to black in most contexts since
nothing in this SVG's usage sets a text color to inherit. Concentrate's
actual mark uses white dots; switched to an explicit fill="#ffffff"
while keeping the background transparent, matching every other
provider's backgroundless-icon convention on this site.
@AjayK47
AjayK47 marked this pull request as ready for review August 20, 2026 13:53
@github-actions github-actions Bot removed the reviewer: ready Automated review found no actionable items label Aug 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [critical] [violation] providers/concentrate/logo.svg:1 - Check: New provider logos must use currentColor with no hardcoded colors. Why: The second commit sets fill="#ffffff", which breaks the logo requirement and will not theme correctly (and can disappear on light backgrounds). Action: Restore fill="currentColor" (or equivalent path fills) with no fixed colors/size attributes; keep a square viewBox.

The repo's automated PR check flagged the previous commit: provider
logos must use currentColor with no hardcoded colors, since a fixed
fill breaks theming and can disappear on light backgrounds. Reverting
to currentColor - this is the site's own enforced convention, not just
an inferred one, so the earlier white-dots-with-transparent-bg attempt
was wrong regardless of what the underlying brand mark looks like.
@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

@github-actions github-actions Bot added the reviewer: ready Automated review found no actionable items label Aug 20, 2026
@@ -0,0 +1,5 @@
name = "Concentrate"
env = ["CONCENTRATE_API_KEY"]
npm = "@ai-sdk/openai-compatible"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I dont see interleaved being set anywhere, normally it'd be reasoning_content

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch ! it's optional so nothing flagged it missing. Fixed for all 7, plus added a test so a future sync can't silently drop it again.

rekram1-node flagged that none of the reasoning models had this set.
Concentrate's own API docs (checked the live OpenAPI spec) show the
message object returns both `reasoning` and `reasoning_content`, with
reasoning_content documented as 'included for compatibility - reasoning
will be returned rather than reasoning_content'. So Concentrate's real
field is `reasoning`, which isn't a valid enum value for interleaved.field
(only reasoning_content/reasoning_details are).

Checked @ai-sdk/openai-compatible's actual source to make sure
reasoning_content is still the right call: it already hardcodes
`message.reasoning_content ?? message.reasoning` (and the streaming
equivalent) unconditionally, so it picks up Concentrate's `reasoning`
field via that fallback regardless of what's set here. reasoning_content
is correct - deepseek-v3-0324 correctly left unset since it has no
reasoning_options.
@github-actions github-actions Bot removed the reviewer: ready Automated review found no actionable items label Aug 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] packages/core/src/sync/providers/concentrate.ts:407 - Check: Sync must preserve hand-authored provider-only fields the API does not own (interleaved, and peers also keep status / provider / experimental). Why: buildConcentrateModel passes reasoning_options through existing but never interleaved. Seven reasoning models set [interleaved] field = "reasoning_content"; the next bun models:sync concentrate will drop those blocks because other aggregator modules (e.g. OpenRouter) explicitly re-emit interleaved: existing?.interleaved and Concentrate does not. Action: Include interleaved: existing?.interleaved (and the same pattern for any other hand-authored provider-only keys you intend to keep) in the factorBaseModel overrides, and cover it in packages/core/test/concentrate.test.ts.

@AjayK47
AjayK47 marked this pull request as draft August 20, 2026 15:18
The bot flagged that buildConcentrateModel passes reasoning_options
through from the existing TOML but never did the same for interleaved,
so the next bun models:sync concentrate would silently wipe the
[interleaved] blocks just added to the 7 reasoning models. Same
pattern other aggregators (e.g. OpenRouter) already use for
provider-only fields the API doesn't report.

Added interleaved: existing?.interleaved next to reasoning_options in
the factorBaseModel overrides, plus a positive/negative test pair in
concentrate.test.ts mirroring the existing reasoning_options tests.
Verified the new positive test actually catches the regression: reverted
the source line, confirmed it goes red, restored it, confirmed green.
Full package suite: 188 pass, 2 pre-existing failures (DeepInfra-related,
confirmed present on the unmodified branch too, unrelated to this).
@AjayK47
AjayK47 marked this pull request as ready for review August 20, 2026 15:30
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [medium] [possible mistake] providers/concentrate/models/claude-opus-4-5.toml:18 - Check: interleaved must describe this host’s actual reasoning side channel (true, or field = reasoning_content / reasoning_details). Why: Commit 4 states Concentrate’s OpenAPI returns reasoning on reasoning, and that reasoning_content is only a compatibility alias that is not the field that carries content. Publishing field = "reasoning_content" on all seven reasoners therefore mislabels the wire key for catalog consumers that do not apply the AI SDK’s reasoning_content ?? reasoning fallback. Action: Switch those blocks to interleaved = true (general support when the key is not one of the two enum values), or keep a named field only after confirming the populated response key is actually reasoning_content / reasoning_details and documenting that in the leading comment.

…thored fields

Two things from review:

1. interleaved was set to { field = "reasoning_content" } on all 7
   reasoning models, but our own prior commit documented that Concentrate's
   API actually returns reasoning on the `reasoning" key, not
   `reasoning_content` (which is compatibility-only and never populated).
   That mislabels the wire key for any catalog consumer that doesn't apply
   the AI SDK's reasoning_content ?? reasoning fallback. Switched to bare
   interleaved = true, the correct declaration when a model has a real
   reasoning side channel that isn't one of the two named enum options.
   Also moved it to match the generator's canonical position (before
   [[reasoning_options]]) instead of appended at the end of the file.

2. buildConcentrateModel only preserved reasoning_options across syncs, not
   status/provider/experimental - other ModelBase fields the API doesn't
   own either. openrouter.ts and nano-gpt.ts already preserve all of these
   for the same reason: a curator hand-setting one (e.g. marking a model
   deprecated) would otherwise get silently wiped on the next sync. None of
   our 8 models currently use these three, so this is preventive, not
   fixing an active loss - closing the same gap class before it recurs.

Test changes: updated the interleaved test to assert true instead of the
old field-object shape, added a positive/negative pair for
status/provider/experimental mirroring the existing pattern. Verified
both new tests actually catch the regression (reverted the source lines,
confirmed red, restored, confirmed green) rather than just asserting
they pass. Also ran bun run validate (the real zod schema, not just TOML
parsing) - exit 0, and inspected the validated o3 output directly to
confirm interleaved: true survives validation. Full suite: 190 pass, 2
pre-existing DeepInfra failures unrelated to this and confirmed present
on the unmodified branch.
@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

@github-actions github-actions Bot added the reviewer: ready Automated review found no actionable items label Aug 20, 2026
@AjayK47
AjayK47 marked this pull request as draft August 20, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewer: ready Automated review found no actionable items

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants