Skip to content

feat(compose): answer a variant's requires.inputs from the site profile - #54

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

Part of modelsphere/modelsphere#57 . Should answer L3 configuration in variants.

A catalog variant can declare inputs, beside requires: chart values every deploy must answer, such as a Mooncake master address. The site profile answers them in a top-level inputs map, keyed by the input's key. Answers can use model.pathTemplate's placeholders: {{hf}}, {{org}}, {{name}} and {{model}}.

inputs:
  storageKVOffload.mooncake.master: mooncake-master.kv:50051
  • Compose:

    • for each input, puts the site's answer in the derived layer, else the input's catalog default;
    • the deployer's overrides go over it;
    • refuses a plan that leaves an input unset, or answers it with the wrong type or a value that doesn't match the input's pattern ("" is checked like any answer).
  • Catalog load: catalog.Variant gains Inputs, each naming its chart value by Key. swissd re-checks the catalog's input rules:

    • each key is declared once, and values doesn't set it;
    • the pattern compiles;
    • the example and default are valid answers;
    • model.localPath can never be an input.

    The v2 index doesn't carry inputs.

  • Profile parse: refuses an unknown placeholder, a value that isn't a string, number or boolean, and a key that extra also sets.

  • Not here: no rule separating requires and inputs. Keeping an input off a key swiss derives from requires is left to the catalog schema.

  • API and plan format: unchanged; docs/openapi.yaml documents SiteProfile.inputs, ResolvedVariant.inputs (an Input schema), and how POST /api/plans answers inputs (a plan left without one is 400).

Rollout order: this needs to reach every site before any variant declares inputs, because an older swissd refuses the unknown key.

Related: modelsphere/model-catalog#103, modelsphere/console#125

A catalog variant may declare requires.inputs: chart values it needs and
cannot know. The site profile answers them in features.inputs, keyed by chart
path, with model.pathTemplate's placeholders ({{hf}}, {{org}}, {{name}},
{{model}}). compose sets each answer in the derived layer, so the deployer's
overrides win over it, and refuses a plan whose merged values leave an input
unset or answer it with a value of the wrong type or pattern.

swissd re-checks the catalog's rules on load. The API and plan format do not
change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011bWVCSybBZ1QmsL9gjrqxW
aceforeverd and others added 5 commits November 10, 2026 10:45
A value the variant's values gives an input's path is its default: swissd
checks it on load against the input's type and pattern instead of refusing it.
The site's features.inputs answer now merges over that default (it yields only
to the site layer), and the deploy's overrides over both. Compose refuses only
an input left with no answer from any layer; "" is none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011bWVCSybBZ1QmsL9gjrqxW
A value values gives an input's path is its default and must pass the input's
type and pattern, "" and null included. Compose checks "" like any answer;
only an absent or null value is "not set".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011bWVCSybBZ1QmsL9gjrqxW
catalog.Input gains Default. Compose puts each input's answer in the derived
layer: the site profile's features.inputs, else the input's default; the
deploy's overrides go over it. swissd checks the default against the input's
type and pattern on load, and again refuses a variant whose values set an
input's path.

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

A variant's inputs move from requires.inputs to the variant's top level, and
the site profile's answers from features.inputs to a top-level inputs map.
The v2 index no longer carries inputs. No rule yet keeps an input off a path
swiss derives from requires; the catalog schema can add one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011bWVCSybBZ1QmsL9gjrqxW
catalog.Input.Path becomes Key, and ValidInputPath ValidInputKey; the site
profile's inputs are keyed the same way.
@aceforeverd
aceforeverd marked this pull request as ready for review November 10, 2026 03:55
SiteProfile gains inputs, answers by input key; ResolvedVariant gains inputs,
with an Input schema; POST /api/plans says how they are answered and that a
plan left without an answer is 400.
@aceforeverd
aceforeverd merged commit a903094 into master Nov 10, 2026
6 checks passed
@aceforeverd
aceforeverd deleted the feat-variant-inputs branch November 10, 2026 04:32
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