#pragma once #include "config.h" #include #include namespace minitts::server { // Estimated resident bytes a model will occupy once loaded (weights plus a // runtime overhead factor for GPU buffers / compute graphs). A family that // declares auxiliary resources reports their paths and final resident bytes // through its loader. The server excludes those paths from weight scans and adds // the reported bytes without interpreting execution plans or residency policies. // Returns nullopt // when the footprint is indeterminate: a model directory holding several GGUFs // and no model.gguf. The guard must not refuse such a load with a 503 -- the // loader either rejects the ambiguous directory itself (the spec-driven path // fails with its "contains N GGUF files" error) or accepts it under a // family-specific layout the estimator cannot resolve, so the guard skips // rather than guess. std::optional estimate_model_memory_bytes(const ServerModelConfig & model); } // namespace minitts::server