Skip to content

feat(playground): list the deployments, not whatever the gateway serves - #39

Merged
imneov merged 3 commits into
modelsphere:mainfrom
imneov:feat/playground-follow-deployments
Oct 7, 2026
Merged

imneov merged 3 commits into
modelsphere:mainfrom
imneov:feat/playground-follow-deployments

Conversation

@imneov

@imneov imneov commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • feature

What this PR does and why

The Playground listed every model any gateway route answered /v1/models for. On a shared gateway that is the wrong set twice over:

  • it shows models the deployment pages do not know about (routes written by hand or by other tools), and
  • it shows nothing for a deployment whose route is not ready yet: the route does not answer, so the probe drops it.

The deployment pages and the Playground then disagree, and the one model a user just deployed is the one they cannot find. Models were also keyed by served name, so two deployments serving the same name (two versions of one catalog entry, say) collapsed into one entry that always went to the first route.

This PR makes the Playground list the deployments the deployment pages list, each joined with what the gateway says about its route:

  • Backend. The model index keeps each route's own model list and why a route listed none. GET <prefix>/routes returns it. A request carrying X-ModelSphere-Route goes to that route (it must be one of the gateway's routes), so a turn reaches the deployment picked even when another route serves the same name.
  • Frontend. The model select lists swiss deployments (targets.ts, joinTargets), ready ones first: a ready one as release · served name and sent to its route; one not ready greyed out with why (no gateway route / route not on the gateway yet / route has no ready instance). Routes no deployment owns are left out. With deployments but none ready, the page lists each with its reason and a link to its page; with none, it says no model is deployed yet and links to Model Serving.

Shortcomings: one page of 100 deployments is listed, the largest page swissd serves. View Code still shows the served name only; the snippet goes through /v1, which routes by name.

Which issue(s) this PR fixes

None; follow-up to #36.

How it was tested

  • go test ./... (new TestPlaygroundByRoute: per-route listing including a route that does not answer, the header picking a route over the name, an unknown route refused).
  • joinTargets unit tests: ready first, the three not-ready reasons, routes no deployment owns left out.
  • On a test cluster: the real deployment list (one deployment without a gateway route, two hand-written routes on the gateway) shows only that deployment, greyed out with its reason. With a deployment list pointing one release at a live route, the release is picked by default, a turn streams back from that engine, and the same body sent with the header naming another route is answered by the other engine. No deployments: the "no model deployed yet" hint, in English and Chinese.

Checks

  • go test ./... and gofmt -l . is empty
  • npm run typecheck && npm test && npm run build in web/ (if web/ changed)
  • helm lint --strict helm/console (if the chart changed) (no chart change)
  • Docs updated where behaviour, a config key or a chart value moved (no docs describe the list)
  • No internal hostnames, IPs, registries or credentials

Notes for reviewers

Start at web/src/modules/playground/targets.ts (the join) and routeByModel in internal/server/models.go. A target's id is its route, so Chat and Compare keep holding a string id; useTarget turns it into the served name and route at request time.

Release note

The Playground lists the models deployed from Model Serving instead of everything the gateway serves; a deployment that is not ready is shown greyed out with why.

🤖 Generated with Claude Code

imneov and others added 3 commits October 6, 2026 21:07
… by name of route

The Playground is to list deployments, and a deployment is a route: it needs
each route's own models, a route that is not ready with why, and to send a
turn to the route the user picked even when another route serves the same
model name. GET <prefix>/routes answers the first from the model index; the
X-ModelSphere-Route header does the second.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Playground listed every model any gateway route answered for, so it showed
models the deployment pages do not know about, and none of a deployment whose
route was not ready. It now lists the deployments the deployment pages list,
each joined with its route: a ready one by release and served name, sent to
its own route; one not ready greyed out with why, linked to its page. Routes
no deployment owns are left out.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Joined to the catalog line it was cut off by the item's width.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@imneov
imneov merged commit 006246f into modelsphere:main Oct 7, 2026
4 checks passed
imneov pushed a commit to imneov/modelsphere-console that referenced this pull request Oct 7, 2026
Since modelsphere#39 the model picker lists the deployments, greyed out with why when
not ready, instead of what the gateway serves. Say so in the Playground
chapter, split the FAQ into no deployment vs greyed out, and stop saying a
deployment without a route is absent from the Playground.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
imneov pushed a commit to imneov/modelsphere-console that referenced this pull request Oct 7, 2026
The Playground lists Model Serving's deployments since modelsphere#39, so a llama.cpp
model the chart runs beside console never shows there, and swiss is where
models come from. Remove demo-model.yaml, the demo values, its llm backend
and the router's fallback to it, its NOTES, the component selector only it
used, and its two chart tests. An install that still sets demo.enabled
renders without it; the weights PVC is kept (resource-policy: keep).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
imneov pushed a commit to imneov/modelsphere-console that referenced this pull request Oct 7, 2026
The Playground lists Model Serving's deployments since modelsphere#39, so a llama.cpp
model the chart runs beside console never shows there, and swiss is where
models come from. Remove demo-model.yaml, the demo values, its llm backend
and the router's fallback to it, its NOTES, the component selector only it
used, and its two chart tests. An install that still sets demo.enabled
renders without it; the weights PVC is kept (resource-policy: keep).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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