serve: the model entry carries the capabilities /server_info reports

OpenAI's model object has no field for what a model can be asked for, so a client learned it
by sending a request and reading the refusal. The entry it already fetches now carries the same
capabilities object /server_info does (tools, reasoning, grammar, media, logprobs, the reasoning
efforts the template takes), built by one Server::capabilities() so the two cannot disagree.
This commit is contained in:
baKon authored and StillDeadcode committed 2026-10-08 15:57:51 +02:00
1 parent d5b584a4c1
commit 7c0bd03841
8 files changed
+63 -20

No files matched your search

+4
View File
@@ -2213,6 +2213,10 @@ 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.capabilities.empty()) {
json caps = json::parse(c.capabilities, nullptr, false);
if (!caps.is_discarded() && caps.is_object()) m["capabilities"] = std::move(caps);
}
return m;
}