lllm3090.state#

One description of the machine, in one shape, served by /api/status.

It lives here rather than inside the FastAPI handler for two reasons. The shape is a documented surface – see docs/reference/http.md – so it is worth a module of its own rather than an anonymous dict literal inside a route; and assembled here it can be built and asserted on without standing up a client.

Nothing here starts, stops or downloads anything. Every call is a read of the catalogue’s arithmetic, a pidfile, or nvidia-smi, which is what makes it safe to call from anywhere, including from a process that is not the panel.

lllm3090.state.vram() → dict[str, int] | None[source]#

Used and total VRAM in MiB as nvidia-smi reports it, or None.

None means the question could not be asked – no driver, no card, a container – rather than zero, which would render as an empty card.

lllm3090.state.disk() → dict[str, float] | None[source]#

Free and total space where the models are kept, in GB, or None.

The panel is where the decision to fetch 21 GB is actually made, so this is the number that has to be next to it. doctor checks the same thing, but by the time anyone runs doctor the download has already failed.

The nearest existing parent is measured, not MODELS_DIR itself: on a fresh install the directory is created by the first download, and “no answer” would be the wrong one for a disk that has plenty of room.

lllm3090.state.installed_models() → list[dict[str, Any]][source]#

What is on disk, with a stray GGUF carrying the window it would get.

The panel draws one merged list, so a checkpoint the catalogue has never heard of sits in it beside the curated ones and has to say the same things they do. Its window comes from catalog.launch_plan – the same call a start makes – rather than from the renderer restating UNKNOWN_MODEL_CTX in its own language, which is how the console and the browser would end up describing one model two ways.

lllm3090.state.engine_choices() → dict[str, Any][source]#

Which engines this machine has, which one serves, and what that buys.

Two backends can sit on one disk and they are not interchangeable, so this is a choice rather than a detail: CUDA measures 1.55-1.60x the Vulkan engine on the dense 27B, costs about a seventh of the context window, and unlocks a speculation profile that loses on Vulkan. A front end that offered the switch without those three facts beside it would be offering a coin flip.

locked says the choice is not the panel’s to make: LLLM3090_LLAMA_DIR outranks anything stored, and a control that silently did nothing would be worse than no control.

lllm3090.state.snapshot() → dict[str, Any][source]#

Everything the panel needs to draw the machine, in one call.

Deliberately excludes the panel’s busy and last: those describe a server process rather than a machine, and this is the machine. The route adds them, which is also what keeps this callable from a plain test.