0.64.0's ThreadPool spawns a dynamic worker inside the accept loop with
no guard: when the process runs out of threads, std::thread's
std::system_error escapes the loop and std::terminate takes the whole
server down. A client that opens enough connections makes thread
exhaustion a scheduled event; radiance's socket gate and drain budget
narrowed that window but never closed it. 0.66.0 wraps the spawn in
try/catch and keeps the job queued for an existing worker -- the abort
becomes a queue.
The pair moves to what llama.cpp carries at b8abe41a5 ("vendor: update
cpp-httplib to 0.66.0 (#32049)"), byte for byte; the LICENSE was already
byte-identical. Patch 0022 re-verified, not rewritten: the same hunk at
a +26-line offset with no fuzz, upstream still bounds the keep-alive
drain only by the connection's timeout, so the 5 s budget still stands.
The six CPPHTTPLIB_* defines vendor/CMakeLists.txt passes were each
re-checked as live knobs in the new pair. UPSTREAM carries the new
record and the audit note; the manifest re-hashes in this commit.
The five files under vendor/shim/ are hashed by the manifest and
tamper-visible, but LIFTED FILES named only one of them
(ryml_impl.cpp, beside the rapidyaml entry). The other four carry
upstream's shape or text -- common.h transcribes llama.cpp's string
helpers unchanged, MIT, at the recorded commit; ggml.h, llama.h and
log.h declare the macros, types and log surface the byte-for-byte lifts
reach for -- and "the manifest hashes it" is tamper detection, not
provenance. A refresh could meet those files with no note of what they
mirror.
They are recorded now, beside the lifts they exist for, with what each
is, what it mirrors, and why it exists rather than the upstream file it
stands in for. The manifest re-hashes with the record, in this commit.
A container's chat template is server-side attacker data the engine
parses and runs without any budget. The parser recursed once per nesting
block or paren: tens of KB of "{{ (((" or "{% if %}" in one
tokenizer.chat_template stack-overflowed whoever read it -- the
capability probe or the first render -- past every catch, and errors-
as-values cannot hold a stack overflow. And range() materialised one
array element per step: {{ range(4000000000) }} was an OOM per render.
Both entry points now share one 128-level guard whose throw is the same
exception class a malformed template already raises, and range() refuses
above 65536 values -- far past any template that exists, small enough
that the whole range stays transient. The refusals cross the ChatTemplate
seam as the error values the seam promises (a chat_test case pins that
both shapes refuse and that real nesting still renders). UPSTREAM keeps
the addition under the chat lift's record; the manifest re-hashes.
A tool schema's `pattern` reaches the grammar converter as client data,
and the group scanner recursed once per nested '(': a few tens of KB of
brackets inside one JSON string was an uncatchable stack overflow of the
request worker. The body's depth and value bounds never saw it -- the
brackets are string content, not JSON nesting -- and 0003, the patch that
made this same function survive a hostile pattern, hardened the empty and
the looping cases but never the recursing one. It is the one remote crash
in the audit, and one request is the whole attack.
transform() now counts its nesting and records the refusal once, where
every unwinding frame met the same '(' and repeated it; check_errors turns
it into the clean throw the server already answers with a 400. Proven on
the compile host against the real converter: the 20000-group pattern is
refused by name, a 40-group pattern -- far past anything a real schema
nests -- still compiles. The record keeps the addition under 0003's name,
whose footing it stands on.
Radiance becomes a multi-model engine: one process serves several models behind one port, loads
each when a request names it, parks it in host memory or restores it from its container, and
shares the cards between them (docs/MULTIMODEL.md). The configuration is one YAML file; the
command line flags are gone (`radiance --config FILE`, hot reload on SIGHUP).
Formats. IQ8R (rotated int8) and IQR-V4 replace FP8 and MXFP4 as whole-model formats, with an
int8 KV cache (`kv-cache-dtype: i8`) in place of the fp8 one. Containers whose weights are block
FP8, MXFP4, M2XFP4, NVFP4 or ParoQuant are refused at startup by the name of the first such
weight. Not served until they have int8 containers: GLM-5.3-Flash, Ornith-1.5, Sage-A1.5,
Nemotron-3.5-Bolt-74B, Ling-3.0-flash, drama-3 and Anima's FP8 container; Nemotron-3.5-Bolt-E4B,
the Gemma 4 31B DFlash containers and MiniCPM5-2B bf16 serve without their drafter. 1.17.0
serves all of them.
Speed. Chained launches for Qwen3.8-27B, Gemma 4, Gemma 3 and the small bf16 models, a new
Qwen3.8-Flash-Next container (IQR-V4 experts, int8 trunk) with its decode step and prefill
reworked, and a reworked adaptive draft window.
Deployment. deploy/compose has two fleet files, tp1.yaml and tp2.yaml, each with its
configuration beside it, in place of the per-model files. `host-pool-mib` is a model's host pool
in all, split among its ranks. The dashboard is rebuilt: an hour of history kept by the server,
each accelerator's memory by model, model states over time.
Merged since 1.17.0: Nemotron-3.5-Bolt-74B-A9B by keptn42 (#339); GLM-5.3-Flash on four cards by
AnimusNull (#397); chained launches for Flash-Next's decode step (#396) and preempted requests
keeping their prefix and place (#405) by mici81; --prefill-interleave auto by Code000 (#410);
eight more libr3d kernels and the w4a4 reference by RikshaDriver (#403, #407, #408); libr3d
large-BAR and E4M3 decode fixes by neuromanMD (#438, #439); int4/int5 decode tiles by Kezi
(#426); attention for Nanbeige 4.3 33B by everplays (#417); expert_stats_report.py by baKon
(#431). Fixed: #398, #402, #419, #437 (dschmitz's patch); added the metrics of #392, and
multi-model serving as asked for in #367 and #109.
Plugin ABI 39: out-of-tree plugins need to be rebuilt.
Thanks to @keptn42, @AnimusNull, @mici81, @Code000, @RikshaDriver, @neuromanMD, @Kezi, @everplays, @baKon and @dschmitz.
Eighteen upstream releases, taken the way the lift was taken: the
split pair llama.cpp now carries (1ab23c33b), against the cpp-httplib
v0.64.0 tag. The vendored pair before this commit was byte-identical
to the old base plus patch 0022 -- re-checked against the pinned lift
commit, not taken on faith.
0022 was written because upstream's keep-alive drain could be paced
one byte per socket timeout forever, and because a refused request's
unread body had no reason to be drained at all. v0.64.0 does both of
those itself: every 4xx/5xx response now carries Connection: close,
a scope_exit in write_response closes the socket when it sees that
option, the drain is skipped for any response committed to close, and
a drain that does run is bounded by a 256 KB cap, the connection's
read timeout as a total, and an immediate close for a part-read body.
The old patch applied nowhere, and mostly needed to be nothing.
What one line is still owed: the library bounds the drain's time only
by the connection's read timeout -- the same knob that bounds a whole
request's reads, uploads included, so lowering it would cap uploads
too. The reworked patch gives the drain a five-second budget of its
own. transport_test's cases for the refusal and the stalled drain are
unchanged: they pin the behavior, whoever in the tree implements it.
Also new in this window and watched with interest: set_trusted_proxies
arrives with real IP matching -- the seam a coming commit wires.
Manifest regenerated; vendor_sums green.
Two standing gaps in how this tree is guarded.
vendor/ records what every lifted file is and what we changed, in prose
-- prose nothing enforces. vendor/SHA256SUMS is the mechanical half:
all 73 files under vendor/, the lifts, the patch series and the record
itself, hashed; tests/vendor_sums.sh recomputes both directions -- a
file whose content drifted from its record, and a file that arrived
without being recorded -- and fails the suite (ctest: vendor_sums, in
the fast tier). An unrecorded change to a lifted dependency now has to
survive being a committed manifest update to ship, instead of slipping
through a rebase the way 33108e4's silent reverts did through this
branch's history.
And no CI ran the suite at all. .woodpecker.yml (Codeberg CI) builds
CPU-only with the media codecs present and runs the host preset --
everything but the gpu and oot tiers. The runner is the current Ubuntu
LTS deliberately: the mp4 writer binds FFmpeg's >= 7 AVIO callbacks and
24.04's 6.1 does not compile it.
Rehearsed on a native Ubuntu 26.04 box -- the same gcc 15.2 the image
carries -- the host preset fails eight cases on this branch, and the
same eight on plain upstream/main: arch, chatparse, engine_e2e, two
gbnf shards, place, quant_ggml and avx_check. Pre-existing under gcc
15, partly machine-dependent (avx_check compares kernels op by op on
the CPU it finds, and the gbnf shards flip under load); this branch
adds none of them. CI's first red is upstream's to see.
Three ways a client spent the server's patience or memory without ever
being admitted:
The gate's 401 answers before any handler sees the request, so its body
sits unread on a keep-alive socket, and httplib's anti-smuggling drain
will wait for it: one byte per read timeout paces a whole worker, at the
pacing client's chosen rate. The refusal now closes the connection
instead, says so on the response, and buries the body with the socket --
which is also what makes draining a refusal pointless.
A drain that does have a purpose -- a framed body on a request the
router answered without reading it -- inherits the stream's 30 s read
wait per packet gap and no total bound at all. It keeps both waits now:
five seconds per gap (the stream's own set_read_timeout, the same knob
the WebSocket upgrade uses) and five in total (a deadline the discard
provider checks), then the connection dies and the timeout is restored
for whatever the connection still has coming.
And bodies. The per-request cap bounds one body and no sum, every byte
of a body is buffered before parse, admission or any accounting sees
it, and a few hundred concurrent large POSTs is an OOM that reaches the
engine before any refusal does. read_and_bridge now holds every buffered
byte against a transport-wide budget and answers 429 with Retry-After to
the newcomer the budget has no room for; the reservation releases on
every exit, including the peer vanishing mid-body. The budget defaults
to eight bodies at the per-request cap and moves through
ServerOptions::max_inflight_body_bytes.
Vendor: the two httplib hunks are recorded as patches/0022, and
UPSTREAM's "no file content differs" for the pair is replaced with what
the split actually is and what is now edited in it.
transport_test: a_refusal_closes_the_connection,
a_stalled_drain_dies_on_its_deadline, the_inflight_body_budget. ASan+UBSan:
transport/wire/lifecycle/server/config/diag/dashboard, 7/7.
json{nullptr} is the one-element array [null], not an empty one. The string-content probe
passed it as `tools`; GLM-5.3's template iterates `tools` under `{% if tools %}`, so the probe's
render threw on the null element, the throw was taken for "cannot render string content", and
with typed content unsupported as well every request logged `render_message_to_json: Neither
string content nor typed content is supported`. llama.cpp master passes json::array() (PR
#27130); so does this probe now. The GLM-shaped template in chat_test asserts string content.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
New models:
- LTX-2.5 (base and distilled): video with a stereo soundtrack from text or from text and a first
frame, on one card, with its duration head, tiled VAE decoding, the diffusion decoder and the x2
latent upsampler
- Krea 2 Raw and Turbo, and FLUX.3 [klein] and its base: text to image, and for FLUX.3 edits from up
to ten reference pictures, on one card
- GLM-5.3-Flash from AMD's Quark MXFP4 export, on eight cards (John McDonough, Nunze)
- Gemma 3 / TranslateGemma 27B with an optional DFlash2 drafter (mici81)
Engine:
- --kv-cache-dtype fp8_v4 and k6_v4 for Gemma 3 and Qwen3.8-Flash-Next (mici81)
- the rotated int8 trunk (i8a8h) for Qwen3.8-27B (eddie168168)
- eight-rank all-reduce bands, weighted shards and pieces (Nunze); --host-headroom-mib (sfjes)
- the dashboard shows the single-stream decode floor and its most recent window (Memoria)
Fixes: prefix-cache reservations kept until their save lands (baKon), tool calls in Responses
namespaces (#119), system messages merged when a template refuses several (#137), a prefill
continued with no open step (#127), calibration of a Gram accumulation (#122), JSON Schema patterns
read unanchored (davetha), GLM-style tool calls, the KV floor counting every sequence's state.
Plugin ABI 24.
jinja2 reads `obj.0` as `obj[0]`; the engine threw "Static member property must be an
identifier". GLM-5's template tests a tool result with `m.content.0.type`, and the capability
probe swallows the throw, so the template came back as tools=0 tool_calls=0 and every request
with `tools` was refused.
The fix is llama.cpp's ae9afff8, which landed after the lifted commit, taken as it is so the next
refresh drops it. vendor/patches/0021, vendor/UPSTREAM; chat_test
(a_dotted_integer_is_an_index_as_in_jinja2) fails without it on both counts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inside a class, escapes GBNF does not know ([\b], [\f], [\v], [\0], an escaped space, \p{..}, \c,
a backreference) were copied raw and the grammar then failed to load, an internal error on a
schema the converter had accepted.
A JSON string holds a control character only as an escape, so \t \n \r \f \v \0 (and \b in a
class) now match that escape, in a positive class as alternatives beside it and in a negated
class by leaving the escape out. Outside a class the escape is a group, so a quantifier takes all
of it. An escaped space or non-ASCII character is itself; \x and \u in a class need their hex
digits. Any other class escape is refused at conversion with a message naming it.
vendor/patches/0020, vendor/UPSTREAM; gbnf_test cases.
Patterns written in JavaScript escape punctuation that needs no escape: "\/" in a path, "\-" in
a class. zod's email pattern carries "[A-Za-z0-9_'+\-]", so any tool validating an email with zod
sent a schema that was refused outside a class ("Unsupported regex escape") or, inside one,
produced a grammar that failed to load.
Outside a class such an escape is now the bare character; regex syntax characters and '"' keep
their backslash. Inside a class it is written \xHH, so an escaped '-' or '^' cannot read as a
range or a negation. Found by running 203 patterns harvested from installed agent packages
through rad-gbnf-check. vendor/patches/0019, vendor/UPSTREAM; gbnf_test cases.
\d \w \s \D \W \S were refused in a literal ("Unsupported regex escape") and copied raw into a
class, where GBNF cannot load them. Tool schemas use them freely: oh-my-pi's workpool tool sends
"\S" thirteen times, so with 0017 its requests got past the anchors and were refused here.
Each shorthand is written out as its ECMA-262 class before the scanner reads the pattern. The
negated forms leave out '"', '\' and the control characters and admit any JSON escape instead, so
a match cannot run past the closing quote; \s also admits \t \n \f \r. In a class a positive
shorthand becomes its ranges and [\s\S] and its kin become any text; a negated shorthand mixed into
a class is refused. vendor/patches/0018, vendor/UPSTREAM; gbnf_test cases, and sample_test's
"cannot spell" case moves from \d to \b.
_visit_pattern() read only ^...$ and refused every other `pattern` with "Pattern must start
with '^' and end with '$'". JSON Schema patterns are unanchored (ECMA-262 search, validation
6.3.3). Since 1.8 constrains tool-call arguments with a grammar, a bare pattern on array items
failed the whole request: an opencode agent's tool list did, on every request.
A missing anchor is now written out as any string text on that side, (?:[^"\\]|\\.)*, not ".*"
('.' matches '"' here, so on array items ["1","x"] read as one string holding a digit). A
one-sided anchor beside a top-level '|' is still refused. vendor/patches/0017, vendor/UPSTREAM;
tests in gbnf_test (json_schema_grammars_admit_exactly_their_instances) and sample_test (an
empty pattern now matches every string).
- every model serves without a GPU: libavx covers every op, so `--kernels libavx` alone serves
every shipped container
- Qwen3-ASR (zivius): speech to text on /v1/audio/transcriptions and live over /v1/realtime
- /v1/messages works with Claude Code as it ships (gearwave00001)
- a long agent conversation keeps its cached history when the client rewrites its last turn
(manueloverride)
- a stream's first event goes out with the first token, so llama-benchy measures prefill right
- opt-in --prefill-interleave (Smellyyyy, baKon) and --prefill-span (keptn42)
- four-rank TP releases the link early; four-rank selftests and docs/TP4.md (goodman-b)
- NVFP4 and FP8 compressed-tensors imports (devmilan); tools/rad-export for finetunes and LoRA
adapters (baKon)
- many fixes, among them lost tokens on stop strings under concurrency, keep-alive, MiniCPM5 tool
arguments and the CPU's vision and audio encoders
- plugin ABI 17 and changed op schemas: out-of-tree plugins must be rebuilt
- oh-my-pi works unmodified on every Qwen model. Its requests carry a top-level
preserve_thinking, which was refused as an unknown field; it now reaches the chat template the
way enable_thinking does. Its task tool's `model` parameter is the `not` of every JSON type,
which the 1.0.1 fix did not cover: any `not` that excludes every value is now an argument no
call writes, under every chat template and Flash-Next's declared format.
- Command-line defaults and bounds for what a request leaves out. A flag left unset changes
nothing; /server_info reports the values under request_defaults.
- Sampling: --typical-p, --presence-penalty, --frequency-penalty, --repetition-penalty,
--repeat-last-n, --dry-multiplier, --dry-base, --dry-allowed-length, --dry-penalty-last-n,
--dry-sequence-breakers, --xtc-probability, --xtc-threshold.
- Requests: --default-max-tokens N|auto, --max-tokens-cap, --max-n, --max-queued-requests,
--max-stop-strings, --max-stop-bytes.
- Chat template: --chat-template-kwargs JSON|@FILE sets template variables a request's own
chat_template_kwargs override; --reasoning-format auto|none.
- HTTP: --http-threads, --read-timeout, --write-timeout, --keep-alive-timeout, --max-body-mib,
--retry-after, --no-cors.
- Media: --image-min-pixels, --image-max-pixels, --video-min-pixels, --video-max-pixels,
--video-fps, --video-min-frames, --video-max-frames, --video-max-frame-tokens,
--max-source-pixels.
- Under --reasoning-effort none or minimal, a request that sets enable_thinking true now thinks
instead of having the deployment default override it.
- --temp, --top-p, --min-p and --top-k refuse a value that is not a number instead of reading
it as 0.
- A tool whose schema bounds a string or an array past 2000 (maxLength, minLength, maxItems,
minItems) no longer fails every request carrying it (issue #5). The bound is held exactly, up to
about 200,000; past that the request is refused with a 400 naming the tool's property and the
count. A bound past 2^31, such as Number.MAX_SAFE_INTEGER, is no bound.
- Compiling a grammar with a long bounded repetition is linear in the bound instead of quadratic:
maxLength 32000 compiles in 0.7 s instead of 2.1 s.
- Up to 32 sequences a step on every model. The DSpark drafter (MiniCPM5) no longer rejects every
draft from the tenth sequence on, and the step batch's block tables and media staging are
charged to the VRAM budget instead of the headroom kernels load into.
- A tool parameter whose schema accepts no value ({"not": {}}, as TypeBox and Arktype export
`never`) is an argument no call writes, instead of failing the request. oh-my-pi's task tool
works.
- --served-model-name NAME and --override-chat-template PATH.
- The startup session count counts only the part of the KV pool that holds context.
- Compose files and README run --max-num-seqs 32 where it keeps a 200K-token request.