One thread per connection plus max_inflight upstream slots; further requests wait in
line (queue_timeout) instead of being refused. A waiting caller that asked for a
stream is told why it waits with SSE comment lines (': junction: waiting for a free
slot (0 ahead of you)'), which the spec says every parser must ignore — a human
watching curl sees progress, a client sees nothing it could misinterpret. The real
answer then starts in the same stream and the comments simply stop.
Trade-off, stated in the README: a streaming caller gets its 200 before the upstream
is chosen, so a later upstream failure cannot be an HTTP status any more — it travels
as a data: {"error":...} event. Non-streaming callers get nothing injected and keep
their true status code.
Also: cache and endpoint state are locked (they are shared between threads now), and
the test stub forks per connection — a serial stub made a concurrent router look
serialised, which is exactly the kind of test that lies.
'need' now reads only max_tokens/max_completion_tokens as the client wrote them.
chars_per_token and default_max_tokens are gone (and rejected as unknown keywords, so
an old config fails loudly instead of steering nothing). A request that declares no
budget is not sized at all — the guessing is what made a 2048-context embedding
endpoint reject requests that carried no token budget in the first place.
tests: 'need' proven from a declared max_tokens, and a request without one proven to
route by model and path alone.
The sleeping box is the one on n95's own segment; a tunnel peer needs a wake hook
that talks to that side. Also marks the LAN address as a placeholder.
- A rule may send a different model name per target: 'pass peer-a as M, peer-b, cloud'
rewrites only for peer-a, so a mixed local/cloud rule still asks the cloud for the
name the client wanted.
- examples/olivia.conf: peers on the tunnel, embedding box, sleeping workstation with
WoL + energy gate, cloud fallback, and the policy rules each with its reason.
- tools/junction-wol.c replaces the Python magic-packet helper; hooks stay shell.
- Forwarding no longer duplicates Host/Content-Length/X-Forwarded-*: Ollama answered
400 to a request that was valid because it arrived with two Host headers.
- need_tokens: embeddings produce a vector, not tokens, so they are not charged
default_max_tokens (a 2048-context embed endpoint refused every request).
- /status lists every target with its model, plus the rule's need window.