Skip to content

feat: add provider-scoped config with anthropic_betas - #2105

Merged
gowthamvadisetti merged 4 commits into
mainfrom
gateway-2867-provider-config
Aug 10, 2026
Merged

feat: add provider-scoped config with anthropic_betas#2105
gowthamvadisetti merged 4 commits into
mainfrom
gateway-2867-provider-config

Conversation

@gowthamvadisetti

@gowthamvadisetti gowthamvadisetti commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Context

Provider-level quirks that aren't per-model were hardcoded in the LLM gateway — the anthropic-beta translation table. Changing an allowlist meant a gateway code change, review, build and deploy.

This moves that table here, published as a new artifact provider-configs.json next to ai-models.json, so a beta mapping change is a YAML PR.

The map is keyed by provider + API flavor (invoke vs converse differ — tool search is InvokeModel-only), not per-model, so it can't ride inside ai-models.json rows.

Changes

New providers/{aws-bedrock,aws-bedrock-mantle,google-vertex}/provider-config.yamlanthropic_betas columns, ported verbatim from the gateway. aws-bedrock has invoke/converse; the others use a single default. Providers that forward betas untouched today (anthropic, azure-open-ai) deliberately get no file.

Schema #BetaColumn + #ProviderConfig in model.cue, all fields optional so future provider-scoped fields (allowed tools, etc.) slot in. Types regenerated via npm run generate:types.

Builder build-provider-configs.tsdist/provider-configs.json, an object keyed by provider directory name. Providers without a config are absent, never {} — an empty object means "drop every beta" downstream.

Four exclusion carve-outsprovider-config.yaml lives under providers/, so everything walking that tree needed the same treatment default.yaml already gets: the JSON builder, the readme counter, validate.sh (validates it as #ProviderConfig), and trigger_changed_model_tests.py. A shared NON_MODEL_YAML set replaces scattered string comparisons.

Publish trigger-sync.yml builds and uploads it to the existing llm-gateway/v2/{devtest,prod}/ prefixes.

Verification

  • lint:yaml clean, validate.sh: 3252 passed / 0 failed, tsc --noEmit clean
  • Model count unchanged: 2594 → 2594 (the new file is correctly excluded)
  • Equivalence check: PASS — all 4 generated columns are byte-identical to the table they replace, keys and values including every null (invoke 15 tokens/0 null, converse 16/2, mantle 15/0, vertex 11/1). Verified independently, and mutation-tested (flipping one null makes the checker report FAIL, so the pass isn't vacuous).
  • CUE schema negative-tested: rejects unknown fields and non-string/non-null beta values

Rollout

Consumed by servicefoundry-server → tfy-k8s-controller → tfy-llm-gateway. This PR publishes data nobody reads yet, so it is safe to land first. The gateway change must land last, and only after the NATS KV keys are confirmed populated — it makes this file the sole source of the columns.

Note: npm run update:readme produces a large diff that predates this change (README counts are stale across ~15 providers). Left untouched; worth regenerating separately.

🤖 Generated with Claude Code


Note

Medium Risk
Changes gateway-facing beta header behavior once consumed; incorrect mappings or null drops could break Bedrock/Vertex requests, though this PR only publishes data and the gateway rollout is separate.

Overview
Moves anthropic-beta allowlist/translation tables out of the LLM gateway into provider-scoped provider-config.yaml files, built and published as provider-configs.json alongside ai-models.json.

Adds CUE/TS types (#ProviderConfig, #BetaColumn) and initial YAML for aws-bedrock (separate invoke / converse columns), aws-bedrock-mantle, and google-vertex (default), mapping client beta tokens to provider tokens or null to drop. Providers without a file are omitted from the JSON (not {}).

Introduces build-provider-configs.ts, npm run build:provider-configs, and S3 upload in trigger-sync.yml. Shared NON_MODEL_YAML excludes provider-config.yaml from the model JSON builder, README counts, CUE validation (#ProviderConfig), and changed-model test triggers.

Reviewed by Cursor Bugbot for commit 82bb83a. Bugbot is set up for automated code reviews on this repo. Configure here.

@gowthamvadisetti
gowthamvadisetti force-pushed the gateway-2867-provider-config branch from 95d6b15 to 2b99baa Compare August 10, 2026 14:52
Introduce provider-config.yaml, a provider-scoped (not per-model) config
file published as a new dist/provider-configs.json artifact alongside
ai-models.json.

The first field is anthropic_betas: per-flavor anthropic-beta translation
tables (clientToken -> providerToken, null to drop), ported verbatim from
the gateway's hardcoded table so the gateway can read them from provider
config instead of shipping a code change per beta.

- schema: #ProviderConfig / #BetaColumn in model.cue, all fields optional
- builder: build-provider-configs.ts emits an object keyed by provider dir;
  providers without the file are absent, never {} (empty means drop-all)
- exclude the new non-model yaml from the model walkers (build-unified-json,
  update-readme-counts, trigger_changed_model_tests) via a shared
  NON_MODEL_YAML set, and validate it against #ProviderConfig
- publish to s3 llm-gateway/v2/{devtest,prod}/ in trigger-sync

Model count is unchanged (2594).
@gowthamvadisetti
gowthamvadisetti force-pushed the gateway-2867-provider-config branch from d4763d6 to 2fa4211 Compare August 10, 2026 15:20
Comment thread .github/scripts/constants.ts
@LordGameleo

Copy link
Copy Markdown
Collaborator

Two gaps worth confirming:

  1. Bedrock Mantle is missing structured-outputs from its anthropic_betas translation map — Bedrock supports this, should it be included?
  2. Vertex is missing several beta translations without explanatory comments — intentional omissions or TODO?

@gowthamvadisetti
gowthamvadisetti merged commit d87cb0a into main Aug 10, 2026
8 checks passed
@gowthamvadisetti
gowthamvadisetti deleted the gateway-2867-provider-config branch August 10, 2026 18:33
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.

2 participants