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

+9
View File
@@ -426,6 +426,15 @@ TEST(the_model_list_is_a_list_of_one_with_the_fields_clients_read) {
* trusting a made-up one. */
CHECK(!o["data"][0].contains("max_model_len"));
CHECK(!o["data"][0].contains("root"));
CHECK(!o["data"][0].contains("capabilities"));
}
TEST(the_model_entry_carries_the_capabilities_it_was_given) {
ModelCard c = card("q38-flashnext", 1700000000);
c.capabilities = R"({"tools":true,"image":false})";
const json m = parsed(model_body(c));
CHECK(m["capabilities"].value("tools", false));
CHECK(!m["capabilities"].value("image", true));
}
TEST(the_model_entry_names_the_file_behind_the_served_name) {