Let a control plane whose models all live in the database start

Control plane mode was inferred from the config file alone: a model with
profiles meant "control plane", nothing meant "router only". So a deployment
that manages its catalog at runtime could not start at all — the file declares
no models, the process refuses for want of anything to serve, and the stored
models it would have loaded are never read. A cluster unmanageable at runtime
because it is managed at runtime.

control.enabled says so outright. AgentListen cannot carry the signal: it has a
default, so every deployment would silently become a control plane.

The inference stays, so nothing already working has to add a flag.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5 committed 2026-09-27 11:24:49 +02:00
1 parent cd7eedf09e
commit 10e323132c
3 files changed
+59

No files matched your search

+16
View File
@@ -65,6 +65,7 @@ rather than repeated.
| `lost_after` | `time.Duration` | [Control](#control) |
| `port_range` | `[]int` | [Control](#control) |
| `mgmt_interface` | `string` | [Control](#control) |
| `enabled` | `bool` | [Control](#control) |
| `lease_ttl` | `time.Duration` | [Control](#control) |
| `id` | `string` | [Endpoint](#endpoint) |
| `url` | `string` | [Endpoint](#endpoint) |
@@ -485,6 +486,21 @@ PortRange is the per-node range for engine HTTP and dist-init ports.
MgmtInterface is the ethernet interface NCCL bootstraps over.
### `enabled`
`bool`
Enabled runs the control plane even when configuration declares no
models.
Without it, a deployment whose catalog lives entirely in the database
cannot start: control plane mode is inferred from the config file, so an
empty models block means "router only", the process refuses to start for
want of anything to serve, and the models it would have loaded are never
read. That is a cluster that cannot be managed at runtime because it is
managed at runtime. AgentListen cannot carry this signal — it has a
default, so every deployment would become a control plane.
### `lease_ttl`
`time.Duration`
+15
View File
@@ -208,6 +208,18 @@ type Control struct {
// MgmtInterface is the ethernet interface NCCL bootstraps over.
MgmtInterface string `koanf:"mgmt_interface"`
// Enabled runs the control plane even when configuration declares no
// models.
//
// Without it, a deployment whose catalog lives entirely in the database
// cannot start: control plane mode is inferred from the config file, so an
// empty models block means "router only", the process refuses to start for
// want of anything to serve, and the models it would have loaded are never
// read. That is a cluster that cannot be managed at runtime because it is
// managed at runtime. AgentListen cannot carry this signal — it has a
// default, so every deployment would become a control plane.
Enabled bool `koanf:"enabled"`
// LeaseTTL is how long this control plane's claim to be the one placing
// work stands without being renewed.
//
@@ -492,6 +504,9 @@ func (s Server) Catalog() (*catalog.Catalog, error) {
// plus a static endpoint list is the router-only mode used for testing against
// sim-engines.
func (s Server) ControlPlaneMode() bool {
if s.Control.Enabled {
return true
}
for _, m := range s.Models {
if len(m.Profiles) > 0 {
return true
+28
View File
@@ -154,3 +154,31 @@ func TestValidateAcceptsDistinctAliases(t *testing.T) {
t.Errorf("valid aliases rejected: %v", err)
}
}
func TestAControlPlaneCanBeAskedForWithNoModelsInTheFile(t *testing.T) {
// Without this, a deployment whose catalog lives entirely in the database
// cannot start: the mode is inferred from the file, an empty models block
// reads as "router only", and the process refuses to start for want of
// anything to serve — so the stored models it would have loaded are never
// read at all.
var s Server
if s.ControlPlaneMode() {
t.Fatal("an empty configuration is not a control plane")
}
s.Control.Enabled = true
if !s.ControlPlaneMode() {
t.Error("control.enabled should run the control plane with no models declared")
}
}
func TestAModelWithProfilesStillMakesAControlPlane(t *testing.T) {
// The inference stays, so no existing configuration has to add a flag.
var s Server
s.Models = []catalog.Model{{
Name: "m",
Profiles: []catalog.Profile{{Name: "p", Engine: "llamacpp"}},
}}
if !s.ControlPlaneMode() {
t.Error("a declared model with profiles is still a control plane")
}
}