Skip to content

feat(schema): requires.inputs, chart values a variant leaves to the deploy - #103

Merged
aceforeverd merged 7 commits into
masterfrom
feat-variant-inputs
Nov 10, 2026
Merged

aceforeverd merged 7 commits into
masterfrom
feat-variant-inputs

Conversation

@aceforeverd

@aceforeverd aceforeverd commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

A generic inputs fields to declare what's missing in this model variant but required at deploy time. This is the part of modelsphere/modelsphere#57

Both requires and inputs are cluster-specific values, but slightly different on how they works:

  • .requires: high-level abstraction, helm chart non-aware, swiss fill the gap
  • .inputs: much low level, no abstraction, helm chart aware, swiss just fill

Adds inputs to the variant schema, beside requires: chart values every deploy must answer, such as a Mooncake master address. Each input has a key (the chart value's dotted key, as helm --set takes it), a title, type, pattern, example and an optional default.

They're separate from requires because swiss treats them differently. A require is an abstraction swiss interprets and checks against the cluster. An input names one chart value by its key, and swiss only relays its answer.

Swiss puts the answer in the derived layer: the site profile's inputs, else the input's default. The deployer's override goes over it. Every input is required, so swiss refuses a plan that ends without a valid answer for one.

requires:
  gpus: 8
inputs:
  - key: storageKVOffload.mooncake.device
    title: Storage HCAs
    example: mlx5_0
    default: mlx5_3,mlx5_4   # the cluster this variant was tuned on
  • Schema: inputs sits at the variant's top level, in v1 version files and v2 variant files alike. The v2 index doesn't carry it, since nothing lists or picks a variant by inputs.
  • validate:schema:
    • each key is declared once, and values sets nothing at an input's key or under it;
    • the pattern must compile and is only allowed on a string input;
    • the example and the default must match the type and pattern;
    • model.localPath can never be an input.
  • validate:helm: renders each input with its default, else its example.

No rule yet keeps an input off a key swiss derives from requires. The schema can add one later.

No variant uses inputs yet. Converting the Mooncake variants waits until modelsphere/swiss#54 and modelsphere/console#125 are deployed, because an older swissd refuses the unknown key.

…eploy

A variant declares the chart values it needs and cannot know (a Mooncake
master address, say) as requires.inputs: path, title, type, pattern and an
example. values must leave each input unset; validate:helm renders with the
example. swiss answers them from the site profile's features.inputs, and the
deployer can override any of them.

docs/requires-design.md has the design and the rollout order: swiss and the
console ship first, since an older swissd refuses the unknown key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011bWVCSybBZ1QmsL9gjrqxW
aceforeverd and others added 6 commits November 10, 2026 10:44
A value values gives an input's path is now its default, checked against the
input's type and pattern, rather than refused. "" or null is no default, and
such an input stays required. validate:helm renders the example only where
there is no default. So a variant can declare an input over the value of the
cluster it was tuned on, without dropping it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011bWVCSybBZ1QmsL9gjrqxW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011bWVCSybBZ1QmsL9gjrqxW
…nswer

"" and null are no longer read as "no default": a value values gives an
input's path is its default and must be a valid answer, so a blank placeholder
fails the input's type or pattern. Without a default, the site or the deploy
answers it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011bWVCSybBZ1QmsL9gjrqxW
requires.inputs[].default is the answer swiss selects when the site profile
gives none, and puts in the derived layer with the site's answers. It must be
of the input's type and match its pattern. values again leaves every input's
path alone: the answer lives in the derived layer, so a value there would be
dead. validate:helm renders each input with its default, else its example.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011bWVCSybBZ1QmsL9gjrqxW
A require is an abstraction swiss interprets and checks against the cluster;
an input names one chart path and swiss only relays its answer. So inputs
moves to the variant's top level, in v1 and v2 alike. The v2 index no longer
carries them, since nothing lists or picks a variant by them, and the catalog
web's index types drop Input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011bWVCSybBZ1QmsL9gjrqxW
It is the dotted key helm --set takes, so key rather than path.
@aceforeverd
aceforeverd merged commit 13c0e16 into master Nov 10, 2026
4 checks passed
@aceforeverd
aceforeverd deleted the feat-variant-inputs branch November 10, 2026 03:52
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