Archived
front: a refused request does not wake a model to be refused
Every forwarded request leased its model, and the lease fired demand for a cold or parked one before any handler ran. On the guarded routes -- the lora admin, /diagnostics, /reset_prefix_cache, DELETE /sessions, the control vector -- the handler then answered 403 keyless: the wake had already asked the scheduler for a real load, which can fetch the repository and evict residents to make room. Loop one cheap GET over an enumerated model name and the fleet churns for an audience that never gets an answer. The front already knows reads that report on a model are no reason to bring one back; the same courtesy is now owed to a request the guard will refuse. The fleet hands the front its operator rule -- the very predicate its admin guard reads -- and a guarded route from anyone else reads the not-open state and stops. Open models still dispatch, keyed boxes still wake everything, and the operator keeps the diagnostics that bring a parked model forward.
This commit is contained in:
1 parent
41a1aa00fe
commit
b83d53cf19
4 files changed
+114
-8
No files matched your search
@@ -2824,6 +2824,12 @@ int Fleet::run() {
|
||||
if (required) preload.push_back(e.name);
|
||||
}
|
||||
front_.set_demand([this](const std::string& n) { demand(n); });
|
||||
/* The guarded routes wake models only for callers their own handlers would admit: the
|
||||
* same three-leg rule add_routes' guard reads (fleet.cpp), keyed deployments always. */
|
||||
front_.set_operator_rule([this](const server::HttpRequest& q) {
|
||||
const Config& c = fc_.models.front().cfg;
|
||||
return !c.api_key.empty() || server::local_operator(q, c.host, c.allow_hosts);
|
||||
});
|
||||
front_.set_describe([this](const std::string& n) { return describe(n); });
|
||||
front_.set_metrics([this] { return metrics(); });
|
||||
add_routes();
|
||||
|
||||
Reference in new issue
Block a user