Documentation
¶
Overview ¶
Package hostcapacity gives the CLI a best-effort, pre-install estimate of how much memory a curated model would have to fit in on this machine.
It is deliberately coarse and deliberately not modeld: modeld's real capacity planning (modeld/capacity) resolves a model's actual KV profile against the live device it opened a session on, through a CGO-linked backend (ggml / OpenVINO device enumeration). None of that exists before modeld is even installed - exactly when `contenox setup` and `contenox model registry-list` need to say something useful about fit.
Detect returns the best signal available without linking modeld: an NVIDIA GPU's total/free VRAM via a best-effort `nvidia-smi` shell probe (pure Go, no CGO - this is the CLI, not modeld, so the project's no-subprocess-in-modeld rule does not apply here), falling back to system RAM via gopsutil when no such GPU is found or the probe fails. Detect never fabricates a number: Known is false when neither source could be read, and callers must not display fit information in that case.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Budget ¶
type Budget struct {
Kind string // "gpu" | "system"
Label string // e.g. "NVIDIA GeForce GTX 1660" or "system RAM"
TotalBytes int64
FreeBytes int64
// Known is false when detection found nothing usable. Callers must treat
// this as "no fit signal", never as "nothing fits".
Known bool
}
Budget is the best-effort memory pool a curated model's estimated resident footprint (modelregistry.ModelDescriptor.EstimatedResidentBytes) is compared against.
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector resolves the best-effort host memory budget. Construct with New; run and systemRAM are injectable for tests.