Set how a model runs from the mirror page

Every mirrored version was in use on the cluster, so the serve link — hidden for a version already served — appeared nowhere, and changing a model between always on and on demand needed the CLI. Each model using a file now shows how it runs and offers always on, on demand (15 minutes idle) or stopped, through the model service's Scale; models declared in server.yaml show their mode and where to change it. The serve form asks the same question.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-09-28 20:34:41 +02:00
1 parent d8cefd8b21
commit bf94cd1667
8 files changed
+188 -18

No files matched your search

+24 -1
View File
@@ -49,7 +49,25 @@ reachable from this machine.</p>
<td>
{{if eq (printf "%s" .State) "fetching"}}<span class="state state-starting">downloading</span>
{{else if eq (printf "%s" .State) "failed"}}<span class="state state-failed">failed</span>
{{else if .UsedBy}}{{range .UsedBy}}<span class="tag">{{.}}</span>{{end}}
{{else if .UsedBy}}{{range .UsedBy}}<div class="use">
<span class="tag">{{.Name}}</span>
{{if .Declared}}<span class="opt">{{if eq .Mode "always"}}always on{{else if eq .Mode "ondemand"}}on demand{{else}}stopped{{end}} · set in server.yaml</span>
{{else}}
{{/* Submitted on change: the choice is the action, and a second click
to confirm it would only be a way to forget to. */}}
<form method="post" action="/admin/mirror/mode" class="inline">
<input type="hidden" name="csrf" value="{{$.CSRF}}">
<input type="hidden" name="model" value="{{.Name}}">
<input type="hidden" name="replicas" value="{{.Replicas}}">
<select name="mode" class="mode" onchange="this.form.submit()" aria-label="How {{.Name}} runs">
<option value="always"{{if eq .Mode "always"}} selected{{end}}>always on</option>
<option value="ondemand"{{if eq .Mode "ondemand"}} selected{{end}}>on demand</option>
<option value="stopped"{{if eq .Mode "stopped"}} selected{{end}}>stopped</option>
</select>
<noscript><button type="submit" class="link">set</button></noscript>
</form>
{{end}}
</div>{{end}}
{{else}}<span class="opt">not served</span>{{end}}
</td>
<td class="actions">
@@ -100,6 +118,11 @@ reachable from this machine.</p>
<label>Aliases <span class="opt">comma separated</span>
<input type="text" name="aliases" placeholder="coder-7b"></label>
<label>Replicas <input type="text" name="replicas" value="1" required></label>
<label>Runs
<select name="mode">
<option value="always">always on</option>
<option value="ondemand">on demand: loads when asked, stops after 15 min unused</option>
</select></label>
</div>
{{/* Reaches clients through /v1/models, which for most of them is the only
view of what this gateway serves. Nine names and nothing to choose