server: adapters on /v1/models, load/unload_lora_adapter, and a hold that keeps an adapter loaded while a request uses it

This commit is contained in:
baKon committed 2026-10-16 20:52:09 -05:00
1 parent ba406ace1b
commit 383544f073
8 files changed
+146 -15

No files matched your search

+9
View File
@@ -2684,6 +2684,7 @@ static json model_card(const ModelCard& c) {
m["owned_by"] = "radiance";
if (c.max_model_len > 0) m["max_model_len"] = c.max_model_len;
if (!c.root.empty()) m["root"] = c.root;
if (!c.parent.empty()) m["parent"] = c.parent;
if (!c.capabilities.empty()) {
json caps = json::parse(c.capabilities, nullptr, false);
if (!caps.is_discarded() && caps.is_object()) m["capabilities"] = std::move(caps);
@@ -2698,6 +2699,14 @@ std::string models_body(const ModelCard& c) {
return o.dump();
}
std::string models_body(const std::vector<ModelCard>& cards) {
json o;
o["object"] = "list";
o["data"] = json::array();
for (const ModelCard& c : cards) o["data"].push_back(model_card(c));
return o.dump();
}
std::string model_body(const ModelCard& c) {
return model_card(c).dump();
}