Archived
radiance 1.2.1
- A checkpoint restore that found its snapshot slot given back stopped the engine (#33): a snapshot handed to an admission is now kept until its step has run, a lost one re-prefills that request instead, and a failed restore names the check and the rank. - The headroom warning had no fixed point (#32): it now checks the room left for a kernel's first launch and names the --gpu-headroom-mib value that clears it. - reasoning_effort (#31): the levels the chat template takes are probed at startup and published in /server_info; a level outside them is a 400 on `reasoning_effort` with `supported`; --reasoning-effort-map rewrites a client's level. - rad-convert reads published quantised releases (#29): AMD Quark MXFP4 byte for byte, and AutoRound (auto_round:auto_gptq) / GPTQ int4 and int8, with Flash-Next checkpoints that ship their experts one by one. - tool_choice "required" and a named function are served by a call grammar for the whole reply.
This commit is contained in:
1 parent
e95d397288
commit
d23c3e0d17
37 files changed
+1595
-147
No files matched your search
@@ -69,6 +69,7 @@ Server::Server(const Deps& d, const ServerOptions& o)
|
||||
lim_.default_sampling = opt_.default_sampling;
|
||||
lim_.default_dry_breakers_set = opt_.default_dry_breakers_set;
|
||||
lim_.default_template_kwargs = opt_.default_template_kwargs;
|
||||
lim_.reasoning_effort_map = opt_.reasoning_effort_map;
|
||||
lim_.reasoning_format = opt_.reasoning_format;
|
||||
|
||||
odeps_.tok = deps_.tok;
|
||||
@@ -196,6 +197,7 @@ void Server::check_template_defaults(std::string* kwargs_why, std::string* effor
|
||||
OaiLimits l = lim_;
|
||||
l.default_template_kwargs.clear();
|
||||
l.default_reasoning_effort.clear();
|
||||
l.probe = true;
|
||||
if (!render(l, nullptr)) return;
|
||||
l.default_template_kwargs = lim_.default_template_kwargs;
|
||||
if (!l.default_template_kwargs.empty() && !render(l, kwargs_why)) return;
|
||||
@@ -203,6 +205,50 @@ void Server::check_template_defaults(std::string* kwargs_why, std::string* effor
|
||||
if (!l.default_reasoning_effort.empty()) render(l, effort_why);
|
||||
}
|
||||
|
||||
std::vector<std::string> Server::probe_reasoning_efforts() {
|
||||
lim_.reasoning_efforts.clear();
|
||||
if (!deps_.chat) return {};
|
||||
OaiLimits l = lim_;
|
||||
l.default_template_kwargs.clear();
|
||||
l.default_reasoning_effort.clear();
|
||||
l.reasoning_effort_map.clear();
|
||||
l.probe = true;
|
||||
auto takes = [&](const std::string& effort) {
|
||||
std::string body = R"({"messages":[{"role":"user","content":"Hello"}],"max_tokens":1)";
|
||||
if (!effort.empty()) body += R"(,"reasoning_effort":)" + json(effort).dump();
|
||||
body += "}";
|
||||
OaiRequest r;
|
||||
ApiError e;
|
||||
return parse_chat_request(body, odeps_, l, &r, &e) >= 0;
|
||||
};
|
||||
/* A render that fails with no effort at all says nothing about efforts, and one that takes a
|
||||
* word no ladder has takes every word. */
|
||||
if (!takes("") || takes("radiance-probe-not-a-level")) return {};
|
||||
std::vector<std::string> set;
|
||||
for (const char* w : { "low", "medium", "high", "xhigh", "max" })
|
||||
if (takes(w)) set.push_back(w);
|
||||
lim_.reasoning_efforts = set;
|
||||
return set;
|
||||
}
|
||||
|
||||
std::string Server::check_reasoning_effort_map() const {
|
||||
if (!deps_.chat) return std::string();
|
||||
OaiLimits l = lim_;
|
||||
l.default_template_kwargs.clear();
|
||||
l.default_reasoning_effort.clear();
|
||||
l.reasoning_effort_map.clear();
|
||||
l.probe = true;
|
||||
for (const auto& [from, to] : lim_.reasoning_effort_map) {
|
||||
const std::string body = R"({"messages":[{"role":"user","content":"Hello"}],"max_tokens":1,)"
|
||||
R"("reasoning_effort":)" + json(to).dump() + "}";
|
||||
OaiRequest r;
|
||||
ApiError e;
|
||||
if (parse_chat_request(body, odeps_, l, &r, &e) < 0)
|
||||
return from + "=" + to + ": the chat template refuses '" + to + "': " + e.message;
|
||||
}
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string Server::check_thinking_budget() const {
|
||||
if (!deps_.chat || lim_.default_thinking_budget < 0) return std::string();
|
||||
const std::string body = R"({"messages":[{"role":"user","content":"Hello"}],"max_tokens":1,)"
|
||||
|
||||
Reference in new issue
Block a user