feat: add provider-scoped config with anthropic_betas - #2105
Merged
Conversation
gowthamvadisetti
force-pushed
the
gateway-2867-provider-config
branch
from
August 10, 2026 14:52
95d6b15 to
2b99baa
Compare
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
force-pushed
the
gateway-2867-provider-config
branch
from
August 10, 2026 15:20
d4763d6 to
2fa4211
Compare
LordGameleo
reviewed
Aug 10, 2026
LordGameleo
approved these changes
Aug 10, 2026
Collaborator
|
Two gaps worth confirming:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Provider-level quirks that aren't per-model were hardcoded in the LLM gateway — the
anthropic-betatranslation 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.jsonnext toai-models.json, so a beta mapping change is a YAML PR.The map is keyed by provider + API flavor (
invokevsconversediffer — tool search is InvokeModel-only), not per-model, so it can't ride insideai-models.jsonrows.Changes
New
providers/{aws-bedrock,aws-bedrock-mantle,google-vertex}/provider-config.yaml—anthropic_betascolumns, ported verbatim from the gateway.aws-bedrockhasinvoke/converse; the others use a singledefault. Providers that forward betas untouched today (anthropic, azure-open-ai) deliberately get no file.Schema
#BetaColumn+#ProviderConfiginmodel.cue, all fields optional so future provider-scoped fields (allowed tools, etc.) slot in. Types regenerated vianpm run generate:types.Builder
build-provider-configs.ts→dist/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-outs —
provider-config.yamllives underproviders/, so everything walking that tree needed the same treatmentdefault.yamlalready gets: the JSON builder, the readme counter,validate.sh(validates it as#ProviderConfig), andtrigger_changed_model_tests.py. A sharedNON_MODEL_YAMLset replaces scattered string comparisons.Publish
trigger-sync.ymlbuilds and uploads it to the existingllm-gateway/v2/{devtest,prod}/prefixes.Verification
lint:yamlclean,validate.sh: 3252 passed / 0 failed,tsc --noEmitcleannull(invoke 15 tokens/0 null, converse 16/2, mantle 15/0, vertex 11/1). Verified independently, and mutation-tested (flipping onenullmakes the checker report FAIL, so the pass isn't vacuous).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:readmeproduces 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
nulldrops 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.yamlfiles, built and published asprovider-configs.jsonalongsideai-models.json.Adds CUE/TS types (
#ProviderConfig,#BetaColumn) and initial YAML for aws-bedrock (separateinvoke/conversecolumns), aws-bedrock-mantle, and google-vertex (default), mapping client beta tokens to provider tokens ornullto drop. Providers without a file are omitted from the JSON (not{}).Introduces
build-provider-configs.ts,npm run build:provider-configs, and S3 upload intrigger-sync.yml. SharedNON_MODEL_YAMLexcludesprovider-config.yamlfrom 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.