Commit Graph
93 Commits
Author SHA1 Message Date
Hasan BasbunarandClaude Opus 5.5 9ec2c83ae2 proxy v6.46: a body the proxy writes again for the engine stays UTF-8
Seven guards parse a body and write it again for the engine (the
reasoning effort routes, the Qwen, Nemotron and Ornith effort
translations, the tool schema patterns, the model name on vLLM), and the
prompt counter writes the text it sends the engine's tokenizer. They
wrote it with json.dumps' default, which escapes every character outside
ASCII: a Chinese character took 6 bytes instead of 3 and an emoji 12
instead of 4, so the engine got a body two to three times the one sent,
the proxy held it at 5.65 and 7.98 times its size while its guards worked
on it, against 3.98 for an image as base64, and the counter measured a
prompt against COUNT_BODY_MAX_BYTES at that inflated size (reference box,
2026-10-24, taux.py in qa-tools, three runs each). They write it through
rewritten(), in UTF-8; a lone surrogate, which a JSON escape allows and
UTF-8 cannot carry, keeps its escape. Redone on v6.45 from the branch of
2026-10-19, which predates the Ornith translation and missed the counter.

tests/test_proxy_body_utf8.py: nine of its ten tests fail on v6.45, the
lone surrogate's passes on both. The 505 tests of tests/test_proxy_*.py
pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 10:20:12 +02:00
Hasan BasbunarandClaude Opus 5.5 bc66abda1a what the review of the Ornith lane found
- The image the Flash FP4-Local and Ornith lanes share keeps a tag for
  each lane, but a lane loaded from the cockpit after the other had
  pulled the image got none (its preparation, which tags, did not run).
  The other lane's uninstall then left the image untagged and said a
  prune could reclaim it, and a docker image prune would have taken it
  from a unit that runs it. pin_untag now hands the image to an
  installed unit that runs it by its digest, under its lane's tag, and
  says so.
- none and minimal win over a request's own enable_thinking on the
  Ornith lane, as on the Qwen lanes: omp, as pi-gen.py writes its
  config, sends enable_thinking true beside its level, and its minimal
  reasoned in full.
- pi sends Ornith its levels as they are, its off as none: Kolibri's
  map, copied, sent its minimal as low, which the proxy keeps whole.
- A test of install.sh's left-out lane ran install-ornith-122b.sh for
  real (copied with its execute bit): it is neutralized as the other
  side installers are.
- The guard tests that list the vLLM installers and units name the
  Ornith lane's (one fetch, the docker group before docker, die, no
  progress mount of its own, the image and video uninstalls' lists),
  and switch-model.sh's --fetch has its Ornith case.

The tests of the first three fail on the commit before this one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 02:18:38 +02:00
Hasan BasbunarandClaude Opus 5.5 1aab73f326 Ornith 1.5 122B as a ninth lane, on vLLM with its MTP head and a window of a million
Ornith AI's Ornith 1.5 122B (MIT), a mixture of experts of the Qwen3.5
family with vision, in its authors' NVFP4 build pinned at its revision
of 2026-10-21, served by vLLM with b12x in the Flash FP4-Local lane's
image: its MTP head drafting 2 tokens, 8 requests at a time, prefix
caching with the Mamba states aligned, the checkpoint's chat template
and sampling as published, served as ornith-1.5-122b. Its window is
1,048,576 tokens: YaRN at factor 4, written whole into
text_config.rope_parameters, the one form this vLLM reads (the model
card's rope_scaling changed no probability on the reference box), and
a KV cache fixed at 17 GiB, 1,301,680 tokens.

Installed on demand like the other lanes: install-ornith-122b.sh with
its pins (--units-only, --prepare, --stage, --uninstall), the
--no-ornith-122b and --with-ornith-122b flags, a switch-model.sh and
prepare-lane.sh target, its sudoers lines, every other unit's
Conflicts= and After=, the keepalive's hold, the uninstall's lists. The
image is shared: each lane's uninstall leaves the io_uring filter and
the image to the other while it is installed, and pin_untag says which
tag still keeps it. The cockpit shows it in the b12x family, opencode
and pi get a provider whose variants are its template's (enable_thinking
on, or none), and the proxy (v6.45) turns a request's reasoning effort
into enable_thinking for it: none and minimal off, the rest on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 01:30:46 +02:00
Hasan BasbunarandClaude Opus 5.5 9acaedd714 keepalive-proxy.py v6.44: the corruption tripwire reads vLLM's reasoning
vLLM streams the thinking as delta.reasoning, SGLang as reasoning_content,
and the tripwire read content and reasoning_content only. On the Flash
FP4-Local lane, a Qwen lane on vLLM whose token id 0 is "!", a decode that
lost its state while it reasoned went unseen (found in review, 2026-10-20).
The guard reads reasoning too. The test fails on v6.43.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 20:15:19 +02:00
f7973e8211 keepalive-proxy.py v6.43: the Flash FP4-Local lane is a Qwen lane
Its window is the flash lane's, so the flash lane's one-prompt ceiling holds while it serves
(FLASH_SERVED_NAMES, here and in oc-fit-limits.py, which the cockpit reads its ceiling through). Its
chat template is the flash lane's and refuses a reasoning effort of "none" (a 400), which vLLM hands
it as it came when it is sent inside chat_template_kwargs: "none" becomes enable_thinking false
there, as on the SGLang lanes (QWEN_VLLM_NAMES, the Qwen lanes vLLM serves, named one by one; Kolibri
and the Nemotron lanes keep their own). System One, refused on every vLLM lane, says which lanes it
serves on, where it said "needs a Qwen lane" while a Qwen lane served.

Tests: the ceiling while it serves, "none" turned to thinking off in both places a client puts it
and left as it came on Kolibri, System One's words on Kolibri and on it. Each fails on v6.42.

Co-Authored-By: Dimitris Kontokostas <jimkont@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 09:22:20 +02:00
Hasan BasbunarandClaude Opus 5.5 ce32b93678 proxy v6.42; docs/clients.md: the Bearer scheme in any case, the x-override headers that stay
The proxy's history says what this series changed (the identity wall
reads the Bearer scheme in any case, a caller's x-override-* headers
stay at the door but the rid, the pump's finally ends without a return,
and its unit's sandbox and 2G ceiling), and docs/clients.md says the
two that a client sees, where it reads about authentication and the
client keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 20:29:54 +02:00
Hasan BasbunarandClaude Opus 5.5 37b0113159 proxy unit: MemoryMax holds the bodies it accepts
BODY_BUDGET_BYTES (384 MiB) bounds the bytes of the bodies in flight,
but a body costs the proxy about four times its bytes while the guards
work on it: the reasoning_effort route parses it and writes it again.
Measured on the reference box (aarch64, Python 3.12), on the proxy as a
process with the shape tests/test_proxy_memory_ceiling.py sends (an
image as base64, reasoning_effort "lean"), three runs each: 3.99 times
a 24 MiB body, 4.01 times a 250 MiB one; one body of 250 MiB, under
MAX_BODY_BYTES, took the proxy from 31 to 1033 MiB, past the unit's
MemoryMax=1G with MemorySwapMax=0, where the kernel kills the proxy
with every stream in flight (seen in a cloud container under systemd
255; the client got an empty reply). The proxy of v1.36.2 measured the
same. MemoryMax is 2G now, which holds the budget at that rate with a
tenth to spare; the limits clients see are unchanged.

tests/test_proxy_memory_ceiling.py measures the rate on the machine it
runs on and fails when the idle proxy plus the budget at that rate is
over nine tenths of MemoryMax. The ceiling test of v1.22.13 asks for 2G,
and the two comments that gave 1G as the current ceiling say it was 1G
then.

Found in a cloud review of v1.36.1 (pull request #52). On the reference
box the unit rendered from this commit holds MemoryMax=2147483648 and
MemorySwapMax=0 with the sandbox of the commit before, and every client
above answered through it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 20:28:35 +02:00
Hasan BasbunarandClaude Opus 5.5 99ad870c1c proxy: the pump's finally ends without a return
The relay's pump thread ended its finally with a return when it had
drained an abandoned answer. A return in a finally discards the
exception that brought the thread there, and Python 3.14 says so when
it compiles the file (PEP 765): 3.14.6 prints "keepalive-proxy.py:4172:
SyntaxWarning: 'return' in a 'finally' block" at every start of the
proxy. The box runs 3.12, which says nothing. The branch is an if and
its else now, with the same effects: the drain closes the response,
the other path flushes the tail and posts the end mark.

A new gate walks the syntax tree of every tracked Python file for a
return, break or continue that leaves a finally block. It is stricter
than 3.14.6, which says nothing of a return in a loop of the finally,
which swallows the same. This was the only one among the 253 files.

Found in a cloud review of v1.36.1 (pull request #52). The box runs
Python 3.12, which says nothing, and the try above this finally catches
every Exception, so the thread does what it did. The gate fails on the
old code (keepalive-proxy.py:4172: return) and passes on this one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 17:38:10 +02:00
Hasan BasbunarandClaude Opus 5.5 75a8fe0a01 proxy: a caller's x-override-* headers stay at the door, but the rid
The SGLang lanes start their engine with
SGLANG_ENABLE_REQUEST_HEADER_OVERRIDES=1 so that it takes the request id
this proxy names (v6.14). That switch makes the engine apply every
override header it knows, from whoever sends it. Read in SGLang
v0.5.21 (python/sglang/srt/entrypoints/request_headers.py, fetched at
the v0.5.21 tag): x-override-rid, -bootstrap-host, -bootstrap-port,
-bootstrap-room, -conversation-id, -routed-dp-rank,
-disagg-prefill-dp-rank and -priority. _hdrs relayed every header but
the hop-by-hop ones, so any client of the port could set the
scheduler's priority, data-parallel rank and disaggregation fields of
its own request. None of them is a client's to set.

The caller's x-override-* headers are now dropped by their prefix, so
a field a later release adds is dropped too. The rid keeps the
behaviour it had: the proxy's own, or the caller's when it names one.

Found in a cloud review of v1.36.1 (pull request #52). On the reference
box none of these fields gives a client anything: its engines run
without priority scheduling (a priority is ignored, or aborts that
request alone), with one data-parallel rank and no disaggregation, and
conversation_id is only stored (read in the scheduler of the flash
lane's pinned image). Nothing in this repository sends an x-override-*
header but the rid. The new test fails on the old code (all eight
headers reach the fake engine) and passes on this one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 17:38:00 +02:00
Hasan BasbunarandClaude Opus 5.5 af1aa5d2a2 proxy: the identity wall reads the Bearer scheme in any case
With QWEN38_CLIENT_KEYS_FILE set, _label_peer named a client only when
its header started with "Bearer " exactly, while SGLang, vLLM's
middleware (vllm_engine_auth.py) and the door without the wall
(engine_admits) all read the scheme in any case, as RFC 9110 11.1 has
it. A listed key sent as "bearer <key>" got the wall's 401 "missing or
unknown client key" from a proxy whose engine admits that header.
Reproduced against v6.41 with a live proxy: "Bearer" 503 (no engine
behind it, so past the wall), "bearer" and "BEARER" 401.

The scheme is now compared case-insensitively and the token after it is
stripped as before; an empty token or another scheme still gets the 401.

Found in a cloud review of v1.36.1 (pull request #52). The reference box
does not set QWEN38_CLIENT_KEYS_FILE, so there it changes nothing. The
new test fails on the old code (401 != 200 for "bearer") and passes on
this one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 17:37:32 +02:00
Hasan BasbunarandClaude Opus 5.5 b49df38ebc proxy v6.41; docs/clients.md: what the network and a body in flight may hold
The ceilings on connections from other machines, the deadline for a
request's headers, the budget of the bodies in flight and the refusal of
a compressed body are said where clients read about the proxy's
refusals, with the variable of each and how to raise one for a gateway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 2b7a941cd5 proxy: a compressed request body is refused, not relayed past the guards
Every guard reads the body as it comes, and a body sent with a
Content-Encoding (gzip, deflate, br) reads as no JSON to each of them, so
each let it pass: an engine or a front that decodes it would take what no
guard had seen. A body in any coding but identity is now refused with a
415 and Accept-Encoding: identity, before it is read; no client of this
port compresses its body. The cockpit's outcome list knows the new line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 bef415e462 proxy: the video ceiling reads VIDEO_MAX_PIXELS, as the engine does
SGLang's video processor (qwen_vl.py, v0.5.21) takes its
VIDEO_TOTAL_PIXELS from the environment variable VIDEO_MAX_PIXELS; the
guard read VIDEO_TOTAL_PIXELS, a name the engine never reads, so the two
could not be set alike. The guard now reads VIDEO_MAX_PIXELS, with the
engine's default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 b674f9f6aa proxy: behind the wall a client key reaches the other dialects' reading routes
The wall's allow list refused Ollama's /api/tags and /api/show,
SageMaker's /ping and the root as operator routes, though SGLang v0.5.21
only reads there (a model list, a model card, an empty 200, "is
running"). They are client routes now. /encode and /classify stay out:
they run the model outside the size guard, and /v1/embeddings and
/v1/classify, which it guards, are a client's way there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 7e37d4ac72 proxy: the media of an uncountable body are priced as media, not by bytes
Where a wedge is possible, a body the engine's count cannot take is
judged at one byte a token, and /v1/responses' input and /generate's
image_data, video_data and audio_data carry their media as base64: one
photo was a token per byte and refused as too long. Those media are now
priced by _media_tokens, as everywhere else in the guard (an image by its
header, a video by its ceiling), and only the rest of the body is judged
by its size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 49ffa994bc proxy: /v1/tokenize has the counting ceiling, and no count past it is asked
SGLang v0.5.21 serves the counting handlers at /v1/tokenize and
/v1/detokenize too, which the ceiling of the bare routes missed. And the
size guard, to decide on a nominated prompt, handed its text whole to the
engine's /tokenize, up to MAX_BODY_BYTES, the very load that ceiling keeps
from the engine. A prompt whose text alone is past COUNT_BODY_MAX_BYTES,
over four times the largest window a lane serves, is now refused as too
long without a count, on the relay path and System One's alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 738bc5e4ab proxy: the serving unit's override flag proves an abandoned answer abortable
Only a chat or /generate stream proved that the engine takes the rid the
proxy imposes, and the proof was dropped at every engine restart: a box
served by Claude Code alone never had it, and each abandoned /v1/messages
answer was drained for up to DRAIN_MAX_S. Until an answer says otherwise,
the active unit named in PROXY_HOLD_UNITS starting its engine with
SGLANG_ENABLE_REQUEST_HEADER_OVERRIDES=1, on its command line or in the
launcher it runs, is now the proof. vLLM's lanes do not set it and keep
the drain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 fa1fced36f proxy: a body takes the budget as it arrives, a small one always comes in
The budget was taken whole on the Content-Length before a byte was read
and kept to the end: a key holder announcing large bodies and sending
nothing held all of it, and every other body, loopback's included, got a
503. A body at or under BODY_SMALL_BYTES (1 MiB) is now always read and
holds none of it; a larger one takes its bytes as they arrive, a step at
a time, and is refused when no room is left, except the oldest one being
read, which waits up to BODY_WAIT_S for the room the others give back, so
two bodies read at once never both lose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 84e3a30e6d proxy: a peer on the network has 30 s in all for its request's headers
No key is asked before a request's line and headers are in, and
CLIENT_IO_S (900 s) bounded each read, not the whole: four addresses at
their ceiling of silent or trickling connections shut the port to every
other peer on the network, with no key. A connection from the network now
has CLIENT_HEADER_S (30 s, settable) in all until its headers are in, a
byte at a time or not, then CLIENT_IO_S again. Loopback is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 5172b3d293 proxy: judge a held request again for the engine that comes back
The sampling guard judged a body once, before the hold that waits for a
restarting engine, against the vocabulary of the engine that was there,
and the request then went as it was to the engine that came back, which
can be another lane: an id the old lane held and the new one does not
took it down. After a hold, the body is judged again, against a
vocabulary learned since the hold began; an answer in a stream the hold
opened is an error event of that stream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 eab77c70ac proxy: a body ceiling of their own for /tokenize and /detokenize
The engine's counting routes generate nothing, so the oversize guard
never measured them and only MAX_BODY_BYTES (256 MiB) bounded what they
handed the engine's tokenizer. Past COUNT_BODY_MAX_BYTES (16 MiB, over
four million tokens of prose) they now get a 413 before the body is
read. /v1/messages/count_tokens, which Anthropic clients send their
whole conversation to, keeps MAX_BODY_BYTES.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 8952a37ee9 proxy: hold token ids past every lane's vocabulary while it is unknown
The sampling guard stood down when the served vocabulary could not be
learned (a busy, paused or restarting engine, or one that answers the
probe), refusing only negative ids, so an id past the vocabulary, which
takes the scheduler down for every client, was relayed on trust. An id
under the smallest vocabulary of the lanes the proxy fronts (Kolibri's
128,000) still goes; one at or past it gets a 503 with Retry-After until
the vocabulary is known.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 bd2fac2393 proxy: refuse /v1/score's label_token_ids like token_ids_logprob
Scoring asks the engine for token_ids_logprob itself, from
label_token_ids, so a score request batched with any other is the mixed
batch that kills the scheduler (sglang#34719), the reason the field is
refused on /generate. /v1/score was relayed with nothing read; a non
empty label_token_ids is now refused with a message naming the route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 645286bb35 proxy: abort an abandoned /v1/messages answer instead of draining it
The proxy believed the engine's Anthropic route ignores x-override-rid,
so an abandoned Claude Code answer was drained, decoding for nobody for
up to DRAIN_MAX_S (900 s). In v0.5.19, v0.5.21 and the flash nightly that
route builds its request through the chat route's
_convert_to_internal_request, which applies the header. The proxy now
imposes its rid on /v1/messages and aborts with it once a chat stream has
proven that the engine honours it; an Anthropic stream, whose msg_ id is
no rid, never decides that proof.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 476abea860 proxy: a budget for the request bodies in flight at once
MAX_BODY_BYTES capped one body and nothing capped them together: each is
read whole and parsed again by the guards, so a few legitimate bodies
near the cap reached the unit's MemoryMax=1G at once, where the kernel
killed the proxy and every stream in flight. Past BODY_BUDGET_BYTES
(384 MiB) a body is not read and gets a 503 with Retry-After; a body
arriving when none is in flight is always read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 95e4c87c3e proxy: judge an uncountable body by the bound where a wedge is possible
A body the engine's count routes could not take (native /generate
fields, /v1/responses' input) was judged by the 2.5 bytes a token
average, so a body of digits, one token each, went past the limit
uncounted, into the zone the engine queues and never admits. The native
/generate shape is now counted (ids count themselves, text is a prompt)
and what still cannot be counted is judged by the one byte a token bound
where a wedge is possible; elsewhere the average decides as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 fa649a12bf proxy: charge a video its ceiling where a prompt can wedge the engine
The oversize guard charged a video a flat 4,096 tokens, where SGLang's
own video sizing (768 frames, VIDEO_TOTAL_PIXELS) lets one cost about
88,000, and a body of a dozen video URLs is a few kilobytes that the
byte estimate never nominated for a count. Where a wedge is possible,
each video part now adds its ceiling to the nomination and to the count,
so such a body is counted and refused as too long; lanes whose engine
refuses past its own window keep the flat budget and see no change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 4a41148083 proxy: bound the token ids of /v1/score's query and items
/v1/score takes token ids in query (List[int]) and items
(List[List[int]]), which index the embedding as input_ids do, but the
route was not in SAMPLE_GUARD_ROUTES, so a negative id or one past the
vocabulary went to the engine unread and could take the scheduler down
for every client. The route is now guarded like the others; text items
are left alone whatever their characters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 55f363adaa proxy: relay engine redirects instead of following them, mask /server_info/
urllib's default handler followed an engine redirect on a GET, resending
the engine's key, and the answer went out under the path the caller had
asked for, the one that decides the /server_info masking: /server_info/
came back 307 to /server_info, was followed, and was relayed unmasked.
Engine redirects are now relayed with a Location that points back at the
proxy, and the masking ignores trailing slashes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 c2787090d5 proxy: bound the connections a peer on the network can hold open
Every connection held a thread and a descriptor for up to CLIENT_IO_S
(900 s) before its request line was read, with nothing counting them, so
any peer reaching the port without a key could exhaust the descriptors
and lock every client out. Connections from other machines now count
against a ceiling per address (PROXY_MAX_CONN_PER_ADDRESS, 64) and one
for the network (PROXY_MAX_REMOTE_CONN, 256), and past either the new
connection is closed before a thread starts, as the cockpit's relay does.
Loopback is not counted, so clients on the box keep the port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 ff4fb96bc8 proxy: a listed client key no longer reaches the engine's operator routes
Behind the identity wall the proxy signs every relayed request with the
engine's own key, so any listed client key could reload or update the
weights, start the profiler, pause or slow the engine, flush its cache or
abort every request, as the operator. A listed key now reaches an allow
list (everything under /v1/, the native generation routes, counting,
server info, health and metrics) and gets a 403 elsewhere. The cockpit
calls the engine's operator routes on 127.0.0.1:30000 directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:11:24 +02:00
Hasan BasbunarandClaude Opus 5.5 7bde03776a proxy v6.40: Bolt's reasoning levels in its template's words
Bolt's template reads enable_thinking and medium_effort, and no reasoning effort:
a reasoning_effort of none sent to the engine as it came left the answer inside
the reasoning, its content null (measured, 2026-10-15). On the Nemotron lane the
proxy says each level in those words, none and minimal off, low and medium the
shorter reasoning, high and above the default; a request that names
enable_thinking keeps its choice, and every other lane gets its request as it
came. Its unit holds requests for this lane too while it boots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 08:46:58 +02:00
Hasan BasbunarandClaude Opus 5.5 5d480f9009 proxy v6.39: an engine that is not vLLM gets SGLang's routes again, and not the vLLM pool
v6.39 noted that the engine has neither of SGLang's info routes and asked them no more until an
engine started again. A proxy told no unit to watch (PROXY_HOLD_UNITS unset) sees no start: when
an SGLang lane took the port after Kolibri, every read of its pool went vLLM's way and found no
vLLM gauge, so the guard kept the vLLM engine's pool, too large a limit for this engine. The
short cut holds only while the engine read last says it is vLLM, and the read that finds another
one drops what was read from the vLLM engine (invalidate_pool): the next read asks /server_info.
_server_info falls back to /server_info when no route is noted, since served_models can learn
the engine changed before a pool read does. Found in review, 2026-10-14, and in the review of
the fix the same day; the test fails on the commit before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 16:13:30 +02:00
Hasan BasbunarandClaude Opus 5.5 e906eb7d0d proxy v6.39: an engine without SGLang's info routes is not asked them again
On the Kolibri lane (vLLM), every read of the pool began with /server_info and /get_server_info,
two 404s, and the hold's probe asked /server_info each time it looked. The proxy now notes that
the engine has neither, reads vLLM's own facts at once, and probes /health there, which on vLLM
generates nothing; any new engine (a restart, a lane switch) is asked again. The test fails on
v1.29.1 (four 404s for two reads; two now).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 13:31:41 +02:00
Hasan BasbunarandClaude Opus 5.5 b0d53d45df proxy v6.38: the client's key reaches the engine without the spaces around it
The production checks run after the update to v1.29.0 sent the key twelve ways through the
proxy, and "Bearer <key> " (a space after it) passed on a Qwen lane and got a 401 on the Kolibri
lane. The spaces around a header's value are not part of it (RFC 9110, 5.5) and SGLang reads it
so; the proxy forwarded the header as it came, and vLLM's own check, like the lane's middleware,
compares the value exactly. The proxy now forwards the client's value without the spaces and
tabs around it; two spaces inside are still refused everywhere. The tests' fake vLLM checks the
key as vLLM does, and the test fails on v1.29.0. Measured on the box with the new proxy beside
the production one: 24 of 24 answers as on the Qwen lanes, against 22 through v6.37.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 13:16:40 +02:00
Hasan BasbunarandClaude Opus 5.5 2d6515b4ea proxy: a reasoning effort of "none" turns thinking off on a Qwen lane
The clients set up for the Kolibri lane send "none" for "off" (pi, opencode's none variant,
omp's minimal), and Kolibri's template takes it. The Qwen templates refuse it ("Unexpected
reasoning effort none", a 400), and the proxy let it through as a level SGLang's enum knows:
a client left on kolibri-1 broke on the next Qwen lane, against docs/clients.md's promise
that a client set up for one lane keeps working on another (found in review, 2026-10-14).
On SGLang, "none" (top-level or in chat_template_kwargs) is relayed as enable_thinking
false, the way those templates turn thinking off; on vLLM and on any doubt the body goes
as it came. It is decided again after a hold, with the rename. The test fails on the code
before for the Qwen lanes and passes for Kolibri on both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 09:46:14 +02:00
Hasan BasbunarandClaude Opus 5.5 65dff62196 proxy: a Kolibri stream ends as vLLM's, and the shutdown touches no other connection
Two findings of the review (2026-10-14), both reproduced. A pool read that failed on the
way to the engine dropped the lane's facts, the request went out with no engine noted, and
a client that left was handled as on SGLang: an /abort_request vLLM answers 404, then a
drain of up to DRAIN_MAX_S while vLLM kept generating; _open now reads which engine serves
when nothing says it. _shut_upstream took the answer's socket number and shut down a
duplicate of it: the pump can close the answer in between, and the number then belongs to
whatever socket opens next, which was shut down instead; the connection now keeps its
socket object (a closed one has no number left). Both tests fail on the code before. Two
more pin what the suite let mutate: the engine's middleware opens /health and /metrics
exactly, not /healthz or /metricsx, and a proxy that names no unit drops the vocabulary
when another engine names itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 09:36:03 +02:00
Hasan BasbunarandClaude Opus 5.5 b4cc1c12fa proxy: the rename and the vocabulary probe read the names where they are said
route_model_name read the cached pool to learn which engine serves. One failed read of
/v1/models drops the names and keeps the pool, and the pool then named nothing: vLLM
answered 404 to every request under another name until the pool expired. The vocabulary
probe named "probe" until something had read the names, which vLLM refuses with a 404
before it looks at logit_bias, and the guard went 60 s without a vocabulary right after
every switch. Both now read the names (served_models, kept 600 s); with nothing answering,
the probe is not sent and the failure is kept as before. Two tests fail on the code before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 09:21:41 +02:00
Hasan BasbunarandClaude Opus 5.5 8cc458f48d proxy v6.37: the served name on every attempt, the engine's end at once
Found in review and reproduced against a fake vLLM, each with a test that fails on the
proxy before it: a request held through Kolibri's boot went with its old model name
(the rename ran once, before the hold), and so did the first request after a switch
nobody asked about (the last lane's facts stayed 600 s); the rename now runs on every
attempt, after the unit's start is looked at. A client leaving a stream during its
prefill reached vLLM only with the first token: close() waited for the pump's read, so
the socket is shut down first, through the answer's own descriptor (urllib asks
Connection: close, and the connection gives its socket up). The engine a request went
to is noted when it goes, so a dropped fact no longer sends an abandoned Kolibri
stream down SGLang's /abort_request and drain. A unit that starts again drops the
vocabulary and the rid rule learned of the engine before. /invocations is renamed too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 06:16:59 +02:00
Hasan BasbunarandClaude Opus 5.5 4009a2f849 proxy: no SGLang advice in a vLLM lane's journal
On the reference box the Kolibri lane's first stream logged "this engine ignores
x-override-rid (start it with SGLANG_ENABLE_REQUEST_HEADER_OVERRIDES=1)": a wrong lead,
since on vLLM the rid is never used and closing the connection stops the request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 04:10:38 +02:00
Hasan BasbunarandClaude Opus 5.5 d83f8c6ea5 proxy v6.37: serve a vLLM lane behind the same door
The Kolibri lane runs vLLM 0.29.0, and four things the proxy assumed of SGLang are not true
there, each measured against the real engine on 2026-10-14:
- no /server_info: the pool is the kv_cache_size_tokens label of /metrics' cache_config_info
  and the window /v1/models' max_model_len (without them every body past 256 KiB was held
  as "not measured yet" for good);
- a model it does not serve is a 404: a body naming another model gets the served one, so a
  client set up for one lane keeps working on this one (SGLang bodies are never touched);
- a closed connection stops the request (no /abort_request): closing replaces draining;
- the vocabulary probe needs the served name and reads vLLM's wording (128,000 tokens).
What was learned of one engine (vocabulary, x-override-rid) is dropped when another names
itself; System One says it needs a Qwen lane. PROXY_HOLD_UNITS names the Kolibri unit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 03:10:07 +02:00
Hasan BasbunarandClaude Opus 5.5 134d87e07c cockpit canary waits for a client that just started; the proxy leaves /ready open as the engine does (v1.26.1)
The canary was sent when the fast collector's last load read, seconds old, said idle: a
client's 77,887-token prompt that started in that gap had it queue behind a 58-second prefill
and time out, a failed probe the wedge rule counts and an abort the Traffic view counted
(reference box, 2026-10-11). The cockpit now reads the engine's load again right before the
probe and stays out when a request runs; a read that fails leaves the probe to go as before.

The engine's auth rule opens /health, /ready and /metrics by prefix; the proxy's door had
/health and /metrics, so /ready got 401 through the proxy and 200 from the engine. The door
opens /ready the same way (proxy v6.36); /readiness, not under /ready, still needs the key,
as at the engine. SECURITY.md and docs/clients.md updated.

Tests: the canary stays out for a client that started since the last read, and goes when the
read fails; /ready passes the door, /readiness does not. The first and the third fail on
v1.26.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 10:16:36 +02:00
Hasan BasbunarandClaude Opus 5.5 985745719e keepalive-proxy v6.35
The version, and what it changes, in the proxy's own history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:19:42 +02:00
Hasan BasbunarandClaude Opus 5.5 b8306bac8a proxy: a lane switch is followed at once, request or not
The pool, the window and the names the proxy reads from the engine were kept 600 s and
dropped only by a request that found the engine gone. After a switch made while no request
came, a lane that boots in less than 600 s served its first minutes under the stopped lane's
facts: the 27B (about 7 min to boot on the reference box) refused every prompt past the
flash lane's 250,000 ceiling for up to 2.5 min, and /v1/systemone answered as the flash
(2026-10-08). The units PROXY_HOLD_UNITS names are now asked for their invocation id when
those facts are read, at most every 2 s, and a new one, which systemd gives every start,
drops them. A proxy that names no unit, or a systemd that does not answer, keeps them their
600 s. The hold tests' systemctl answers that question with ids that never change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:19:38 +02:00
Hasan BasbunarandClaude Opus 5.5 e051c57362 keepalive-proxy v6.34
The version, and what it changes, in the proxy's own history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:01:57 +02:00
Hasan BasbunarandClaude Opus 5.5 206bc50645 docs: the pool wedge is this box's own measurement, not sglang#36333
sglang#36333 is about a request left running after its client disconnects; SECURITY.md,
docs/clients.md and a proxy comment gave it as the reason a prompt past the pool wedges
the scheduler. The wedge was measured on the reference box (2026-08-29).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:01:57 +02:00
Hasan BasbunarandClaude Opus 5.5 0b27e26d99 proxy: the serving key is checked before a body is read
Without the identity wall, the engine's key is the port's one gate (README), and a
request without it still had its body read whole and, when large, counted by the
engine on the proxy's own key before the engine's 401. The proxy now applies the
engine's own rule first (measured on the live engine: bearer in any case, one space,
the key exactly) and answers the engine's own 401, before the body and before an
Expect: 100-continue invitation; /health and /metrics stay open. The test harnesses
decide which key their proxy holds, whatever HOME holds: those that give it one
present it, as every real client does, and those whose clients send none give it
none (the CI's offline step gives HOME a key). The cockpit knows the new outcome.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:01:56 +02:00
Hasan BasbunarandClaude Opus 5.5 421ae7dd61 proxy: count the prompts that could wedge the lane, by their bound
Where the engine accepts a prompt past the share of its pool this guard lets through
(the 27B lane: 863,638 accepted, 794,552 usable, measured 2026-10-08), a body is
nominated by its bound, one byte a token, not by the 2.5 average that let digit-heavy
text through uncounted; nothing under 200 kB was looked at, whatever the pool. Where
the engine's window is under that share (the flash lane), it refuses past it itself and
the average nominates as before: counting there was measured at +115 ms for a lone
300 kB prompt and +1.65 s for eight at once. A body the engine cannot count is judged
as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:01:56 +02:00
Hasan BasbunarandClaude Opus 5.5 f9c0fd0729 proxy: refuse token_ids_logprob where the engine reads it
On a batch that mixes a request asking for token_ids_logprob with one that does not,
the served 27B build (v0.5.19) fills a bare list for the one that did not ask and
calls .tolist() on every entry: its scheduler dies (sglang#34719, open). Refused at the
top of a /generate body and in the parameters of /vertex_generate, the only places the
engine reads it; a value the engine treats as absent passes, the OpenAI routes are not
touched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:01:56 +02:00
Hasan BasbunarandClaude Opus 5.5 5160039f32 proxy: a System One call gives its slot back to the door it took it from
The admission slot was released on whatever _systemone_calls named at release time.
Rebound while a call was in flight (only tests do), the new door was credited with a
slot it never gave and served a call it had to refuse: the admission-cap test failed
about one run in five once every System One request read the pool. The call now gives
its slot back to the door it took it from; a deterministic test fails on every run
without that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:01:56 +02:00