Skip to content

feat: update helm charts for model limits scope update - #3984

Merged
akshaydeo merged 6 commits into
devfrom
06-02-feat_update_helm_charts_for_model_limits_scope_update
Jun 2, 2026
Merged

feat: update helm charts for model limits scope update#3984
akshaydeo merged 6 commits into
devfrom
06-02-feat_update_helm_charts_for_model_limits_scope_update

Conversation

@roroghost17

@roroghost17 roroghost17 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds scope and scope_id fields to governance.modelConfigs (Helm) / governance.model_configs (config.json), enabling model-level budgets and rate limits to be applied either globally across all traffic or scoped to a specific virtual key. Documentation is updated to reflect the new fields, rename the section to "Model Limits" for consistency with the UI, and provide richer examples covering global, provider-level, and VK-scoped configurations.

Changes

  • Added scope ("global" | "virtual_key", default "global") and scope_id (required when scope is "virtual_key") to modelConfigs[] items in values.yaml and values.schema.json.
  • Renamed the Helm docs section from "Model Configs" to "Model Limits" to match the Budget & Limits → Model Limits UI label.
  • Expanded the Helm and config.json documentation with a field reference table and multiple annotated examples (global model cap, provider-level budget, VK-scoped top-level budget, VK-scoped per-provider budget).
  • Added a 2.1.21 changelog entry to the Helm chart README describing the new fields.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

Verify the Helm schema accepts the new fields without validation errors:

helm lint helm-charts/bifrost
helm template bifrost helm-charts/bifrost --values helm-charts/bifrost/values.yaml

Confirm a modelConfigs entry with scope: "virtual_key" and a valid scope_id renders correctly in the generated manifests, and that an entry with scope: "global" (or no scope) also renders without errors.

Screenshots/Recordings

N/A

Breaking changes

  • Yes
  • No

Related issues

N/A

Security considerations

No new auth, secrets, or PII surface introduced. The scope_id field references an existing virtual key ID and does not expose any new sensitive data.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

Summary by CodeRabbit

  • Documentation
    • Updated governance documentation with a new Model Limits section detailing budget and rate-limit configuration per model.
    • Added scoping capabilities allowing limits to apply globally or to specific virtual keys.
    • Updated configuration examples and schema references with new fields.

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR documents governance model limits configuration with explicit scoping support. The schema, values examples, and deployment guides are updated to introduce and explain scope and scope_id fields, enabling model-level budgets and rate limits to apply either globally or to specific virtual keys.

Changes

Model Limits Configuration Documentation

Layer / File(s) Summary
Schema definition and configuration examples
helm-charts/bifrost/values.schema.json, helm-charts/bifrost/values.yaml, helm-charts/bifrost/README.md
JSON schema for bifrost.governance.modelConfigs now explicitly defines scope (enum: global or virtual_key, default global), scope_id (for virtual key targeting), and provider fields. Commented example and changelog entry document the new scoping pattern and validation rules.
Deployment guide documentation
docs/deployment-guides/config-json/governance.mdx, docs/deployment-guides/helm/governance.mdx
Governance documentation adds a "Model Limits" section for both JSON and Helm configurations, including field reference tables, JSON and YAML examples demonstrating global and virtual-key-scoped entries, and detailed explanation of scope behavior.

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • maximhq/bifrost#3938: The main PR's Helm/docs/schema updates for governance.modelConfigs scoping (scope/scope_id) directly align with the retrieved PR's provider-governance migration and logic that relies on governance_model_configs having a scope column and using scope='global' wildcard model-config rows.

Suggested reviewers

  • danpiths
  • akshaydeo

📚 A documentation hop, with models in scope,
Global or keyed, we help configs cope.
Limits now clear as the day shines so bright,
Schema and guides all aligned just right! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: updating Helm charts to support scope configuration for model limits.
Description check ✅ Passed The PR description is comprehensive, covering all major template sections with clear explanations of changes, affected areas, testing instructions, and security considerations.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 06-02-feat_update_helm_charts_for_model_limits_scope_update

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

@CLAassistant

CLAassistant commented Jun 2, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@roroghost17
roroghost17 marked this pull request as ready for review June 2, 2026 11:03
@roroghost17
roroghost17 requested a review from a team as a code owner June 2, 2026 11:03
@greptile-apps

greptile-apps Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Documentation and schema-only change; no Go, handler, or plugin logic is touched. Safe to merge.

All changes are confined to Helm chart schema annotations, commented-out values.yaml examples, doc pages, and a changelog entry. No runtime code paths are affected. The one new finding is a schema divergence that is a future maintenance concern rather than a current defect.

helm-charts/bifrost/values.schema.json — the scope enum diverges from the config.schema.json source of truth and would block future scope additions from linting cleanly.

Important Files Changed

Filename Overview
helm-charts/bifrost/values.schema.json Adds scope (with enum) and scope_id to modelConfigs items; missing budget_ids, no if/then for scope_id when scope=virtual_key, and enum on scope diverges from the config.schema.json source of truth which uses a plain string type.
helm-charts/bifrost/values.yaml Adds commented-out scope/scope_id fields to modelConfigs example; placeholder scope_id: "" could mislead users into leaving an empty string.
docs/deployment-guides/config-json/governance.mdx Adds Model Limits section with field table and examples; budget_id is used in examples without noting it is deprecated in favour of budget_ids.
docs/deployment-guides/helm/governance.mdx Renames section to "Model Limits", expands examples and adds field reference table; same budget_id/budget_ids gap as config-json docs.
helm-charts/bifrost/README.md Adds 2.1.21 changelog entry accurately describing the new scope/scope_id fields.

Reviews (3): Last reviewed commit: "feat: update helm charts for model limit..." | Re-trigger Greptile

Comment thread docs/deployment-guides/config-json/governance.mdx
@roroghost17
roroghost17 force-pushed the 06-02-docs_update_docs_for_user-level_model_limit branch from d3b61e6 to e03b8bc Compare June 2, 2026 11:57
@roroghost17
roroghost17 force-pushed the 06-02-feat_update_helm_charts_for_model_limits_scope_update branch from c72cf34 to 0b1135a Compare June 2, 2026 11:57

akshaydeo commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Merge activity

@roroghost17
roroghost17 force-pushed the 06-02-docs_update_docs_for_user-level_model_limit branch from e03b8bc to 85248a7 Compare June 2, 2026 13:37
@roroghost17
roroghost17 force-pushed the 06-02-feat_update_helm_charts_for_model_limits_scope_update branch from 0b1135a to 37e46d9 Compare June 2, 2026 13:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
helm-charts/bifrost/values.schema.json (1)

1369-1393: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Enforce scope_id when scope is virtual_key.

This schema only describes the requirement in text today; it does not validate it. A modelConfigs entry with scope: "virtual_key" and no scope_id will still pass schema validation, which undercuts the new Helm contract in this PR.

Suggested schema fix
               "scope_id": {
                 "type": "string",
                 "description": "Target entity ID — required when scope is \"virtual_key\""
               },
               "budget_id": {
                 "type": "string"
               },
               "rate_limit_id": {
                 "type": "string"
               }
             },
-            "required": ["id", "model_name"]
+            "required": ["id", "model_name"],
+            "allOf": [
+              {
+                "if": {
+                  "properties": {
+                    "scope": {
+                      "const": "virtual_key"
+                    }
+                  },
+                  "required": ["scope"]
+                },
+                "then": {
+                  "required": ["scope_id"]
+                }
+              }
+            ]
           }
         }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@helm-charts/bifrost/values.schema.json` around lines 1369 - 1393, The schema
currently documents but does not enforce that scope_id is required when scope ==
"virtual_key"; update the JSON Schema for the object (the modelConfigs entry
that defines "scope" and "scope_id") to add an if/then rule: use "if":
{"properties":{"scope":{"const":"virtual_key"}}} and "then":
{"required":["scope_id"]} (and optionally an "else" to ensure scope_id is not
required otherwise) so entries with scope set to "virtual_key" will fail
validation unless scope_id is present; modify the same schema block that
contains the "scope" and "scope_id" properties and the "required":
["id","model_name"] list to include this conditional.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@helm-charts/bifrost/README.md`:
- Around line 11-14: The README shows an out-of-date header: update the
displayed "Latest Version: 2.1.20" text to "Latest Version: 2.1.21" so it
matches the new changelog entry ("### 2.1.21"); locate the README header line
containing "Latest Version: 2.1.20" and replace the version string to 2.1.21
ensuring consistency with the new changelog entry.

---

Outside diff comments:
In `@helm-charts/bifrost/values.schema.json`:
- Around line 1369-1393: The schema currently documents but does not enforce
that scope_id is required when scope == "virtual_key"; update the JSON Schema
for the object (the modelConfigs entry that defines "scope" and "scope_id") to
add an if/then rule: use "if": {"properties":{"scope":{"const":"virtual_key"}}}
and "then": {"required":["scope_id"]} (and optionally an "else" to ensure
scope_id is not required otherwise) so entries with scope set to "virtual_key"
will fail validation unless scope_id is present; modify the same schema block
that contains the "scope" and "scope_id" properties and the "required":
["id","model_name"] list to include this conditional.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: df19fccf-4f56-467b-bd00-e670c48088e5

📥 Commits

Reviewing files that changed from the base of the PR and between 85248a7 and 37e46d9.

📒 Files selected for processing (5)
  • docs/deployment-guides/config-json/governance.mdx
  • docs/deployment-guides/helm/governance.mdx
  • helm-charts/bifrost/README.md
  • helm-charts/bifrost/values.schema.json
  • helm-charts/bifrost/values.yaml

Comment on lines +11 to +14
### 2.1.21

- Added `scope` and `scope_id` fields to `bifrost.governance.modelConfigs[]` items in `values.yaml` and `values.schema.json`. `scope` accepts `"global"` (default, applies to all traffic) or `"virtual_key"` (applies to a specific virtual key); `scope_id` is required when `scope` is `"virtual_key"` and must reference a virtual key `id`. The `_helpers.tpl` already passes `modelConfigs` through as-is so no template change was needed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update the README’s displayed latest version too.

This adds a 2.1.21 changelog entry, but the header still says Latest Version: 2.1.20, so the README becomes self-contradictory.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@helm-charts/bifrost/README.md` around lines 11 - 14, The README shows an
out-of-date header: update the displayed "Latest Version: 2.1.20" text to
"Latest Version: 2.1.21" so it matches the new changelog entry ("### 2.1.21");
locate the README header line containing "Latest Version: 2.1.20" and replace
the version string to 2.1.21 ensuring consistency with the new changelog entry.

@akshaydeo
akshaydeo changed the base branch from 06-02-docs_update_docs_for_user-level_model_limit to graphite-base/3984 June 2, 2026 14:12
@akshaydeo
akshaydeo changed the base branch from graphite-base/3984 to dev June 2, 2026 14:12
@akshaydeo
akshaydeo merged commit fa3a1e0 into dev Jun 2, 2026
10 of 11 checks passed
@akshaydeo
akshaydeo deleted the 06-02-feat_update_helm_charts_for_model_limits_scope_update branch June 2, 2026 14:13
akshaydeo pushed a commit that referenced this pull request Jun 2, 2026
## Summary

Adds `scope` and `scope_id` fields to `governance.modelConfigs` (Helm) / `governance.model_configs` (config.json), enabling model-level budgets and rate limits to be applied either globally across all traffic or scoped to a specific virtual key. Documentation is updated to reflect the new fields, rename the section to "Model Limits" for consistency with the UI, and provide richer examples covering global, provider-level, and VK-scoped configurations.

## Changes

- Added `scope` (`"global"` | `"virtual_key"`, default `"global"`) and `scope_id` (required when `scope` is `"virtual_key"`) to `modelConfigs[]` items in `values.yaml` and `values.schema.json`.
- Renamed the Helm docs section from "Model Configs" to "Model Limits" to match the **Budget & Limits → Model Limits** UI label.
- Expanded the Helm and config.json documentation with a field reference table and multiple annotated examples (global model cap, provider-level budget, VK-scoped top-level budget, VK-scoped per-provider budget).
- Added a `2.1.21` changelog entry to the Helm chart README describing the new fields.

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [x] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [x] Docs

## How to test

Verify the Helm schema accepts the new fields without validation errors:

```sh
helm lint helm-charts/bifrost
helm template bifrost helm-charts/bifrost --values helm-charts/bifrost/values.yaml
```

Confirm a `modelConfigs` entry with `scope: "virtual_key"` and a valid `scope_id` renders correctly in the generated manifests, and that an entry with `scope: "global"` (or no `scope`) also renders without errors.

## Screenshots/Recordings

N/A

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

N/A

## Security considerations

No new auth, secrets, or PII surface introduced. The `scope_id` field references an existing virtual key ID and does not expose any new sensitive data.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

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

## Summary by CodeRabbit

* **Documentation**
  * Updated governance documentation with a new Model Limits section detailing budget and rate-limit configuration per model.
  * Added scoping capabilities allowing limits to apply globally or to specific virtual keys.
  * Updated configuration examples and schema references with new fields.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@coderabbitai coderabbitai Bot mentioned this pull request Jun 2, 2026
18 tasks
akshaydeo pushed a commit that referenced this pull request Jun 4, 2026
Adds `scope` and `scope_id` fields to `governance.modelConfigs` (Helm) / `governance.model_configs` (config.json), enabling model-level budgets and rate limits to be applied either globally across all traffic or scoped to a specific virtual key. Documentation is updated to reflect the new fields, rename the section to "Model Limits" for consistency with the UI, and provide richer examples covering global, provider-level, and VK-scoped configurations.

- Added `scope` (`"global"` | `"virtual_key"`, default `"global"`) and `scope_id` (required when `scope` is `"virtual_key"`) to `modelConfigs[]` items in `values.yaml` and `values.schema.json`.
- Renamed the Helm docs section from "Model Configs" to "Model Limits" to match the **Budget & Limits → Model Limits** UI label.
- Expanded the Helm and config.json documentation with a field reference table and multiple annotated examples (global model cap, provider-level budget, VK-scoped top-level budget, VK-scoped per-provider budget).
- Added a `2.1.21` changelog entry to the Helm chart README describing the new fields.

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [x] Documentation
- [ ] Chore/CI

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [x] Docs

Verify the Helm schema accepts the new fields without validation errors:

```sh
helm lint helm-charts/bifrost
helm template bifrost helm-charts/bifrost --values helm-charts/bifrost/values.yaml
```

Confirm a `modelConfigs` entry with `scope: "virtual_key"` and a valid `scope_id` renders correctly in the generated manifests, and that an entry with `scope: "global"` (or no `scope`) also renders without errors.

N/A

- [ ] Yes
- [x] No

N/A

No new auth, secrets, or PII surface introduced. The `scope_id` field references an existing virtual key ID and does not expose any new sensitive data.

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

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

* **Documentation**
  * Updated governance documentation with a new Model Limits section detailing budget and rate-limit configuration per model.
  * Added scoping capabilities allowing limits to apply globally or to specific virtual keys.
  * Updated configuration examples and schema references with new fields.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
akshaydeo pushed a commit that referenced this pull request Jun 7, 2026
Adds `scope` and `scope_id` fields to `governance.modelConfigs` (Helm) / `governance.model_configs` (config.json), enabling model-level budgets and rate limits to be applied either globally across all traffic or scoped to a specific virtual key. Documentation is updated to reflect the new fields, rename the section to "Model Limits" for consistency with the UI, and provide richer examples covering global, provider-level, and VK-scoped configurations.

- Added `scope` (`"global"` | `"virtual_key"`, default `"global"`) and `scope_id` (required when `scope` is `"virtual_key"`) to `modelConfigs[]` items in `values.yaml` and `values.schema.json`.
- Renamed the Helm docs section from "Model Configs" to "Model Limits" to match the **Budget & Limits → Model Limits** UI label.
- Expanded the Helm and config.json documentation with a field reference table and multiple annotated examples (global model cap, provider-level budget, VK-scoped top-level budget, VK-scoped per-provider budget).
- Added a `2.1.21` changelog entry to the Helm chart README describing the new fields.

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [x] Documentation
- [ ] Chore/CI

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [x] Docs

Verify the Helm schema accepts the new fields without validation errors:

```sh
helm lint helm-charts/bifrost
helm template bifrost helm-charts/bifrost --values helm-charts/bifrost/values.yaml
```

Confirm a `modelConfigs` entry with `scope: "virtual_key"` and a valid `scope_id` renders correctly in the generated manifests, and that an entry with `scope: "global"` (or no `scope`) also renders without errors.

N/A

- [ ] Yes
- [x] No

N/A

No new auth, secrets, or PII surface introduced. The `scope_id` field references an existing virtual key ID and does not expose any new sensitive data.

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

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

* **Documentation**
  * Updated governance documentation with a new Model Limits section detailing budget and rate-limit configuration per model.
  * Added scoping capabilities allowing limits to apply globally or to specific virtual keys.
  * Updated configuration examples and schema references with new fields.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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