Versions in this module Expand all Collapse all v0 v0.22.0 Jul 18, 2026 Changes in this version + func BuildRequest(cfg config.Config, taskType string, payload json.RawMessage) (core.Request, func(), error) + func Families(cfg config.Config) []string + func ParseSmiMemory(out string) (totalGiB, usedGiB float64, err error) + func SupportedTasks(cfg config.Config) []string + func TreeDedicatedGiB(rootPid int) (float64, error) + type FootprintEntry struct + ModelFamily string + Quant string + TaskType string + VramPeakGiB float64 + type Footprints struct + func OpenFootprints(path string) *Footprints + func (f *Footprints) Entries() []FootprintEntry + func (f *Footprints) Path() string + func (f *Footprints) Record(family, quant, task string, observedGiB float64) + func (f *Footprints) ReloadIfChanged() + type JobState string + const JobAccepted + const JobDone + const JobError + const JobRunning + type JobView struct + Data json.RawMessage + Error string + ID string + State JobState + type Jobs struct + func NewJobs(ttl time.Duration) *Jobs + func (j *Jobs) Accept(id string, run func(context.Context) (json.RawMessage, error)) (created bool) + func (j *Jobs) DrainAndStop(timeout time.Duration) + func (j *Jobs) Draining() bool + func (j *Jobs) Get(id string) (*JobView, bool) + func (j *Jobs) QueueDepth() int + type Options struct + Cfg config.Config + Footprints func() []FootprintEntry + GpuArch string + GpuVendor string + NodeID string + Snapshot func() (Snapshot, bool) + type Runner interface + Run func(ctx context.Context, req core.Request) core.Result + type Sampler struct + func StartGlobalSampler(ctx context.Context, interval time.Duration, run func() (string, error)) *Sampler + func (s *Sampler) Load() (Snapshot, bool) + type Server struct + func New(runner Runner, jobs *Jobs, opts Options) *Server + func (s *Server) Handler() http.Handler + func (s *Server) Serve(l net.Listener) error + type Snapshot struct + At time.Time + FreeGiB float64 + TotalGiB float64