Repository navigation
Add promotion-time settings flags to model deployment promote - #176
mingminglang-baseten wants to merge 28 commits into
Conversation
…listing
The usage command listed your teams and your Code settings in each with
GET /v1/routes/settings/users/me/teams, which is being removed. Use
GET /v1/teams for your teams and GET /v1/routes/settings/teams/{team}/users/me
for your settings in each, which say the same things. Org admins are
members of every team, so they still see every team.
Claude-Session: https://claude.ai/code/session_01UkWMh7GwDgbmR88spBWMEm
Pins baseten-go to the client regenerated for the renamed Grid API, so every call site moves to the GetGrid*/PostGrid*/PatchGrid*/DeleteGrid* methods. grid usage now reads your settings from GET /v1/grid/team_settings/users/me and passes --team straight through as team_id: the server uses your only team, or asks for --team when you belong to several. The client-side team listing and name matching are gone, along with the "No usage this month" branch they fed. Claude-Session: https://claude.ai/code/session_01UkWMh7GwDgbmR88spBWMEm
Preserve the source PR's all-team usage and team name/ID filtering while using the current Grid API and Grid-named files. Resolve the usage implementation and test conflicts without restoring legacy command files.
* adding functionality to cli * Update go.sum * adding functionality to cli
`grid usage` listed your teams and fetched your settings in each to draw your spend against your limit, the one place the CLI still stitched teams together client-side. Per the review on this PR, usage is one command: `grid route usage [--team] [--user-id]`, whose arguments behave as the API does. Without --team, usage spans the teams you can see; without --user-id, members see their own usage and admins see everyone's. Your spend against your limit in a team is `grid user-settings describe`. Claude-Session: https://claude.ai/code/session_01UkWMh7GwDgbmR88spBWMEm
The list spans every team you can see unless --team narrows it, so two rows can share a name. A TEAM column, as the connection list already has, tells them apart. Claude-Session: https://claude.ai/code/session_01UkWMh7GwDgbmR88spBWMEm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nges in the prompt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Schedule validation can bypass explicitly empty input and nested misspellings, permitting promotion without intended settings changes.
2 open issues
What changed in this PR
Extends deployment promotion to update environment settings and apply one-time promotion overrides, reusing existing settings mappings.
Changes:
- Adds grouped flags, help examples, and settings-aware confirmation.
- Builds optional settings payloads and adds validation tests.
- Updates the Go SDK and adapts promotion settings types.
| File | Description |
|---|---|
| internal/cmd/command.model_environment.go | Adapts SDK types and shared mappings. |
| internal/cmd/command.model_deployment.go | Builds promotion payloads and validates schedule JSON. |
| internal/cmd/command.model_deployment_test.go | Tests settings payloads and rejected inputs. |
| go.sum | Updates SDK checksums. |
| go.mod | Updates the SDK dependency. |
| cmd/command.model.go | Defines reusable settings flag groups. |
| cmd/command.model_environment.go | Embeds shared promotion flags. |
| cmd/command.model_deployment.go | Adds promotion flags, help, and examples. |
Review effort: Balanced
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cretz
left a comment
There was a problem hiding this comment.
Looks great, only minor things (most non-blocking)
| PreserveEnvInstanceType bool `flag:"preserve-env-instance-type" desc:"Keep the target environment's current instance type instead of applying the promoted deployment's."` | ||
|
|
||
| Region OptionalFlag[string] `flag:"region" desc:"Region slug to set on the environment. Pass an empty string for Global. Run 'baseten org regions' to see the slugs available."` | ||
| InstanceTypeID OptionalFlag[string] `flag:"instance-type-id" desc:"Instance type to set on the environment. Cannot be combined with --preserve-env-instance-type."` |
There was a problem hiding this comment.
This is rough on users, we don't expose instance type IDs and we don't expect users to have to provide IDs. When you create a model for example, you provide the instance type name (I know we had discussed this internally during API review, though I forget where we landed). I wonder if the API can't change, if we should accept --instance-type here and go look up the ID (unsure if that replaces or is in addition to this).
There was a problem hiding this comment.
This seems to be more of a naming issue I think
When you create a model for example, you provide the instance type name
What user provides in truss is what the REST API calls id (e.g. "A10Gx4x16" in truss https://docs.baseten.co/reference/truss-configuration#resources). The name in REST looks like "L4:4x16 - 1 L4 GPU, 24 GiB video memory, 4 vCPU, 16 GiB" (I don't think users would want to pass this). In addition, instance_type in REST is the full struct including id, name and some other fields.
I can update this to --instance-type to align with truss convention. For reference, is it ok to use docs since we don't have a baseten model instance-types command yet?
CPU: https://docs.baseten.co/deployment/resources#cpu-only-instances
GPU: https://docs.baseten.co/deployment/resources#gpu-instances
There was a problem hiding this comment.
Oh interesting, yes, I think we should update the flag name to --instance-type. Yes, we can just point to docs (though would totally support baseten model instance-types in a followup).
| // --autoscaling-* prefix, for commands that set more than autoscaling. Its | ||
| // fields mirror [AutoscalingSettingsFlags] so one converts to the other. | ||
| type PrefixedAutoscalingSettingsFlags struct { | ||
| MinReplica OptionalFlag[int] `flag:"autoscaling-min-replica" desc:"Minimum number of replicas." group:"autoscaling" group-pri:"200"` |
There was a problem hiding this comment.
Not a requirement, but IMO the field name matching the flag name is ideal (even if it is an annoying prefix everywhere, but out users suffer that too)
There was a problem hiding this comment.
Yeah I'll keep the field name and flag name aligned. On the naming, I'm thinking maybe we should remove the prefix as we discussed in the other thread on push-time settings.
Arguments for prefixing:
- Precedence of prefixing (admittedly this is an example prefixing makes lots of sense): https://github.com/basetenlabs/baseten-cli/blob/main/cmd/command.volume_sync.go#L152-L158
- We don't need to worry about colliding field names under different parent fields
- Structurally analogous to how we handle request backpressure policy in the existing environment update command, as
--autoscaling-min-replicais similar to--request-backpressure-policy;--min-replicais similar to--policy(the latter sounds a bit too general?)
baseten model environment update-autoscaling ... --min-replica 2
baseten model environment update-request-backpressure ... --policy reject-on-full
(That said, if the same logic is applied to promotion setting, --promotion-rolling-deploy or --override-promotion-rolling-deploy seems verbose, so maybe we can treat --request-backpressure-policy as a special case.)
Arguments for not prefixing:
- Simplicity
- Users might be used to
--min-replicaetc flag that already exists for update
There was a problem hiding this comment.
I concur with removing the prefix, and we won't have it on model push either looking at #180
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cretz
left a comment
There was a problem hiding this comment.
LGTM, I do concur with making the flag name --instance-type and removing the --autoscaling- prefix on promote flags
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

🚀 What
baseten model deployment promotecan change the target environment's settings as part of the promotion (region, instance type, request backpressure, autoscaling, and autoscaling schedules as raw API JSON), and override promotion settings for that promotion only (--override-*). Autoscaling and override flags get their own help sections, and the confirmation prompt names the settings that will change. A promote without the new flags sends the same body as before.💻 How
environment_settings_updateandpromotion_settings_override, sending each group only when one of its flags is passed.update-autoscalingshows that heading too.🔬 Testing
New promote tests for each settings group and for rejected input:
--instance-typewith--preserve-env-instance-type, and empty or trailing schedule JSON (the server rejects unknown keys itself).go mod tidy,go fmt,go vetand themodeltests pass.🤖 Generated with Claude Code