Skip to main content

Module admin

Module admin 

Source
Expand description

Wire shapes for the /admin control surface: the model inventory, the one long-running-task contract, and the server’s own counters.

Two rules run through all of it.

Absent means absent. Every field the UI reads is always present in the JSON, and a value that could not be established cheaply is null rather than a plausible-looking default. A 0 context length and an unknown context length are different facts, and a UI that cannot tell them apart will print the wrong one with confidence. That is why the optional fields here are not skip_serializing_if – the key stays, the value goes to null.

Rates come from the estimator or not at all. TaskProgress is built from crate::progress::RateReport, which refuses to divide until its window is long enough. Nothing here may compute a rate on the side; see TaskProgress::from_report.

Structs§

CancelResponse
DownloadRequest
A Hub repo plus the file to take from it. file may be a literal name or a * glob, which is resolved against the repo’s file list. Both are validated server-side: only .gguf targets, and nothing that could name a path outside the model directory.
LoadModelRequest
ModelEntry
One model the server can serve, described from its GGUF header alone. Nothing here requires reading a single weight.
ModelsResponse
RecentRequest
One finished request, as recorded in the ring buffer.
StatsResponse
TaskAccepted
202 body for anything that starts a background job.
TaskProgress
TaskView
TasksResponse
UnloadResponse

Enums§

ModelState
What a model on disk is doing right now.
ProgressState
Whether the rate/ETA numbers may be shown at all.
TaskKind
TaskStatus
queued/running are live; done/error/cancelled are terminal and never change again. A UI can stop polling a task the moment it reads a terminal status.