Skip to content

cortexkit-provider-usage 0.2.0: add optional apiProvider field#6

Merged
ualtinok merged 1 commit into
masterfrom
qta/api-provider-field
Jul 20, 2026
Merged

cortexkit-provider-usage 0.2.0: add optional apiProvider field#6
ualtinok merged 1 commit into
masterfrom
qta/api-provider-field

Conversation

@ualtinok

@ualtinok ualtinok commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Adds ProviderUsage.api_provider (wire apiProvider, camelCase, omitted when absent) — the canonical models.dev provider slug alongside the CodexBar provider name.

Why: three consumers (ALF's router reads, the ck CLI renderer, astrocyte's capacity axis) each hand-roll the same CodexBar-name→canonical translation (claude→anthropic, codex→openai, gemini→google, grok→xai). This field gives them one canonical name to key on, killing the per-consumer maps and their drift risk. astrocyte's capacity↔spend join specifically needs the canonical name to match broca's model-catalog-keyed spend facts.

Contract: populated when the producer knows the canonical name; absent for providers with no models.dev counterpart (antigravity, cursor, factory, etc.), where consumers fall back to provider.

Compatibility: additive + skip-if-none — entries without it serialize byte-identically to 0.1.0. Version bumped 0.1.0→0.2.0 (struct gains a field). The quota module populates it centrally in its read path; ALF/ck consume it when present. Publish is tag-driven per release.yml (cortexkit-provider-usage-v0.2.0) once merged.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Add optional apiProvider to ProviderUsage to expose the canonical models.dev provider slug alongside provider.

  • New Features
    • Added optional apiProvider to ProviderUsage (serialized as camelCase, omitted when not set).
    • Carries the canonical models.dev slug (e.g., codex→openai, claude→anthropic); producers set when known, consumers fall back to provider otherwise.
    • Removes per-consumer provider maps in ALF router, ck CLI, and astrocyte capacity axis.
    • Bumped cortexkit-provider-usage to 0.2.0; change is additive and backward compatible.

Written for commit 2f1d4cd. Summary will update on new commits.

Review in cubic

Adds ProviderUsage.api_provider (wire: apiProvider, camelCase, omitted when
absent) carrying the canonical models.dev provider slug alongside the CodexBar
provider name — e.g. "openai" for provider=="codex", "anthropic" for "claude",
"google" for "gemini", "xai" for "grok". Three consumers (ALF's router, the ck
CLI, astrocyte's capacity axis) each hand-roll the same CodexBar→canonical
translation today; this field lets them key on one canonical name instead.
Producers populate it when the canonical name is known and leave it absent for
providers with no models.dev counterpart (consumers fall back to provider).
Additive + skip-if-none: unpopulated entries serialize byte-identically to 0.1.
@ualtinok
ualtinok merged commit 55b1400 into master Jul 20, 2026
7 checks passed
@ualtinok
ualtinok deleted the qta/api-provider-field branch July 20, 2026 07:07
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.

1 participant