Commit Graph
148 Commits
Author SHA1 Message Date
Jeremy Fowers 606eea88b1 Retry automatic registry selection when unknown 2026-11-20 10:27:52 -05:00
Jeremy Fowers 45b20a88bd Wait for the initial automatic registry decision 2026-11-20 10:07:45 -05:00
Jeremy Fowers f17a0add6a Add automatic model registry selection 2026-11-20 09:46:20 -05:00
Jeremy FowersandClaude Opus 5.5 9a24b5eee5 ci: sign the Windows embeddable archive in the same SignPath request as the MSIs (#4219)
A new bundle job merges both MSIs and the Windows embeddable zip into one
artifact, and sign-windows-release submits it under the `windows-release`
artifact configuration, so a release still needs a single SignPath approval.
The release job publishes the signed zip for stable releases and the
unsigned one for candidates.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-20 02:25:38 +00:00
Piotr Wilkin (ilintar)andClaude Opus 5.5 f21b6e2ebb feat: add jobs for all operations besides chat completion to the job engine (#2766)
* feat: add jobs for all operations besides chat completion to the job engine

* fix(jobs): cancellation, format negotiation, and output cap for media job ops

Address review feedback on the new image/audio/3D job ops:

- Propagate cancellation through the Router and backend HTTP request: image
  ops bind the request cancel flag (post/post_multipart now abortable) and
  streaming audio/3D sinks stop accepting data once cancelled; every op checks
  the cancel flag and throws JobError(499, "interrupted").
- audio_speech/audio_generations negotiate and validate response_format against
  the backend's supported formats so the returned MIME/response_format match.
- Cap buffered base64 media output (kMaxJobMediaOutputBytes) so a large result
  cannot bloat jobs.json.
- Tests: drop the no-op assertion, assert op round-trip, add a no-backend
  format-rejection test.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(jobs): forward negotiated audio format and job cancellation to backends

Write the negotiated response_format back into the request for the
audio_speech and audio_generations job ops, so the backend encodes the
format the step output's mime_type reports, including a default the job
never sent.

Bind the job cancel flag as the request cancel token around media job
ops, and pass that token to Trellis' blocking post_multipart() call, so
interrupting a model_3d_generations step aborts the in-flight request
instead of waiting for it to finish.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(jobs): bound media storage and stop failed or cancelled operations

* fix(jobs): enforce retained media budget and cancel speech streams

* fix(jobs): count extracted context copies against the media budget

* fix(jobs): count only the growth when an extract replaces a context value

* fix(jobs): catch error payloads in media streams and bound extract values

* fix(http): let GET honour the request cancel token and pass it through ACE-Step

* fix(jobs): track media-derived extract copies per key instead of capping extracts

* fix(jobs): drop a clobbered key from the media-extract tally

* fix(jobs): normalize speech streaming options and image inputs, keep PCM headers

* refactor(jobs): count stored media bytes and keep bookkeeping out of the API view

* fix(jobs): reject non-base64 URIs, pre-check audio models, and avoid JSON round trips

* docs(jobs): move the job-op guide under docs/dev and update the job-system page

* test(jobs): make the media sink testable and cover its failure paths

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-11-19 09:41:26 +00:00
Francesco Bozzo 64dff4ab7d Run gufo from gufo-org/toolboxes images (#4159)
* Run gufo from gufo-org/toolboxes images

Switch the gufo:rocm container from docker.io/kyuz0/amd-strix-halo-toolboxes
to ghcr.io/gufo-org/toolboxes/gufo-runtime, pinned to the 0.34.0 release,
and allow ghcr.io/gufo-org/ images. The image has no entrypoint and keeps
`gufo serve llm` and its flags, so the launch command is unchanged.
validate_containers.yml already resolves the new image and will move the
pin along gufo-org's X.Y.Z release tags.

* Give non-root container images their files and devices

gufo-org's image runs as 1000:1000, where every image before it ran as
root. Container descriptors can now declare that user, and rootless
Podman maps the account onto it with --userns=keep-id, so files only
their owner can read stay readable. Docker and rootful Podman add the
group of every device node passed in rather than only render, so a
/dev/kfd owned by video stays usable.
2026-11-19 03:22:20 +00:00
Iswarya AlexandClaude b771b4fcc6 RAI 1.9.0 Upgrade (#4188)
* Move ryzenai-llm to ryzenai-server v1.9.0

- Pin ryzenai-llm npu to v1.9.0
- Rebuild the NPU catalog from the 42 amd/*_rai_1.9.0_npu checkpoints
- Drop 12 NPU models with no RAI 1.9 build
- Update the custom-model placeholder checkpoint

* Drop ryzenai-1.7 hybrid models; test hybrid suite on a 1.9 NPU model

* RAI 1.9: NPU-only catalog matching the 1.9.0 collection; test ryzenai on npu only

* test: use a Qwen NPU model for ryzenai tool-call tests

* test(ryzenai): add image/audio tests, fix tool-call failure message, shared media helpers

- Extract _solid_color_png_data_uri into test/utils/media.py so omni and
  llm tests share one copy
- Add test_013b/c/d for image input, streaming image input, and audio
  input (skipped when the backend lacks image_input/audio_input support)
- Register Gemma-4-E2B-it-NPU as the multimodal test model for ryzenai
- tool_calls assertion now prints model content on failure so the next
  flake explains itself

Co-Authored-By: Claude <[email protected]>

* chore: pin ryzenai-server v1.9.0 zip sha256

Co-Authored-By: Claude <[email protected]>

* fix(ryzenai): switch tool-call test model to Llama-3.2-1B-Instruct-NPU

Qwen2.5-3B 1.9 NPU checkpoint produces garbage output after the first
token on STX Halo runners. Llama-3.2-1B-Instruct decodes cleanly and
ryzenai-server now parses its bare-JSON tool-call format.

Co-Authored-By: Claude <[email protected]>

* chore: add hot label to Gemma-4-E4B-it-NPU; remove stale comment

Co-Authored-By: Claude <[email protected]>

* refactor: revert out-of-scope test changes from 1.9 upgrade branch

Remove image/audio tests from server_llm.py — the ryzenai backend does
not declare image_input/audio_input support so they never ran.
Restore server_omni.py to main (PNG helper refactor was unrelated).
Remove dead capabilities.py multimodal model entry.

Co-Authored-By: Claude <[email protected]>

* chore: update ryzenai-server v1.9.0 zip sha256

Rebuilt from 8008518 (Llama 3.2 tool-call parser).

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
2026-11-18 17:07:53 +00:00
fl0rianrandSreeram d906de81ae ci: skip expensive jobs for small docs-only PRs (#2889)
* ci: skip expensive jobs for small docs-only PRs

* ci: port docs-only fast path to current CI graph

* ci: preserve required checks for small docs PRs

---------

Co-authored-by: Sreeram <[email protected]>
2026-11-16 09:55:49 +00:00
Jeremy FowersandClaude Opus 5.5 465b172a61 fix(docs): only re-commit API examples whose response shape changed (#4114)
* Only re-commit API examples whose response shape changed

The recorded examples show the shape of each response, but backend update
PRs re-recorded them on every pin bump and committed whatever values came
back, plus CRLF files from the Windows recording runner. #4106 changed
19k lines with no real content change; #3964 changed 6.5k lines, one of
which was a real shape change.

- Key the example cache on the request only, not the backend pin
- Add --refresh RECIPE: re-run the examples a recipe serves and keep each
  recorded response unless its shape (status, content type, keys, value
  types, SSE event names) changed
- The llama.cpp, sd.cpp and vLLM update workflows pass --refresh
- Force LF for the generated API pages and the cache
- A llama.cpp update run dispatched from a branch opens its PR against
  that branch

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Drop the branch-dispatch PR targeting used to test the workflow

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Fix API example refresh validation and stream shape comparison

* Address remaining API example refresh review feedback

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-11-15 20:18:32 +00:00
b0e01c7bf4 feat(backends): Add description and author metadata to backends for display in the CLI and GUI (#4059)
* feat(backends): describe each backend's purpose, author, publisher and license

Each descriptor now carries an \bout\ entry per backend: a one- or
two-sentence description, the author who wrote the engine or fork, the
publisher who builds the artifact Lemonade installs, the license, and a
link to the project. For example, llamacpp:nathanw is authored by NathanW
(Nathanw1014) and published by Donato Capitella (kyuz0).

- /system-info reports the fields on every backend entry.
- \lemonade backends info RECIPE:BACKEND\ prints them with the backend's
  tier, format and status. Backends the server's OS cannot run, which
  /system-info omits, are described from the CLI's own descriptors.
- \lemonade backends\ ends with a tip pointing at \ackends info\.
- The app's backend cards show the author (linked to the project) beside
  the version, the description, and the publisher and license.
- BackendContractsTest fails a support row with no description, author,
  publisher or https project URL, and an entry naming no support row.

Implements discussion #4010.

Co-authored-by: Cursor <[email protected]>

* fix(app): show 'License: Not declared' on backend cards when license is empty

Co-authored-by: Cursor <[email protected]>

* docs(backends): note that backend metadata describes upstream for binaries Lemonade did not install

Co-authored-by: Cursor <[email protected]>

* Address halogen comments

* feat(app): show backend format (native, python, container) on backend cards

Each variant on a backend card now carries a pill naming its format from the descriptor, which /system-info already reports. Hovering it explains how that format runs.

Co-authored-by: Cursor <[email protected]>

* Address Florian feedback

Co-authored-by: Cursor <[email protected]>

* Keep upstream-binary note in route schema and pass API key to CLI tests

Co-authored-by: Cursor <[email protected]>

* Regenerate models.js after Halogen display-name rename

Co-authored-by: Cursor <[email protected]>

* Apply batched suggestions from code review

Co-authored-by: Jeremy Fowers <[email protected]>

* Shorten project_url schema text and drop 'most' from Vulkan descriptions

Co-authored-by: Cursor <[email protected]>

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Jeremy Fowers <[email protected]>
2026-11-05 23:57:45 +00:00
Satya Devineni 11a3ea0ac5 feat(backend): FLM 1.0.11 decision models support (#4037)
* main into zero shot, post refactoring

* cleanup

* cleanup

* CR feedback: fixed the residency document clarification bug

* cr feedback: fake tests with propoer assertions

* stacks on the zero shot work in 3952

* pr feedback: better policy checks and logging for backend failures

* pr feedback: adding on_truncation

* pr feedback: adding the truncation support for classifier and fixing documentation issues

* CI fix and doc enhancement

* pr feedback: fixed edge cases

* added check for 0.3.7 truncated verification

* pr feedback: router validation and argument handling

* Added the example lfm2 ONNX model

* pr feedback: added max-length and 3 flag truncate flags

* pin bump to 0.4.0 and more tests for zero-shot

* CI fix

* pr feedback: model level filtering

* PR Feedback: CR feedback

* restricting decision models based on model family. 8k context limit by default for encoder decision models

* checks at router level to reject wrongly labeled systemone models with 400

* systemone support through FLM 1.0.11

* added truncation FLM check

* pr feedback: truncated is set to false and better error handling with input lengths

* pr feedback: default set to 4k, limits passed down by llama-server, truncated  is added to systemone

* truncated documentation

* pr feedback: checks the token count instead of the template

* missing tests

* CI bugs
2026-11-05 00:01:33 +00:00
Michele Balistreri 6c5a26aeb8 Remove image_defaults and audio_defaults (#4049)
* remove image defaults

* remove audio defaults

* add typed option accessors

* address review comments

* align documentation to changes

* add user_configurable concept for recipe options

* address review comment

* never show hidden fields

* retrigger-ci
2026-11-04 13:21:01 +00:00
Satya Devineni d397a6e8fa Add SystemOne decision models: /v1/systemone, GGUF zero-shot on /v1/classify, and the systemone router classifier (#3956)
* main into zero shot, post refactoring

* cleanup

* cleanup

* CR feedback: fixed the residency document clarification bug

* cr feedback: fake tests with propoer assertions

* stacks on the zero shot work in 3952

* pr feedback: better policy checks and logging for backend failures

* pr feedback: adding on_truncation

* pr feedback: adding the truncation support for classifier and fixing documentation issues

* CI fix and doc enhancement

* pr feedback: fixed edge cases

* added check for 0.3.7 truncated verification

* pr feedback: router validation and argument handling

* Added the example lfm2 ONNX model

* pr feedback: added max-length and 3 flag truncate flags

* pin bump to 0.4.0 and more tests for zero-shot

* CI fix

* pr feedback: model level filtering

* PR Feedback: CR feedback

* restricting decision models based on model family. 8k context limit by default for encoder decision models

* checks at router level to reject wrongly labeled systemone models with 400

* pr feedback: default set to 4k, limits passed down by llama-server, truncated  is added to systemone

* truncated documentation

* pr feedback: checks the token count instead of the template
2026-11-04 05:34:34 +00:00
f5b11c6ddd feat(gufo): add the Gufo container backend (#4031)
* feat(backends): run container backends through ContainerManager, starting with llamacpp:nathanw

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): list every missing setup step and ask for consent at install

Container setup now reports what a user still has to do in one pass,
in the order they do it, and the CLI finishes the install once only
consent is left.

- Setup checks run in two groups. Before consent: the container tool
  on PATH, then the video/render groups (or the Docker socket), then
  enable_containers. These read only PATH, groups and sockets, so no
  container command runs before the user opts in; Podman counts as
  rootful when CONTAINER_HOST is set or lemond runs as root, until
  podman info answers. After consent: podman info, then SELinux.
- Every failed check is reported at once. /system-info gives one
  problem per line in message, numbered steps in action (install
  commands, group changes, enable_containers, and logging out last),
  and the failed checks' ids in setup_checks.
- lemonade backends prints message and action lines side by side.
- lemonade backends install, run and load check the backend's setup
  before installing or downloading anything. When enable_containers
  is the only step left, they show the existing warning, enable it on
  yes and finish the command; backends install --yes skips the prompt.
  Otherwise they print every problem and step and exit 1.
- The spec, user guide, CLI and API docs follow the new order and
  fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* fix(cli): read the selected backend only when recipe options were given

lemonade run and load without a --<recipe> option have no recipe
options, and reading the backend option from them aborted the CLI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* style(containers): trim the setup comments the comment-slop hook flagged

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* ci(containers): gate the container smoke test like the other hosted test jobs

The signing and release-branch skips exist to spare self-hosted runners;
the smoke test runs on ubuntu-latest.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(containers): pin the container smoke test to Ubuntu 24.04

The job installs the 24.04 .deb on the bare runner, and ubuntu-latest moves
to 26.04 in November 2026, where libmbedcrypto7t64 does not exist. The
comments now say why the job runs on the bare runner and needs the PPA.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): assert lemond's mode in the smoke test and log at debug

test_03 now checks the published port on lemond's container, so each leg
proves lemond detected the intended mode, not only that the tool runs in it.
LEMONADE_CI_MODE puts llama-server's output in the uploaded logs, as in the
other jobs that start lemond.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci: say why backends-gate also lists jobs that run on every PR

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): cut the container spec changes back to what the implementation made false

Keeps the opt-in invariants (off by default, install and load refused while
off, no container command before opt-in), rootful Podman's connection path,
the Podman answers check, and reporting every failed check at once. Drops
setup_checks, action ordering, CLI prompting, and the expect_rootless detail.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): name the enable warning instead of quoting it

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(llamacpp): list nathanw as a guest backend, as its descriptor declares

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(cli): word the enable_containers prompts as enabling containers, not backends

The setting enables every container, whatever its tier, so the warning no
longer calls the images community-built.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(backends): drop the image allowlist comment from ContainerPolicy

ContainerManager::allowed_image is the allowlist; the comment restated it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* refactor(containers): leave GPU selection and the SELinux check to the first ROCm container backend

llamacpp:nathanw maps only /dev/dri, so nothing here reached the
HIP_VISIBLE_DEVICES lookup or the SELinux check, both gated on /dev/kfd.
needs_gfx1151_cwsr_fix goes back to its own KFD read.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): drop checks that restate code, and mount single files only

The directory mounts serve Halogen's tokenizer and move to that PR; here
every model file llamacpp names is a GGUF.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): take the smoke test's backend as --backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): leave Podman and Docker alone while enable_containers is false

With containers disabled, lemond no longer sweeps at startup, connects to
the Docker socket, runs `image inspect`, or removes images on uninstall.
Setting enable_containers to false unloads every model running in a
container first, so none is left that a later crash would orphan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015BUXEd42tPQH67MQPW1XZh

* Update to a modern pin

* refactor(containers): drop the startup sweep

A killed lemond's containers already stop and remove themselves: the
attached `run --rm` child gets SIGTERM from PR_SET_PDEATHSIG and proxies it
into the container. Verified with Docker and rootful/rootless Podman. The
smoke test now kills lemond with a model loaded and checks no container
remains.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(load): list nathanw among the llamacpp_backend choices

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* ci(containers): cap the Dispatch container job at 45 minutes

A hung job would otherwise hold a pool machine for up to 4 hours.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* test(containers): skip the killed-lemond check under rootful Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(containers): link container images to their registry pages

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): skip the killed-lemond check under rootful Docker too

The Docker daemon owns the container, so whether it stops after lemond is
killed depends on the docker client forwarding SIGTERM in time, which is
racy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5SJqLuAuPwGaJQvWTwMai

* refactor(containers): drop the enable_containers setting

Container backends no longer need an opt-in before they install or
load. The setup assistant's remaining checks still report what is
missing.

- Remove the config key, its validation, getter and config effect.
- Remove the CLI consent prompt and pre-flight check, and the --yes
  flags on `config set` and `backends install` that only served it.
- Always check the Docker socket, read the image on disk for installed
  state, and remove the image on uninstall.
- Remove helpers left unused: containers_enabled,
  Router::get_container_model_names, WrappedServer::runs_in_container,
  ServerProcess::in_container.
- Update the spec, guides, generated API docs, tests and CI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* perf(containers): run container setup checks once per system-info build

The checks are host-wide, so every container backend got the same
report while each one ran them again, `podman info` included. Drop the
unused recipe and backend parameters from container_setup_failure and
compute its report at most once per pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* test(containers): fail when listing labeled containers or networks fails

A failed `ps` or `network ls` printed nothing, so the checks that expect
no leftovers passed without listing anything.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* feat(containers): run container backends from lemond.service with rootless Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): create Podman networks without a DNS server

Every model load failed under lemond.service with Podman 5 (Fedora 43/44,
Ubuntu 26.04, Debian 13):

  netavark: error while applying dns entries: aardvark-dns failed to start:
  Failed to connect to user scope bus via local transport

`podman network create` turns DNS on by default, and rootless netavark
(1.14 and later) starts aardvark-dns with `systemd-run --scope --user`, which
needs the account's systemd user manager. The lemonade system account has no
login session, so it has none.

Each per-model network holds one container, and lemond reaches it through
its published port or inspected address, never by name, so the network
needs no DNS server. Docker has no such option and is unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): let rootless Podman keep its runtime state in the host's /tmp

Every model load failed under lemond.service on Ubuntu 26.04 and Debian 13:

  Error: setting up Pasta: pasta failed with exit code 1: Couldn't open PID
  file /run/lemonade/containers/networks/rootless-netns/rootless-netns-conn.pid:
  Permission denied

Podman 5 sets up rootless networking with pasta, under $XDG_RUNTIME_DIR, which
the unit set to /run/lemonade. The AppArmor profile Ubuntu and Debian ship for
pasta allows writes only under /tmp, /run/user/<uid> and home directories under
/home, so it denied the PID file. ProtectHome=yes hides /run/user, and the
account has no login session to create /run/user/<uid> in any case.

With XDG_RUNTIME_DIR unset, Podman uses its own fallback in /tmp
(/tmp/storage-run-<uid>, or /tmp/containers-user-<uid> on Podman 4), which the
profile allows and Podman's own tmpfiles.d exempts from age-based cleanup.
lemond's own runtime directory stays /run/lemonade, through RuntimeDirectory=.

PrivateTmp goes with it. In a private /tmp, `podman` run as lemonade from a
shell finds no runtime state, and Podman 5 then refreshes the shared database:
the running container drops out of lemond's view, `podman stop` reports no such
container, and the engine keeps holding the GPU until the service stops.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(debian): create /var/lib/cni at install

On Ubuntu 24.04, every model load under lemond.service failed until the host
next rebooted:

  Error: unable to find network with name or ID lemonade-<...>: network not found

Podman 4's rootless network namespace bind-mounts a private directory over
/var/lib/cni, or, while that does not exist, over its nearest existing parent,
/var/lib. That mount hid /var/lib/lemonade, the lemonade account's home, which
holds its Podman storage and network configs, so `podman run` found no network
that `podman network create` had just made. Podman's own tmpfiles.d creates
/var/lib/cni only at boot (`D!`), so a fresh install hit this until a reboot.

The package now ships the directory in tmpfiles.d, which dh_installtmpfiles
applies at install. The .rpm keeps lemonade's home in /opt, and Podman 5 makes
no such mount, so neither needs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): keep DNS on rootful Podman's per-model networks

Podman 4's CNI backend gives an --internal network created with
--disable-dns no gateway, so the host has no route to the container and
rootful lemond, which connects at the container's address, waited on
llama-server until the test timed out. Only rootless Podman needs DNS
off, and it reaches the container through a published port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(ds4): move ds4:rocm to a container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): pick the ROCm container's GPU and check SELinux for /dev/kfd backends

ds4:rocm is the first container backend that maps /dev/kfd. Its container
gets HIP_VISIBLE_DEVICES for the GPU lemond sized it for, read from the KFD
topology next to system_info's other KFD reads, and hosts with SELinux
enforcing must allow containers to map GPU devices.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(containers): restore the Dispatch container job's 4-hour timeout

Four ds4 jobs downloading DS4's 81 GB checkpoint at once on fresh Dispatch
machines each ran past 45 minutes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(containers): run container backends from lemond.service with rootless Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): create Podman networks without a DNS server

Every model load failed under lemond.service with Podman 5 (Fedora 43/44,
Ubuntu 26.04, Debian 13):

  netavark: error while applying dns entries: aardvark-dns failed to start:
  Failed to connect to user scope bus via local transport

`podman network create` turns DNS on by default, and rootless netavark
(1.14 and later) starts aardvark-dns with `systemd-run --scope --user`, which
needs the account's systemd user manager. The lemonade system account has no
login session, so it has none.

Each per-model network holds one container, and lemond reaches it through
its published port or inspected address, never by name, so the network
needs no DNS server. Docker has no such option and is unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): let rootless Podman keep its runtime state in the host's /tmp

Every model load failed under lemond.service on Ubuntu 26.04 and Debian 13:

  Error: setting up Pasta: pasta failed with exit code 1: Couldn't open PID
  file /run/lemonade/containers/networks/rootless-netns/rootless-netns-conn.pid:
  Permission denied

Podman 5 sets up rootless networking with pasta, under $XDG_RUNTIME_DIR, which
the unit set to /run/lemonade. The AppArmor profile Ubuntu and Debian ship for
pasta allows writes only under /tmp, /run/user/<uid> and home directories under
/home, so it denied the PID file. ProtectHome=yes hides /run/user, and the
account has no login session to create /run/user/<uid> in any case.

With XDG_RUNTIME_DIR unset, Podman uses its own fallback in /tmp
(/tmp/storage-run-<uid>, or /tmp/containers-user-<uid> on Podman 4), which the
profile allows and Podman's own tmpfiles.d exempts from age-based cleanup.
lemond's own runtime directory stays /run/lemonade, through RuntimeDirectory=.

PrivateTmp goes with it. In a private /tmp, `podman` run as lemonade from a
shell finds no runtime state, and Podman 5 then refreshes the shared database:
the running container drops out of lemond's view, `podman stop` reports no such
container, and the engine keeps holding the GPU until the service stops.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(halogen): add the Halogen Flash container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(debian): create /var/lib/cni at install

On Ubuntu 24.04, every model load under lemond.service failed until the host
next rebooted:

  Error: unable to find network with name or ID lemonade-<...>: network not found

Podman 4's rootless network namespace bind-mounts a private directory over
/var/lib/cni, or, while that does not exist, over its nearest existing parent,
/var/lib. That mount hid /var/lib/lemonade, the lemonade account's home, which
holds its Podman storage and network configs, so `podman run` found no network
that `podman network create` had just made. Podman's own tmpfiles.d creates
/var/lib/cni only at boot (`D!`), so a fresh install hit this until a reboot.

The package now ships the directory in tmpfiles.d, which dh_installtmpfiles
applies at install. The .rpm keeps lemonade's home in /opt, and Podman 5 makes
no such mount, so neither needs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(ds4): move ds4:rocm to a container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(halogen): read the gfx1151 KFD node through system_info and report the setup steps

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(rocmfpx): add the ROCm FPX container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): keep DNS on rootful Podman's per-model networks

Podman 4's CNI backend gives an --internal network created with
--disable-dns no gateway, so the host has no route to the container and
rootful lemond, which connects at the container's address, waited on
llama-server until the test timed out. Only rootless Podman needs DNS
off, and it reaches the container through a published port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(containers): pick the ROCm container's GPU and check SELinux for /dev/kfd backends

ds4:rocm is the first container backend that maps /dev/kfd. Its container
gets HIP_VISIBLE_DEVICES for the GPU lemond sized it for, read from the KFD
topology next to system_info's other KFD reads, and hosts with SELinux
enforcing must allow containers to map GPU devices.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): mount a model directory one file at a time, for Halogen's tokenizer

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci: keep container backend images on the newest build of their tags

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(api): regenerate for the rocmfpx section

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* fix(app): show container setup steps in a collapsible section

The Setup guide button passed `action` to window.open, but lemond's
`action` holds a command, steps, or a link. A non-link action now shows
as a "Setup required" disclosure with the failure message and steps,
regardless of the technical-details toggle; links keep the button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check GPU device access instead of video/render membership

Desktop distros such as Ubuntu and Arch grant the logged-in account
/dev/kfd and /dev/dri access through ACLs, so an account outside video
and render could use the GPU yet was told to fix its groups. The setup
check now tests read/write access to /dev/kfd and each render node.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): ask Podman its mode before the host check

container_setup_failure() ran check_host() before check_podman(), so the
first pass after startup guessed rootless and could report a GPU access
failure on rootful Podman that the next pass cleared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check Docker with docker info instead of a fixed socket

The socket probe only looked at /var/run/docker.sock, so DOCKER_HOST,
Docker contexts and Docker Desktop's socket read as a refused account.
docker info follows the CLI's own connection, and its answer also
identifies Docker Desktop and rootless Docker, which cannot run
container backends, so those now get Podman as the fix step. The spec's
device-node rows now describe the access check instead of group
membership.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(lemond.service): keep PrivateTmp and give Podman's private /tmp state to tmpfiles.d

04919f697 turned PrivateTmp off for every lemond.service user, containers or
not, raising systemd-analyze security exposure from 8.5 to 8.7. Its reason was
`podman` run as lemonade from a shell: in the host's /tmp it finds none of the
service's runtime state, and Podman 5 then refreshes the shared database, so
lemond loses track of its running containers.

PrivateTmp=yes is back. XDG_RUNTIME_DIR stays unset, so rootless Podman still
keeps its runtime state in its own fallback in /tmp, which pasta's AppArmor
profile allows; under PrivateTmp that is the service's private /tmp.

Podman's own tmpfiles.d exempts its fallback only in the host's /tmp, and
age-based cleanup of /tmp reaches into the service's private one, so a new
tmpfiles.d entry exempts that instead. The .rpm installs it under /opt with a
link in /usr/lib/tmpfiles.d, like the unit, and applies it in %post;
dh_installtmpfiles applies it for the .deb.

The guide gives the command that runs Podman in the service's /tmp, through
JoinsNamespaceOf=lemond.service, in place of a plain `sudo -u lemonade podman`.
It uses --pty: SELinux on Fedora 44 denies dbus-broker the caller's pipes
that --pipe passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): escape container names so distinct models never share one

name_token() mapped every rejected character to `-`, so `user.foo/bar`,
`user.foo bar` and `user.foo-bar` shared a container and network name,
and starting one removed the other. Rejected characters now become `_`
plus two hex digits and `_` is doubled, so the mapping is one-to-one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): return a failed result for an empty command

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(containers): explain how Lemonade chooses Podman or Docker, with service steps for rootful Podman and Docker

The guide said only that Lemonade uses Podman when installed and Docker
otherwise. It now lists when each engine runs (rootless Podman by default,
rootful through CONTAINER_HOST or a root lemond, Docker without Podman) and
that rootful Podman and Docker are root-equivalent.

Its Docker step for lemond.service did nothing: the packages pull in Podman,
which takes precedence, so it now removes Podman first. Rootful Podman under
lemond.service had no steps, and root's socket is closed to lemonade, so the
guide gives a dedicated socket and service for lemonade that leave root's
podman.socket untouched. User-mode lemond shares the user's own Podman and
follows the CONTAINER_HOST its environment sets, which the guide now says.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require lemonade's subordinate IDs only for local rootless Podman

With CONTAINER_HOST pointing at root's Podman socket, as the guide's rootful
setup does, check_podman() still demanded subordinate UID and GID ranges for
lemonade and reported subordinate_ids when they were missing. Root's Podman
maps container IDs onto its own ranges and never uses lemonade's, so the check
blocked a working rootful setup on hosts where lemonade has no ranges.

The check now runs only when Podman is local and rootless, the same condition
check_host() already applies to the device-group checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): report rootful Podman on CNI instead of timing out

Rootful lemond connects at the container's address, and Podman 4's CNI
backend gives an --internal network no gateway on the host, with DNS on or
off. A model load therefore waited out the whole startup timeout (8 minutes
on Ubuntu 24.04 with Podman 4.9.3) and failed with "llama-server failed to
start". Publishing a port does not help: rootful Podman does not forward a
port published on 127.0.0.1 into an internal network on either backend.

check_podman() now reads the network backend in the same `podman info` call
that reports rootless mode, and reports rootful_cni with the way back to
rootless Podman: remove CONTAINER_HOST from /etc/default/lemond (service),
unset it (user mode), or run lemond as a regular account (root). The guide
names switching root's Podman to netavark as well, and warns that the
`podman system reset` it needs deletes all of root's containers and images.
Rootless Podman publishes a port and works on CNI, and rootful Podman on
netavark keeps working, so neither is affected.

The create_network comment named CNI for netavark's behavior, now corrected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(ds4): mark all ds4 models as suggested

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): drop per-model recipe_options pins

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(containers): explain the rootless port vs rootful address once

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): give a ROCm container the GPU its backend supports

get_rocm_arch() prefers a discrete GPU, so on a Strix Halo with an eGPU
HIP_VISIBLE_DEVICES pointed ds4 at the eGPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): stop calling the 81 GB model the only one

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): list model sizes in GB like the rest of the registry

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: give tool calls 100 tokens instead of 300

DS4's DSML tool-call markup takes 55 tokens for calculator_calculate(1+1),
just over the old 50. 300 let any backend ramble for paragraphs first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: accept an incomplete stream only when the token cap ended it

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(containers): keep the runner's persistent Hugging Face cache

Devlab Dispatch runners set HF_HOME to a cache on their scratch disk that
survives the job. Pointing it at RUNNER_TEMP downloaded every model on
every run, 70 minutes for DS4's 87 GB checkpoint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(ds4): drop the workspace-volume note now models use the runner cache

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep the desktop's memory free and auto-size the context

ds4-server grew its caches until the GPU pool was nearly full, which on a
Strix Halo starved the compositor and ended the login session. ds4 now
gets a free floor and a model tensor cache cap from one memory plan.

ds4 also reads its GGUF metadata, so auto-tune knows the model's 1M
context window and KV shape, and it sizes the context from what is free
above that floor through a new BackendOps hook: about 80k tokens on a
128 GB Strix Halo instead of the 4096 fallback.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): pin the 2026-10-24 build of the rocm-10.0 image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(router): re-run auto-tune for the retry after evicting every model

A load that fails for lack of memory is retried after evicting everything,
but the retry reused the context sized while those models still held the
memory. DS4 retried at the 4096 fallback with 80k tokens available.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(rocmfpx): pin the 2026-10-14 build of the rocm-10.0-rocmfpx image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(rocmfpx): keep one Qwen3.8-27B and add Gemma 4 and Qwen3.6 MoE models

Of the three Qwen3.8-27B builds, kingjones777's STRIX-MTP has by far the
lowest perplexity (2.61 against 6.55 for ROCmI4 and 7.36 for FAST on the
same text) at the same decode speed, with vision and MTP. It becomes the
suggested model and the test model; the other two and Qwopus3.6-27B go.

Gemma-4-26B-A4B and Qwen3.6-35B-A3B add different families and MoE
architectures, each passing chat, tool calls and vision at 54 and 72
tokens/s decode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(halogen): serve the v2 checkpoint on the 0.18.19 image

Halogen's default checkpoint since 0.15 is v2: one file plus its lookup
table, closer to the original model than w4b and its overlays, and about
3.5 GiB smaller. The four w4b variants become one model, v2 with the
vision tower, and the image moves to 0.18.19.

Lemonade now leaves the KV pool, slots and prompt cache to Halogen's
defaults, which match the old pins at the native context, so a smaller
ctx_size now shrinks the pool: 65536 takes 79.0 GiB instead of 89.8.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(halogen): refuse a start the host cannot hold, so the router evicts

Halogen sizes its pool from MemTotal, blind to other models, and on a host
short of its weights plus that pool it stalls in the kernel instead of
failing. It now refuses below the weights plus min_resident_gb of
MemAvailable, so the router evicts the other models and retries, as DS4
does. A GTT-only check misses a 22 GB llama.cpp co-tenant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(router): count Halogen's pinned weights as used when loading beside it

MemAvailable counts Halogen's 63 GiB of pinned weights as reclaimable
cache, so with Halogen resident lemond saw 78 GiB free where 15 GiB was.
A 22 GB model then loaded beside it and overcommitted the host. A backend
now reports such memory; the router evicts its holder when the next model
does not fit beside it, and auto-tune counts it as used when it does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* revert(halogen): drop the memory checks for a host-exclusive slot policy

Halogen is built to own its machine, and its pinned weights read as free
memory, so checks against free memory in either load order are fragile.
The next commit gives it the machine instead.

This reverts commits bfccc318c and 84c23c286.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(router): add the ExclusiveHost slot policy and give it to Halogen

A backend with this policy shares the machine with no other local model:
loading it evicts every other local model, and loading another local
model evicts it. Cloud models stay. Halogen takes it because it sizes its
pool from MemTotal and its pinned weights read as free memory, so nothing
can safely load beside it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(debian): keep the postinst chown out of Podman's storage and off symlinks

The postinst re-owns /var/lib/lemonade on every install with
`find ... -exec chown lemonade:lemonade`. Rootless Podman now keeps the
service's image storage in that home under .local/share/containers, so
the walk entered every image layer. Plain chown follows symlinks, and
layers are full of absolute ones (/bin/sh -> /usr/bin/busybox), so root
re-owned the host's files: reinstalling the same .deb on Ubuntu 24.04
after pulling two images handed /run, /run/lock, /etc/ssl/certs,
/usr/bin/busybox and 13 other host files to lemonade. The walk also
flattened the layers' subordinate-ID owners and cleared their setuid
bits, so `su` in an ubuntu image lost setuid.

Prune Podman's storage, which lemonade already owns and Podman manages,
and use chown -h so a symlink anywhere in the home is re-owned itself
instead of its target. The chown -R this walk replaced in #3393 never
followed symlinks, so -h restores that.

Tested on a fresh Ubuntu 24.04 VM: after the reinstall no host file
changes owner, the layers keep their 5 sub-UID files and 8 setuid files,
and a root-owned file in ~/.config is still re-owned to lemonade.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(nathanw): pin the 2026-10-25 vulkan-radv-performance image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(llamacpp): add the halobox container backend

llamacpp:halobox runs halo-box/strix-llama.cpp, the Strix Halo community
fork of llama.cpp, from the rocm-10.0-strix-llama build of
kyuz0/amd-strix-halo-toolboxes. It takes ordinary GGUF models and ROCm
devices, and joins the container backend CI matrix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(responses): don't report a successful Responses object as an error

A Responses object always carries "error", null when the request
succeeded, so a backend that returns the full object, such as gufo, got
a 500 for every non-streaming request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(gufo): add the Gufo container backend

gufo:rocm runs gufo-org/gufo, an engine with model-specific gfx1151
kernels, from the rocm-10.0-gufo build of kyuz0/amd-strix-halo-toolboxes.
It gets its own recipe because it reads ordinary GGUFs but runs only the
models it was written for: Qwen3.8-27B with a DFlash2 draft, Qwen3.8
Flash-Next with its shared MTP head, and DeepSeek V4 Flash with DSpark.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): run resident with DSpark when the GPU pool holds the model

The streaming plan was tuned for a 62 GiB pool, where the 81 GiB IQ2XXS
model cannot be resident. On a 128 GB Strix Halo with the default 115 GiB
GTT window it still streamed experts from disk and decoded at 2.4 tok/s.
When the pool holds the weights plus 24 GiB for the desktop, ds4 now runs
resident (217-311 tok/s prefill, 12.5-14 tok/s decode) and loads the
model's DSpark support file, which streaming cannot use. The IQ2XXS
models gain their DSpark drafts; smaller pools keep the streaming plan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): don't pass Lemonade's /no_think prefix to DeepSeek

ds4-server takes the reasoning_effort and chat_template_kwargs Lemonade
sends when a client turns thinking off, so the /no_think prefix Lemonade
adds beside them for other templates only reaches DeepSeek as text. With
it, the resident Vision model answered the tool-call test with "Let me
try again" and ran out of tokens before closing the call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(nathanw): default to 2048-token batches

llama-server's 512-token ubatch held the Vulkan performance fork well
below its author's published prefill. At 2048, which the author measures
and recommends for MoE models, Qwen3.6-35B-A3B prefills at 1625 tok/s at
4k and 1909 at 32k (from 1373 and 1531) and Qwen3.8-Flash-Next at 717
and 909 (from 580 and 689), with decode unchanged. A user's own -b or
-ub still wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(rocmfpx): default to 2048-token batches

At 2048 rather than llama-server's 512, Qwen3.6-35B-A3B-ROCmFP4-MTP
prefills at 1789 tok/s at 4k and 1440 at 32k (from 1388 and 1125), with
decode unchanged; the dense 27B is unchanged. A longer MTP draft than the
build's default of 3 helped neither model, so it stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(halobox): default to 2048-token batches

At 2048 rather than llama-server's 512, Qwen3.6-35B-A3B prefills at 2938
tok/s at 4k and 2210 at 32k (from 1580 and 1700); the dense 27B gains 4%.
A user's own -b or -ub still wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep ds4's own 16 GiB floor when resident

A 24 GiB reserve made the load check ask for 110.3 GiB free on a 115 GiB
pool that an idle desktop leaves at 108.7, so the resident model never
started, and it put the 97.6 GB Hybrid model on the resident path with a
check it could never pass. A resident model allocates its context up
front rather than growing into the floor, so ds4's own 16 GiB is enough.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep the memory-plan comment within the 12-line limit

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB96uc8rYAthscmomBh

* fix(gufo): regenerate the API docs and drop a repeated comment

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB96uc8rYAthscmomBh

* fix(packaging): recommend Podman only when Docker is missing

Recommends: podman installed Podman alongside an existing Docker, and since
Podman takes precedence when both are on PATH, Docker users had to remove it
again. The .deb now recommends podman | docker.io | docker-ce, and the .rpm
(podman or docker or docker-ce), so an installed Docker satisfies it. On
Fedora, moby-engine provides docker; Docker's own docker-ce does not.

The .rpm's recommendation also never reached the package on Fedora 43:
CPack before CMake 4.1 ignores CPACK_RPM_PACKAGE_RECOMMENDS, so the tag goes
into the spec preamble through CPACK_RPM_SPEC_MORE_DEFINE instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(packaging): warn when lemonade's subordinate ID range can't be allocated

The postinsts ignored a failed usermod --add-subuids/--add-subgids with
|| true, so the only sign was usermod's own error, with nothing tying it to
container backends. They now say what the failure breaks. It still doesn't
fail the install, since only container backends need the range.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): grant GPU access through render alone

Of the nodes a container backend opens, video owns only /dev/dri/card*, the
display node; /dev/kfd and the renderD* nodes belong to render. On a Strix
Halo host, nathanw ran inference on the GPU at the same speed as the
lemonade account with only render, where it could not open card1, as with
video and render, and with no card1 in the container at all. So the
packages add lemonade to render only, as they did before container
backends, and the setup steps and Docker's --group-add ask for render alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): run without PrivateTmp so Podman's state stays in the host's /tmp

With PrivateTmp, rootless Podman's runtime state sat in the service's private
/tmp, which took three workarounds: a tmpfiles.d entry to keep age-based
cleanup out of it, packaging to install that entry, and a systemd-run
JoinsNamespaceOf= command in the guide, because a plain
`sudo -u lemonade podman` saw an empty /tmp and Podman 5 then reset the state
of the containers lemond was running.

In the host's /tmp, Podman's own tmpfiles.d already protects that state and
plain `podman` sees it, so the workarounds go. The cost is the private /tmp,
a small step next to the NoNewPrivileges and RestrictNamespaces rootless
Podman already needs off.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(backends): keep the previous container image until the new pin is committed

Stage version.txt in a sibling directory, check the write, then swap it
into place. The previous image is removed only after the swap succeeds,
so a failed directory creation or marker write no longer leaves a
working backend without its image.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(packaging): allocate subordinate IDs when nsswitch.conf says subid: files

subid: files means the local /etc/subuid and /etc/subgid, so only a
subid: line naming another source (sss, ldap, ...) is left to the
administrator.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(containers): include the lemond port in container names

Two lemond instances on one container daemon loading the same model
produced the same name, and start() removes that name unconditionally,
so the second instance killed the first one's container. The name is
now lemonade-<port>-<recipe>-<backend>-<model>, still stable per
instance so a load clears that instance's own crash leftovers, and the
container carries an ai.lemonade.instance label.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* refactor(containers): trim the install staging and drop the unused instance label

The staging directory is hidden and cleared at the start of the next
install, so the failure paths no longer clean it up. The port in the
container name already keeps instances apart, so the ai.lemonade.instance
label is dropped until something filters on it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(ds4): launch without a free-memory check, as llamacpp does

ds4 was the only backend that refused to start on an estimate of free GPU
memory. On a host with a large BIOS carve-out that estimate reads far
below what the GPU can use, so ds4 refused every load. A load that
really runs short now fails or times out in start_server like any other
backend, and the router evicts and retries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB4k4N92f7HVjp2wtBG

* fix(lemond-user.service): keep the sandbox and run containers through podman.socket

In a user manager, every sandboxing option the unit had on main takes away
something rootless Podman needs: the seccomp-based ones set no-new-privileges,
which stops the setuid newuidmap/newgidmap helpers, and PrivateTmp and
ProtectSystem confine the service to a user namespace that maps only the
user's own UID. So the unit had dropped them all.

The unit now keeps them and sets CONTAINER_HOST to the user's podman.socket.
`podman` in the unit only sends requests to Podman's API service, which
systemd starts outside the unit, and that service creates the containers.
lemond treats a socket in the account's own runtime directory as rootless
Podman, and passes the crun annotation run.oci.keep_original_groups=1 there,
since the Podman API rejects --group-add keep-groups.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require crun for rootless Podman and recommend it

Rootless containers reach the GPU through the account's render group, which
--group-add keep-groups (and its run.oci.keep_original_groups annotation)
carries into the container. Only crun supports that; runc always resets a
container's supplementary groups, so under runc the engine cannot open the
render node and silently runs on the CPU, about 14x slower on nathanw.

Podman installs crun by default, but on Debian and Ubuntu a host that had
docker.io first already has runc, which satisfies Podman's crun | runc
dependency. The Podman setup check now reads the OCI runtime from
`podman info` and, for rootless Podman on anything but crun, asks for the
host's install command for crun. That answer is not cached, so installing
crun takes effect without restarting lemond. The .deb and .rpm also
recommend crun.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): give the podman.socket and CONTAINER_HOST steps for a failing podman info

The setup check's step for a failing `podman info` depends on CONTAINER_HOST
since the user unit moved to podman.socket; the spec's tables still gave
only the generic step.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): expect the lemond port in container names

8e03e4d renamed containers to lemonade-<port>-<recipe>-<backend>-<model>,
but the smoke test still asserted the old lemonade-<recipe>-<backend>-
prefix, failing test_03_load_and_chat on docker and both podman modes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB7BgnHh2Hv3FiEwQHz

* feat(halogen): pin the 0.18.22 release tag instead of latest

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(halogen): turn reasoning off per request for the Responses API

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(halogen): list the bundle files in server_models.json

The lookup table, vision tower and tokenizer files become checkpoints, so
the download check covers each one and the select_checkpoint_files override
and the halogen_* model fields go away.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: simplify container pin updater to open a PR and let CI validate it

Drop the build/validate jobs and the shared test-container-backend action.
The weekly job now only resolves the newest digest of each pinned tag and
opens a ci:backends-labeled PR with GH_TOKEN, so test-container-backends in
cpp_server_build_test_release.yml validates it before merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* ci: run the container pin lookup on PRs that change pins or backend descriptors

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* ci: move container pins to the newest version tag and merge the update PR automatically

A pin whose tag carries version numbers, such as halogen's 0.18.22, now
moves to the highest-numbered tag of the same shape before its digest is
resolved. The update PR gets auto-merge, and older update PRs it
supersedes are closed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* docs(llamacpp): name halobox's build without its ROCm version, which the pin updater moves

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* ci: fall back to GITHUB_TOKEN for the pin update PR and retry registry errors

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* ci: open the container pin PR the same way the other updaters do

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* fix(gufo): read the draft's speculative mode from its GGUF architecture

gufo takes each kind of draft through its own flag. The mode came from a
gufo_speculative registry field that lemonade pull cannot set, so a
user.* gufo model with a draft registered but never loaded. The draft's
general.architecture already names the mode: dflash, deepseek4-dspark,
or the target's own architecture for an MTP sidecar.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Sawan Srivastava <[email protected]>
2026-11-04 03:40:43 +00:00
e9b9245c5a feat(llamacpp): add the halobox container backend (#4029)
* feat(backends): run container backends through ContainerManager, starting with llamacpp:nathanw

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): list every missing setup step and ask for consent at install

Container setup now reports what a user still has to do in one pass,
in the order they do it, and the CLI finishes the install once only
consent is left.

- Setup checks run in two groups. Before consent: the container tool
  on PATH, then the video/render groups (or the Docker socket), then
  enable_containers. These read only PATH, groups and sockets, so no
  container command runs before the user opts in; Podman counts as
  rootful when CONTAINER_HOST is set or lemond runs as root, until
  podman info answers. After consent: podman info, then SELinux.
- Every failed check is reported at once. /system-info gives one
  problem per line in message, numbered steps in action (install
  commands, group changes, enable_containers, and logging out last),
  and the failed checks' ids in setup_checks.
- lemonade backends prints message and action lines side by side.
- lemonade backends install, run and load check the backend's setup
  before installing or downloading anything. When enable_containers
  is the only step left, they show the existing warning, enable it on
  yes and finish the command; backends install --yes skips the prompt.
  Otherwise they print every problem and step and exit 1.
- The spec, user guide, CLI and API docs follow the new order and
  fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* fix(cli): read the selected backend only when recipe options were given

lemonade run and load without a --<recipe> option have no recipe
options, and reading the backend option from them aborted the CLI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* style(containers): trim the setup comments the comment-slop hook flagged

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* ci(containers): gate the container smoke test like the other hosted test jobs

The signing and release-branch skips exist to spare self-hosted runners;
the smoke test runs on ubuntu-latest.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(containers): pin the container smoke test to Ubuntu 24.04

The job installs the 24.04 .deb on the bare runner, and ubuntu-latest moves
to 26.04 in November 2026, where libmbedcrypto7t64 does not exist. The
comments now say why the job runs on the bare runner and needs the PPA.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): assert lemond's mode in the smoke test and log at debug

test_03 now checks the published port on lemond's container, so each leg
proves lemond detected the intended mode, not only that the tool runs in it.
LEMONADE_CI_MODE puts llama-server's output in the uploaded logs, as in the
other jobs that start lemond.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci: say why backends-gate also lists jobs that run on every PR

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): cut the container spec changes back to what the implementation made false

Keeps the opt-in invariants (off by default, install and load refused while
off, no container command before opt-in), rootful Podman's connection path,
the Podman answers check, and reporting every failed check at once. Drops
setup_checks, action ordering, CLI prompting, and the expect_rootless detail.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): name the enable warning instead of quoting it

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(llamacpp): list nathanw as a guest backend, as its descriptor declares

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(cli): word the enable_containers prompts as enabling containers, not backends

The setting enables every container, whatever its tier, so the warning no
longer calls the images community-built.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(backends): drop the image allowlist comment from ContainerPolicy

ContainerManager::allowed_image is the allowlist; the comment restated it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* refactor(containers): leave GPU selection and the SELinux check to the first ROCm container backend

llamacpp:nathanw maps only /dev/dri, so nothing here reached the
HIP_VISIBLE_DEVICES lookup or the SELinux check, both gated on /dev/kfd.
needs_gfx1151_cwsr_fix goes back to its own KFD read.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): drop checks that restate code, and mount single files only

The directory mounts serve Halogen's tokenizer and move to that PR; here
every model file llamacpp names is a GGUF.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): take the smoke test's backend as --backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): leave Podman and Docker alone while enable_containers is false

With containers disabled, lemond no longer sweeps at startup, connects to
the Docker socket, runs `image inspect`, or removes images on uninstall.
Setting enable_containers to false unloads every model running in a
container first, so none is left that a later crash would orphan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015BUXEd42tPQH67MQPW1XZh

* Update to a modern pin

* refactor(containers): drop the startup sweep

A killed lemond's containers already stop and remove themselves: the
attached `run --rm` child gets SIGTERM from PR_SET_PDEATHSIG and proxies it
into the container. Verified with Docker and rootful/rootless Podman. The
smoke test now kills lemond with a model loaded and checks no container
remains.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(load): list nathanw among the llamacpp_backend choices

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* ci(containers): cap the Dispatch container job at 45 minutes

A hung job would otherwise hold a pool machine for up to 4 hours.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* test(containers): skip the killed-lemond check under rootful Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(containers): link container images to their registry pages

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): skip the killed-lemond check under rootful Docker too

The Docker daemon owns the container, so whether it stops after lemond is
killed depends on the docker client forwarding SIGTERM in time, which is
racy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5SJqLuAuPwGaJQvWTwMai

* refactor(containers): drop the enable_containers setting

Container backends no longer need an opt-in before they install or
load. The setup assistant's remaining checks still report what is
missing.

- Remove the config key, its validation, getter and config effect.
- Remove the CLI consent prompt and pre-flight check, and the --yes
  flags on `config set` and `backends install` that only served it.
- Always check the Docker socket, read the image on disk for installed
  state, and remove the image on uninstall.
- Remove helpers left unused: containers_enabled,
  Router::get_container_model_names, WrappedServer::runs_in_container,
  ServerProcess::in_container.
- Update the spec, guides, generated API docs, tests and CI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* perf(containers): run container setup checks once per system-info build

The checks are host-wide, so every container backend got the same
report while each one ran them again, `podman info` included. Drop the
unused recipe and backend parameters from container_setup_failure and
compute its report at most once per pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* test(containers): fail when listing labeled containers or networks fails

A failed `ps` or `network ls` printed nothing, so the checks that expect
no leftovers passed without listing anything.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* feat(containers): run container backends from lemond.service with rootless Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): create Podman networks without a DNS server

Every model load failed under lemond.service with Podman 5 (Fedora 43/44,
Ubuntu 26.04, Debian 13):

  netavark: error while applying dns entries: aardvark-dns failed to start:
  Failed to connect to user scope bus via local transport

`podman network create` turns DNS on by default, and rootless netavark
(1.14 and later) starts aardvark-dns with `systemd-run --scope --user`, which
needs the account's systemd user manager. The lemonade system account has no
login session, so it has none.

Each per-model network holds one container, and lemond reaches it through
its published port or inspected address, never by name, so the network
needs no DNS server. Docker has no such option and is unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): let rootless Podman keep its runtime state in the host's /tmp

Every model load failed under lemond.service on Ubuntu 26.04 and Debian 13:

  Error: setting up Pasta: pasta failed with exit code 1: Couldn't open PID
  file /run/lemonade/containers/networks/rootless-netns/rootless-netns-conn.pid:
  Permission denied

Podman 5 sets up rootless networking with pasta, under $XDG_RUNTIME_DIR, which
the unit set to /run/lemonade. The AppArmor profile Ubuntu and Debian ship for
pasta allows writes only under /tmp, /run/user/<uid> and home directories under
/home, so it denied the PID file. ProtectHome=yes hides /run/user, and the
account has no login session to create /run/user/<uid> in any case.

With XDG_RUNTIME_DIR unset, Podman uses its own fallback in /tmp
(/tmp/storage-run-<uid>, or /tmp/containers-user-<uid> on Podman 4), which the
profile allows and Podman's own tmpfiles.d exempts from age-based cleanup.
lemond's own runtime directory stays /run/lemonade, through RuntimeDirectory=.

PrivateTmp goes with it. In a private /tmp, `podman` run as lemonade from a
shell finds no runtime state, and Podman 5 then refreshes the shared database:
the running container drops out of lemond's view, `podman stop` reports no such
container, and the engine keeps holding the GPU until the service stops.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(debian): create /var/lib/cni at install

On Ubuntu 24.04, every model load under lemond.service failed until the host
next rebooted:

  Error: unable to find network with name or ID lemonade-<...>: network not found

Podman 4's rootless network namespace bind-mounts a private directory over
/var/lib/cni, or, while that does not exist, over its nearest existing parent,
/var/lib. That mount hid /var/lib/lemonade, the lemonade account's home, which
holds its Podman storage and network configs, so `podman run` found no network
that `podman network create` had just made. Podman's own tmpfiles.d creates
/var/lib/cni only at boot (`D!`), so a fresh install hit this until a reboot.

The package now ships the directory in tmpfiles.d, which dh_installtmpfiles
applies at install. The .rpm keeps lemonade's home in /opt, and Podman 5 makes
no such mount, so neither needs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): keep DNS on rootful Podman's per-model networks

Podman 4's CNI backend gives an --internal network created with
--disable-dns no gateway, so the host has no route to the container and
rootful lemond, which connects at the container's address, waited on
llama-server until the test timed out. Only rootless Podman needs DNS
off, and it reaches the container through a published port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(ds4): move ds4:rocm to a container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): pick the ROCm container's GPU and check SELinux for /dev/kfd backends

ds4:rocm is the first container backend that maps /dev/kfd. Its container
gets HIP_VISIBLE_DEVICES for the GPU lemond sized it for, read from the KFD
topology next to system_info's other KFD reads, and hosts with SELinux
enforcing must allow containers to map GPU devices.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(containers): restore the Dispatch container job's 4-hour timeout

Four ds4 jobs downloading DS4's 81 GB checkpoint at once on fresh Dispatch
machines each ran past 45 minutes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(containers): run container backends from lemond.service with rootless Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): create Podman networks without a DNS server

Every model load failed under lemond.service with Podman 5 (Fedora 43/44,
Ubuntu 26.04, Debian 13):

  netavark: error while applying dns entries: aardvark-dns failed to start:
  Failed to connect to user scope bus via local transport

`podman network create` turns DNS on by default, and rootless netavark
(1.14 and later) starts aardvark-dns with `systemd-run --scope --user`, which
needs the account's systemd user manager. The lemonade system account has no
login session, so it has none.

Each per-model network holds one container, and lemond reaches it through
its published port or inspected address, never by name, so the network
needs no DNS server. Docker has no such option and is unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): let rootless Podman keep its runtime state in the host's /tmp

Every model load failed under lemond.service on Ubuntu 26.04 and Debian 13:

  Error: setting up Pasta: pasta failed with exit code 1: Couldn't open PID
  file /run/lemonade/containers/networks/rootless-netns/rootless-netns-conn.pid:
  Permission denied

Podman 5 sets up rootless networking with pasta, under $XDG_RUNTIME_DIR, which
the unit set to /run/lemonade. The AppArmor profile Ubuntu and Debian ship for
pasta allows writes only under /tmp, /run/user/<uid> and home directories under
/home, so it denied the PID file. ProtectHome=yes hides /run/user, and the
account has no login session to create /run/user/<uid> in any case.

With XDG_RUNTIME_DIR unset, Podman uses its own fallback in /tmp
(/tmp/storage-run-<uid>, or /tmp/containers-user-<uid> on Podman 4), which the
profile allows and Podman's own tmpfiles.d exempts from age-based cleanup.
lemond's own runtime directory stays /run/lemonade, through RuntimeDirectory=.

PrivateTmp goes with it. In a private /tmp, `podman` run as lemonade from a
shell finds no runtime state, and Podman 5 then refreshes the shared database:
the running container drops out of lemond's view, `podman stop` reports no such
container, and the engine keeps holding the GPU until the service stops.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(halogen): add the Halogen Flash container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(debian): create /var/lib/cni at install

On Ubuntu 24.04, every model load under lemond.service failed until the host
next rebooted:

  Error: unable to find network with name or ID lemonade-<...>: network not found

Podman 4's rootless network namespace bind-mounts a private directory over
/var/lib/cni, or, while that does not exist, over its nearest existing parent,
/var/lib. That mount hid /var/lib/lemonade, the lemonade account's home, which
holds its Podman storage and network configs, so `podman run` found no network
that `podman network create` had just made. Podman's own tmpfiles.d creates
/var/lib/cni only at boot (`D!`), so a fresh install hit this until a reboot.

The package now ships the directory in tmpfiles.d, which dh_installtmpfiles
applies at install. The .rpm keeps lemonade's home in /opt, and Podman 5 makes
no such mount, so neither needs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(ds4): move ds4:rocm to a container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(halogen): read the gfx1151 KFD node through system_info and report the setup steps

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(rocmfpx): add the ROCm FPX container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): keep DNS on rootful Podman's per-model networks

Podman 4's CNI backend gives an --internal network created with
--disable-dns no gateway, so the host has no route to the container and
rootful lemond, which connects at the container's address, waited on
llama-server until the test timed out. Only rootless Podman needs DNS
off, and it reaches the container through a published port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(containers): pick the ROCm container's GPU and check SELinux for /dev/kfd backends

ds4:rocm is the first container backend that maps /dev/kfd. Its container
gets HIP_VISIBLE_DEVICES for the GPU lemond sized it for, read from the KFD
topology next to system_info's other KFD reads, and hosts with SELinux
enforcing must allow containers to map GPU devices.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): mount a model directory one file at a time, for Halogen's tokenizer

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci: keep container backend images on the newest build of their tags

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(api): regenerate for the rocmfpx section

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* fix(app): show container setup steps in a collapsible section

The Setup guide button passed `action` to window.open, but lemond's
`action` holds a command, steps, or a link. A non-link action now shows
as a "Setup required" disclosure with the failure message and steps,
regardless of the technical-details toggle; links keep the button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check GPU device access instead of video/render membership

Desktop distros such as Ubuntu and Arch grant the logged-in account
/dev/kfd and /dev/dri access through ACLs, so an account outside video
and render could use the GPU yet was told to fix its groups. The setup
check now tests read/write access to /dev/kfd and each render node.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): ask Podman its mode before the host check

container_setup_failure() ran check_host() before check_podman(), so the
first pass after startup guessed rootless and could report a GPU access
failure on rootful Podman that the next pass cleared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check Docker with docker info instead of a fixed socket

The socket probe only looked at /var/run/docker.sock, so DOCKER_HOST,
Docker contexts and Docker Desktop's socket read as a refused account.
docker info follows the CLI's own connection, and its answer also
identifies Docker Desktop and rootless Docker, which cannot run
container backends, so those now get Podman as the fix step. The spec's
device-node rows now describe the access check instead of group
membership.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(lemond.service): keep PrivateTmp and give Podman's private /tmp state to tmpfiles.d

04919f697 turned PrivateTmp off for every lemond.service user, containers or
not, raising systemd-analyze security exposure from 8.5 to 8.7. Its reason was
`podman` run as lemonade from a shell: in the host's /tmp it finds none of the
service's runtime state, and Podman 5 then refreshes the shared database, so
lemond loses track of its running containers.

PrivateTmp=yes is back. XDG_RUNTIME_DIR stays unset, so rootless Podman still
keeps its runtime state in its own fallback in /tmp, which pasta's AppArmor
profile allows; under PrivateTmp that is the service's private /tmp.

Podman's own tmpfiles.d exempts its fallback only in the host's /tmp, and
age-based cleanup of /tmp reaches into the service's private one, so a new
tmpfiles.d entry exempts that instead. The .rpm installs it under /opt with a
link in /usr/lib/tmpfiles.d, like the unit, and applies it in %post;
dh_installtmpfiles applies it for the .deb.

The guide gives the command that runs Podman in the service's /tmp, through
JoinsNamespaceOf=lemond.service, in place of a plain `sudo -u lemonade podman`.
It uses --pty: SELinux on Fedora 44 denies dbus-broker the caller's pipes
that --pipe passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): escape container names so distinct models never share one

name_token() mapped every rejected character to `-`, so `user.foo/bar`,
`user.foo bar` and `user.foo-bar` shared a container and network name,
and starting one removed the other. Rejected characters now become `_`
plus two hex digits and `_` is doubled, so the mapping is one-to-one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): return a failed result for an empty command

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(containers): explain how Lemonade chooses Podman or Docker, with service steps for rootful Podman and Docker

The guide said only that Lemonade uses Podman when installed and Docker
otherwise. It now lists when each engine runs (rootless Podman by default,
rootful through CONTAINER_HOST or a root lemond, Docker without Podman) and
that rootful Podman and Docker are root-equivalent.

Its Docker step for lemond.service did nothing: the packages pull in Podman,
which takes precedence, so it now removes Podman first. Rootful Podman under
lemond.service had no steps, and root's socket is closed to lemonade, so the
guide gives a dedicated socket and service for lemonade that leave root's
podman.socket untouched. User-mode lemond shares the user's own Podman and
follows the CONTAINER_HOST its environment sets, which the guide now says.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require lemonade's subordinate IDs only for local rootless Podman

With CONTAINER_HOST pointing at root's Podman socket, as the guide's rootful
setup does, check_podman() still demanded subordinate UID and GID ranges for
lemonade and reported subordinate_ids when they were missing. Root's Podman
maps container IDs onto its own ranges and never uses lemonade's, so the check
blocked a working rootful setup on hosts where lemonade has no ranges.

The check now runs only when Podman is local and rootless, the same condition
check_host() already applies to the device-group checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): report rootful Podman on CNI instead of timing out

Rootful lemond connects at the container's address, and Podman 4's CNI
backend gives an --internal network no gateway on the host, with DNS on or
off. A model load therefore waited out the whole startup timeout (8 minutes
on Ubuntu 24.04 with Podman 4.9.3) and failed with "llama-server failed to
start". Publishing a port does not help: rootful Podman does not forward a
port published on 127.0.0.1 into an internal network on either backend.

check_podman() now reads the network backend in the same `podman info` call
that reports rootless mode, and reports rootful_cni with the way back to
rootless Podman: remove CONTAINER_HOST from /etc/default/lemond (service),
unset it (user mode), or run lemond as a regular account (root). The guide
names switching root's Podman to netavark as well, and warns that the
`podman system reset` it needs deletes all of root's containers and images.
Rootless Podman publishes a port and works on CNI, and rootful Podman on
netavark keeps working, so neither is affected.

The create_network comment named CNI for netavark's behavior, now corrected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(ds4): mark all ds4 models as suggested

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): drop per-model recipe_options pins

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(containers): explain the rootless port vs rootful address once

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): give a ROCm container the GPU its backend supports

get_rocm_arch() prefers a discrete GPU, so on a Strix Halo with an eGPU
HIP_VISIBLE_DEVICES pointed ds4 at the eGPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): stop calling the 81 GB model the only one

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): list model sizes in GB like the rest of the registry

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: give tool calls 100 tokens instead of 300

DS4's DSML tool-call markup takes 55 tokens for calculator_calculate(1+1),
just over the old 50. 300 let any backend ramble for paragraphs first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: accept an incomplete stream only when the token cap ended it

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(containers): keep the runner's persistent Hugging Face cache

Devlab Dispatch runners set HF_HOME to a cache on their scratch disk that
survives the job. Pointing it at RUNNER_TEMP downloaded every model on
every run, 70 minutes for DS4's 87 GB checkpoint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(ds4): drop the workspace-volume note now models use the runner cache

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep the desktop's memory free and auto-size the context

ds4-server grew its caches until the GPU pool was nearly full, which on a
Strix Halo starved the compositor and ended the login session. ds4 now
gets a free floor and a model tensor cache cap from one memory plan.

ds4 also reads its GGUF metadata, so auto-tune knows the model's 1M
context window and KV shape, and it sizes the context from what is free
above that floor through a new BackendOps hook: about 80k tokens on a
128 GB Strix Halo instead of the 4096 fallback.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): pin the 2026-10-24 build of the rocm-10.0 image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(router): re-run auto-tune for the retry after evicting every model

A load that fails for lack of memory is retried after evicting everything,
but the retry reused the context sized while those models still held the
memory. DS4 retried at the 4096 fallback with 80k tokens available.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(rocmfpx): pin the 2026-10-14 build of the rocm-10.0-rocmfpx image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(rocmfpx): keep one Qwen3.8-27B and add Gemma 4 and Qwen3.6 MoE models

Of the three Qwen3.8-27B builds, kingjones777's STRIX-MTP has by far the
lowest perplexity (2.61 against 6.55 for ROCmI4 and 7.36 for FAST on the
same text) at the same decode speed, with vision and MTP. It becomes the
suggested model and the test model; the other two and Qwopus3.6-27B go.

Gemma-4-26B-A4B and Qwen3.6-35B-A3B add different families and MoE
architectures, each passing chat, tool calls and vision at 54 and 72
tokens/s decode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(halogen): serve the v2 checkpoint on the 0.18.19 image

Halogen's default checkpoint since 0.15 is v2: one file plus its lookup
table, closer to the original model than w4b and its overlays, and about
3.5 GiB smaller. The four w4b variants become one model, v2 with the
vision tower, and the image moves to 0.18.19.

Lemonade now leaves the KV pool, slots and prompt cache to Halogen's
defaults, which match the old pins at the native context, so a smaller
ctx_size now shrinks the pool: 65536 takes 79.0 GiB instead of 89.8.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(halogen): refuse a start the host cannot hold, so the router evicts

Halogen sizes its pool from MemTotal, blind to other models, and on a host
short of its weights plus that pool it stalls in the kernel instead of
failing. It now refuses below the weights plus min_resident_gb of
MemAvailable, so the router evicts the other models and retries, as DS4
does. A GTT-only check misses a 22 GB llama.cpp co-tenant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(router): count Halogen's pinned weights as used when loading beside it

MemAvailable counts Halogen's 63 GiB of pinned weights as reclaimable
cache, so with Halogen resident lemond saw 78 GiB free where 15 GiB was.
A 22 GB model then loaded beside it and overcommitted the host. A backend
now reports such memory; the router evicts its holder when the next model
does not fit beside it, and auto-tune counts it as used when it does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* revert(halogen): drop the memory checks for a host-exclusive slot policy

Halogen is built to own its machine, and its pinned weights read as free
memory, so checks against free memory in either load order are fragile.
The next commit gives it the machine instead.

This reverts commits bfccc318c and 84c23c286.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(router): add the ExclusiveHost slot policy and give it to Halogen

A backend with this policy shares the machine with no other local model:
loading it evicts every other local model, and loading another local
model evicts it. Cloud models stay. Halogen takes it because it sizes its
pool from MemTotal and its pinned weights read as free memory, so nothing
can safely load beside it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(debian): keep the postinst chown out of Podman's storage and off symlinks

The postinst re-owns /var/lib/lemonade on every install with
`find ... -exec chown lemonade:lemonade`. Rootless Podman now keeps the
service's image storage in that home under .local/share/containers, so
the walk entered every image layer. Plain chown follows symlinks, and
layers are full of absolute ones (/bin/sh -> /usr/bin/busybox), so root
re-owned the host's files: reinstalling the same .deb on Ubuntu 24.04
after pulling two images handed /run, /run/lock, /etc/ssl/certs,
/usr/bin/busybox and 13 other host files to lemonade. The walk also
flattened the layers' subordinate-ID owners and cleared their setuid
bits, so `su` in an ubuntu image lost setuid.

Prune Podman's storage, which lemonade already owns and Podman manages,
and use chown -h so a symlink anywhere in the home is re-owned itself
instead of its target. The chown -R this walk replaced in #3393 never
followed symlinks, so -h restores that.

Tested on a fresh Ubuntu 24.04 VM: after the reinstall no host file
changes owner, the layers keep their 5 sub-UID files and 8 setuid files,
and a root-owned file in ~/.config is still re-owned to lemonade.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(nathanw): pin the 2026-10-25 vulkan-radv-performance image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(llamacpp): add the halobox container backend

llamacpp:halobox runs halo-box/strix-llama.cpp, the Strix Halo community
fork of llama.cpp, from the rocm-10.0-strix-llama build of
kyuz0/amd-strix-halo-toolboxes. It takes ordinary GGUF models and ROCm
devices, and joins the container backend CI matrix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): run resident with DSpark when the GPU pool holds the model

The streaming plan was tuned for a 62 GiB pool, where the 81 GiB IQ2XXS
model cannot be resident. On a 128 GB Strix Halo with the default 115 GiB
GTT window it still streamed experts from disk and decoded at 2.4 tok/s.
When the pool holds the weights plus 24 GiB for the desktop, ds4 now runs
resident (217-311 tok/s prefill, 12.5-14 tok/s decode) and loads the
model's DSpark support file, which streaming cannot use. The IQ2XXS
models gain their DSpark drafts; smaller pools keep the streaming plan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): don't pass Lemonade's /no_think prefix to DeepSeek

ds4-server takes the reasoning_effort and chat_template_kwargs Lemonade
sends when a client turns thinking off, so the /no_think prefix Lemonade
adds beside them for other templates only reaches DeepSeek as text. With
it, the resident Vision model answered the tool-call test with "Let me
try again" and ran out of tokens before closing the call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(nathanw): default to 2048-token batches

llama-server's 512-token ubatch held the Vulkan performance fork well
below its author's published prefill. At 2048, which the author measures
and recommends for MoE models, Qwen3.6-35B-A3B prefills at 1625 tok/s at
4k and 1909 at 32k (from 1373 and 1531) and Qwen3.8-Flash-Next at 717
and 909 (from 580 and 689), with decode unchanged. A user's own -b or
-ub still wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(rocmfpx): default to 2048-token batches

At 2048 rather than llama-server's 512, Qwen3.6-35B-A3B-ROCmFP4-MTP
prefills at 1789 tok/s at 4k and 1440 at 32k (from 1388 and 1125), with
decode unchanged; the dense 27B is unchanged. A longer MTP draft than the
build's default of 3 helped neither model, so it stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(halobox): default to 2048-token batches

At 2048 rather than llama-server's 512, Qwen3.6-35B-A3B prefills at 2938
tok/s at 4k and 2210 at 32k (from 1580 and 1700); the dense 27B gains 4%.
A user's own -b or -ub still wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep ds4's own 16 GiB floor when resident

A 24 GiB reserve made the load check ask for 110.3 GiB free on a 115 GiB
pool that an idle desktop leaves at 108.7, so the resident model never
started, and it put the 97.6 GB Hybrid model on the resident path with a
check it could never pass. A resident model allocates its context up
front rather than growing into the floor, so ds4's own 16 GiB is enough.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep the memory-plan comment within the 12-line limit

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB96uc8rYAthscmomBh

* fix(packaging): recommend Podman only when Docker is missing

Recommends: podman installed Podman alongside an existing Docker, and since
Podman takes precedence when both are on PATH, Docker users had to remove it
again. The .deb now recommends podman | docker.io | docker-ce, and the .rpm
(podman or docker or docker-ce), so an installed Docker satisfies it. On
Fedora, moby-engine provides docker; Docker's own docker-ce does not.

The .rpm's recommendation also never reached the package on Fedora 43:
CPack before CMake 4.1 ignores CPACK_RPM_PACKAGE_RECOMMENDS, so the tag goes
into the spec preamble through CPACK_RPM_SPEC_MORE_DEFINE instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(packaging): warn when lemonade's subordinate ID range can't be allocated

The postinsts ignored a failed usermod --add-subuids/--add-subgids with
|| true, so the only sign was usermod's own error, with nothing tying it to
container backends. They now say what the failure breaks. It still doesn't
fail the install, since only container backends need the range.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): grant GPU access through render alone

Of the nodes a container backend opens, video owns only /dev/dri/card*, the
display node; /dev/kfd and the renderD* nodes belong to render. On a Strix
Halo host, nathanw ran inference on the GPU at the same speed as the
lemonade account with only render, where it could not open card1, as with
video and render, and with no card1 in the container at all. So the
packages add lemonade to render only, as they did before container
backends, and the setup steps and Docker's --group-add ask for render alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): run without PrivateTmp so Podman's state stays in the host's /tmp

With PrivateTmp, rootless Podman's runtime state sat in the service's private
/tmp, which took three workarounds: a tmpfiles.d entry to keep age-based
cleanup out of it, packaging to install that entry, and a systemd-run
JoinsNamespaceOf= command in the guide, because a plain
`sudo -u lemonade podman` saw an empty /tmp and Podman 5 then reset the state
of the containers lemond was running.

In the host's /tmp, Podman's own tmpfiles.d already protects that state and
plain `podman` sees it, so the workarounds go. The cost is the private /tmp,
a small step next to the NoNewPrivileges and RestrictNamespaces rootless
Podman already needs off.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(backends): keep the previous container image until the new pin is committed

Stage version.txt in a sibling directory, check the write, then swap it
into place. The previous image is removed only after the swap succeeds,
so a failed directory creation or marker write no longer leaves a
working backend without its image.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(packaging): allocate subordinate IDs when nsswitch.conf says subid: files

subid: files means the local /etc/subuid and /etc/subgid, so only a
subid: line naming another source (sss, ldap, ...) is left to the
administrator.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(containers): include the lemond port in container names

Two lemond instances on one container daemon loading the same model
produced the same name, and start() removes that name unconditionally,
so the second instance killed the first one's container. The name is
now lemonade-<port>-<recipe>-<backend>-<model>, still stable per
instance so a load clears that instance's own crash leftovers, and the
container carries an ai.lemonade.instance label.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* refactor(containers): trim the install staging and drop the unused instance label

The staging directory is hidden and cleared at the start of the next
install, so the failure paths no longer clean it up. The port in the
container name already keeps instances apart, so the ai.lemonade.instance
label is dropped until something filters on it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(ds4): launch without a free-memory check, as llamacpp does

ds4 was the only backend that refused to start on an estimate of free GPU
memory. On a host with a large BIOS carve-out that estimate reads far
below what the GPU can use, so ds4 refused every load. A load that
really runs short now fails or times out in start_server like any other
backend, and the router evicts and retries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB4k4N92f7HVjp2wtBG

* fix(lemond-user.service): keep the sandbox and run containers through podman.socket

In a user manager, every sandboxing option the unit had on main takes away
something rootless Podman needs: the seccomp-based ones set no-new-privileges,
which stops the setuid newuidmap/newgidmap helpers, and PrivateTmp and
ProtectSystem confine the service to a user namespace that maps only the
user's own UID. So the unit had dropped them all.

The unit now keeps them and sets CONTAINER_HOST to the user's podman.socket.
`podman` in the unit only sends requests to Podman's API service, which
systemd starts outside the unit, and that service creates the containers.
lemond treats a socket in the account's own runtime directory as rootless
Podman, and passes the crun annotation run.oci.keep_original_groups=1 there,
since the Podman API rejects --group-add keep-groups.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require crun for rootless Podman and recommend it

Rootless containers reach the GPU through the account's render group, which
--group-add keep-groups (and its run.oci.keep_original_groups annotation)
carries into the container. Only crun supports that; runc always resets a
container's supplementary groups, so under runc the engine cannot open the
render node and silently runs on the CPU, about 14x slower on nathanw.

Podman installs crun by default, but on Debian and Ubuntu a host that had
docker.io first already has runc, which satisfies Podman's crun | runc
dependency. The Podman setup check now reads the OCI runtime from
`podman info` and, for rootless Podman on anything but crun, asks for the
host's install command for crun. That answer is not cached, so installing
crun takes effect without restarting lemond. The .deb and .rpm also
recommend crun.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): give the podman.socket and CONTAINER_HOST steps for a failing podman info

The setup check's step for a failing `podman info` depends on CONTAINER_HOST
since the user unit moved to podman.socket; the spec's tables still gave
only the generic step.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): expect the lemond port in container names

8e03e4d renamed containers to lemonade-<port>-<recipe>-<backend>-<model>,
but the smoke test still asserted the old lemonade-<recipe>-<backend>-
prefix, failing test_03_load_and_chat on docker and both podman modes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB7BgnHh2Hv3FiEwQHz

* feat(halogen): pin the 0.18.22 release tag instead of latest

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(halogen): turn reasoning off per request for the Responses API

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(halogen): list the bundle files in server_models.json

The lookup table, vision tower and tokenizer files become checkpoints, so
the download check covers each one and the select_checkpoint_files override
and the halogen_* model fields go away.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: simplify container pin updater to open a PR and let CI validate it

Drop the build/validate jobs and the shared test-container-backend action.
The weekly job now only resolves the newest digest of each pinned tag and
opens a ci:backends-labeled PR with GH_TOKEN, so test-container-backends in
cpp_server_build_test_release.yml validates it before merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* ci: run the container pin lookup on PRs that change pins or backend descriptors

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* ci: move container pins to the newest version tag and merge the update PR automatically

A pin whose tag carries version numbers, such as halogen's 0.18.22, now
moves to the highest-numbered tag of the same shape before its digest is
resolved. The update PR gets auto-merge, and older update PRs it
supersedes are closed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* docs(llamacpp): name halobox's build without its ROCm version, which the pin updater moves

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* ci: fall back to GITHUB_TOKEN for the pin update PR and retry registry errors

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* ci: open the container pin PR the same way the other updaters do

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Sawan Srivastava <[email protected]>
2026-11-04 00:44:27 +00:00
abec4142b8 ci: Add cuda backend validation for llama.cpp on Linux using self-hosted amd64 and arm64 runners (#3714)
* First pass at CI to validate cuda on self-hosted arm64 runner

* ci: add Linux x64 CUDA runner to llama.cpp validation

Matrix the Linux build and validate jobs over arm64/x64, pin the CUDA
runners by their sjlab-* labels, and suffix artifact names per arch.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* ci: address review feedback on CUDA validation workflow

- Add sm_121 (DGX Spark GB10) to expected CUDA asset architectures
- Remove stale commented-out Windows CUDA matrix entry
- Make validate-linux fail-fast conditional on merge_group, matching validate job
- Include cuda in the validation results summary table loop
- Remove stale note about CUDA being asset-gated until a runner exists

Co-authored-by: Copilot <[email protected]>

* ci: address remaining review feedback on CUDA validation workflow

- Fix chmod-before-existence-check ordering so missing binary is reported
  before chmod fails silently under set -e
- Replace overly broad pgrep idle-check with a workspace-scoped stale
  process cleanup (matches the Windows job's approach), instead of hard
  failing the whole job
- Fix arm64/x64 CUDA validation-results artifact name collision by
  suffixing the output file with matrix.arch
- Extract the duplicated ~50-line backend_versions.json update script
  (Windows build, Linux build, create-pr) into
  .github/scripts/update_backend_versions.py
- Route the RTX 5070 (x64) CUDA leg to always run in lite mode via a new
  matrix.lite_only flag, since its VRAM only fits the smallest hot model,
  and add timeout-minutes: 420 to validate-linux

Co-authored-by: Copilot <[email protected]>

* ci: exclude merge_group from CUDA validation on Linux

build-linux's trigger condition didn't account for merge_group, so
every merge-queue run required the self-hosted DGX Spark and RTX 5070
boxes to be online and idle for validate-linux to succeed.
validation-gate's merge-queue completeness check is updated to match,
so skipping those two jobs doesn't fail the gate.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* style: apply black formatting to update_backend_versions.py

Co-authored-by: Copilot <[email protected]>

* Don't persist credentials for the duration of the job

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Satya Devineni <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: kenvandine <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-11-04 00:37:43 +00:00
f777023e06 ci: keep container backend images on the newest build of their tags (#3713)
* feat(backends): run container backends through ContainerManager, starting with llamacpp:nathanw

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): list every missing setup step and ask for consent at install

Container setup now reports what a user still has to do in one pass,
in the order they do it, and the CLI finishes the install once only
consent is left.

- Setup checks run in two groups. Before consent: the container tool
  on PATH, then the video/render groups (or the Docker socket), then
  enable_containers. These read only PATH, groups and sockets, so no
  container command runs before the user opts in; Podman counts as
  rootful when CONTAINER_HOST is set or lemond runs as root, until
  podman info answers. After consent: podman info, then SELinux.
- Every failed check is reported at once. /system-info gives one
  problem per line in message, numbered steps in action (install
  commands, group changes, enable_containers, and logging out last),
  and the failed checks' ids in setup_checks.
- lemonade backends prints message and action lines side by side.
- lemonade backends install, run and load check the backend's setup
  before installing or downloading anything. When enable_containers
  is the only step left, they show the existing warning, enable it on
  yes and finish the command; backends install --yes skips the prompt.
  Otherwise they print every problem and step and exit 1.
- The spec, user guide, CLI and API docs follow the new order and
  fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* fix(cli): read the selected backend only when recipe options were given

lemonade run and load without a --<recipe> option have no recipe
options, and reading the backend option from them aborted the CLI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* style(containers): trim the setup comments the comment-slop hook flagged

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* ci(containers): gate the container smoke test like the other hosted test jobs

The signing and release-branch skips exist to spare self-hosted runners;
the smoke test runs on ubuntu-latest.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(containers): pin the container smoke test to Ubuntu 24.04

The job installs the 24.04 .deb on the bare runner, and ubuntu-latest moves
to 26.04 in November 2026, where libmbedcrypto7t64 does not exist. The
comments now say why the job runs on the bare runner and needs the PPA.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): assert lemond's mode in the smoke test and log at debug

test_03 now checks the published port on lemond's container, so each leg
proves lemond detected the intended mode, not only that the tool runs in it.
LEMONADE_CI_MODE puts llama-server's output in the uploaded logs, as in the
other jobs that start lemond.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci: say why backends-gate also lists jobs that run on every PR

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): cut the container spec changes back to what the implementation made false

Keeps the opt-in invariants (off by default, install and load refused while
off, no container command before opt-in), rootful Podman's connection path,
the Podman answers check, and reporting every failed check at once. Drops
setup_checks, action ordering, CLI prompting, and the expect_rootless detail.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): name the enable warning instead of quoting it

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(llamacpp): list nathanw as a guest backend, as its descriptor declares

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(cli): word the enable_containers prompts as enabling containers, not backends

The setting enables every container, whatever its tier, so the warning no
longer calls the images community-built.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(backends): drop the image allowlist comment from ContainerPolicy

ContainerManager::allowed_image is the allowlist; the comment restated it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* refactor(containers): leave GPU selection and the SELinux check to the first ROCm container backend

llamacpp:nathanw maps only /dev/dri, so nothing here reached the
HIP_VISIBLE_DEVICES lookup or the SELinux check, both gated on /dev/kfd.
needs_gfx1151_cwsr_fix goes back to its own KFD read.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): drop checks that restate code, and mount single files only

The directory mounts serve Halogen's tokenizer and move to that PR; here
every model file llamacpp names is a GGUF.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): take the smoke test's backend as --backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): leave Podman and Docker alone while enable_containers is false

With containers disabled, lemond no longer sweeps at startup, connects to
the Docker socket, runs `image inspect`, or removes images on uninstall.
Setting enable_containers to false unloads every model running in a
container first, so none is left that a later crash would orphan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015BUXEd42tPQH67MQPW1XZh

* Update to a modern pin

* refactor(containers): drop the startup sweep

A killed lemond's containers already stop and remove themselves: the
attached `run --rm` child gets SIGTERM from PR_SET_PDEATHSIG and proxies it
into the container. Verified with Docker and rootful/rootless Podman. The
smoke test now kills lemond with a model loaded and checks no container
remains.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(load): list nathanw among the llamacpp_backend choices

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* ci(containers): cap the Dispatch container job at 45 minutes

A hung job would otherwise hold a pool machine for up to 4 hours.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* test(containers): skip the killed-lemond check under rootful Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(containers): link container images to their registry pages

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): skip the killed-lemond check under rootful Docker too

The Docker daemon owns the container, so whether it stops after lemond is
killed depends on the docker client forwarding SIGTERM in time, which is
racy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5SJqLuAuPwGaJQvWTwMai

* refactor(containers): drop the enable_containers setting

Container backends no longer need an opt-in before they install or
load. The setup assistant's remaining checks still report what is
missing.

- Remove the config key, its validation, getter and config effect.
- Remove the CLI consent prompt and pre-flight check, and the --yes
  flags on `config set` and `backends install` that only served it.
- Always check the Docker socket, read the image on disk for installed
  state, and remove the image on uninstall.
- Remove helpers left unused: containers_enabled,
  Router::get_container_model_names, WrappedServer::runs_in_container,
  ServerProcess::in_container.
- Update the spec, guides, generated API docs, tests and CI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* perf(containers): run container setup checks once per system-info build

The checks are host-wide, so every container backend got the same
report while each one ran them again, `podman info` included. Drop the
unused recipe and backend parameters from container_setup_failure and
compute its report at most once per pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* test(containers): fail when listing labeled containers or networks fails

A failed `ps` or `network ls` printed nothing, so the checks that expect
no leftovers passed without listing anything.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* feat(containers): run container backends from lemond.service with rootless Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): create Podman networks without a DNS server

Every model load failed under lemond.service with Podman 5 (Fedora 43/44,
Ubuntu 26.04, Debian 13):

  netavark: error while applying dns entries: aardvark-dns failed to start:
  Failed to connect to user scope bus via local transport

`podman network create` turns DNS on by default, and rootless netavark
(1.14 and later) starts aardvark-dns with `systemd-run --scope --user`, which
needs the account's systemd user manager. The lemonade system account has no
login session, so it has none.

Each per-model network holds one container, and lemond reaches it through
its published port or inspected address, never by name, so the network
needs no DNS server. Docker has no such option and is unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): let rootless Podman keep its runtime state in the host's /tmp

Every model load failed under lemond.service on Ubuntu 26.04 and Debian 13:

  Error: setting up Pasta: pasta failed with exit code 1: Couldn't open PID
  file /run/lemonade/containers/networks/rootless-netns/rootless-netns-conn.pid:
  Permission denied

Podman 5 sets up rootless networking with pasta, under $XDG_RUNTIME_DIR, which
the unit set to /run/lemonade. The AppArmor profile Ubuntu and Debian ship for
pasta allows writes only under /tmp, /run/user/<uid> and home directories under
/home, so it denied the PID file. ProtectHome=yes hides /run/user, and the
account has no login session to create /run/user/<uid> in any case.

With XDG_RUNTIME_DIR unset, Podman uses its own fallback in /tmp
(/tmp/storage-run-<uid>, or /tmp/containers-user-<uid> on Podman 4), which the
profile allows and Podman's own tmpfiles.d exempts from age-based cleanup.
lemond's own runtime directory stays /run/lemonade, through RuntimeDirectory=.

PrivateTmp goes with it. In a private /tmp, `podman` run as lemonade from a
shell finds no runtime state, and Podman 5 then refreshes the shared database:
the running container drops out of lemond's view, `podman stop` reports no such
container, and the engine keeps holding the GPU until the service stops.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(debian): create /var/lib/cni at install

On Ubuntu 24.04, every model load under lemond.service failed until the host
next rebooted:

  Error: unable to find network with name or ID lemonade-<...>: network not found

Podman 4's rootless network namespace bind-mounts a private directory over
/var/lib/cni, or, while that does not exist, over its nearest existing parent,
/var/lib. That mount hid /var/lib/lemonade, the lemonade account's home, which
holds its Podman storage and network configs, so `podman run` found no network
that `podman network create` had just made. Podman's own tmpfiles.d creates
/var/lib/cni only at boot (`D!`), so a fresh install hit this until a reboot.

The package now ships the directory in tmpfiles.d, which dh_installtmpfiles
applies at install. The .rpm keeps lemonade's home in /opt, and Podman 5 makes
no such mount, so neither needs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): keep DNS on rootful Podman's per-model networks

Podman 4's CNI backend gives an --internal network created with
--disable-dns no gateway, so the host has no route to the container and
rootful lemond, which connects at the container's address, waited on
llama-server until the test timed out. Only rootless Podman needs DNS
off, and it reaches the container through a published port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(ds4): move ds4:rocm to a container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): pick the ROCm container's GPU and check SELinux for /dev/kfd backends

ds4:rocm is the first container backend that maps /dev/kfd. Its container
gets HIP_VISIBLE_DEVICES for the GPU lemond sized it for, read from the KFD
topology next to system_info's other KFD reads, and hosts with SELinux
enforcing must allow containers to map GPU devices.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(containers): restore the Dispatch container job's 4-hour timeout

Four ds4 jobs downloading DS4's 81 GB checkpoint at once on fresh Dispatch
machines each ran past 45 minutes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(containers): run container backends from lemond.service with rootless Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): create Podman networks without a DNS server

Every model load failed under lemond.service with Podman 5 (Fedora 43/44,
Ubuntu 26.04, Debian 13):

  netavark: error while applying dns entries: aardvark-dns failed to start:
  Failed to connect to user scope bus via local transport

`podman network create` turns DNS on by default, and rootless netavark
(1.14 and later) starts aardvark-dns with `systemd-run --scope --user`, which
needs the account's systemd user manager. The lemonade system account has no
login session, so it has none.

Each per-model network holds one container, and lemond reaches it through
its published port or inspected address, never by name, so the network
needs no DNS server. Docker has no such option and is unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): let rootless Podman keep its runtime state in the host's /tmp

Every model load failed under lemond.service on Ubuntu 26.04 and Debian 13:

  Error: setting up Pasta: pasta failed with exit code 1: Couldn't open PID
  file /run/lemonade/containers/networks/rootless-netns/rootless-netns-conn.pid:
  Permission denied

Podman 5 sets up rootless networking with pasta, under $XDG_RUNTIME_DIR, which
the unit set to /run/lemonade. The AppArmor profile Ubuntu and Debian ship for
pasta allows writes only under /tmp, /run/user/<uid> and home directories under
/home, so it denied the PID file. ProtectHome=yes hides /run/user, and the
account has no login session to create /run/user/<uid> in any case.

With XDG_RUNTIME_DIR unset, Podman uses its own fallback in /tmp
(/tmp/storage-run-<uid>, or /tmp/containers-user-<uid> on Podman 4), which the
profile allows and Podman's own tmpfiles.d exempts from age-based cleanup.
lemond's own runtime directory stays /run/lemonade, through RuntimeDirectory=.

PrivateTmp goes with it. In a private /tmp, `podman` run as lemonade from a
shell finds no runtime state, and Podman 5 then refreshes the shared database:
the running container drops out of lemond's view, `podman stop` reports no such
container, and the engine keeps holding the GPU until the service stops.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(halogen): add the Halogen Flash container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(debian): create /var/lib/cni at install

On Ubuntu 24.04, every model load under lemond.service failed until the host
next rebooted:

  Error: unable to find network with name or ID lemonade-<...>: network not found

Podman 4's rootless network namespace bind-mounts a private directory over
/var/lib/cni, or, while that does not exist, over its nearest existing parent,
/var/lib. That mount hid /var/lib/lemonade, the lemonade account's home, which
holds its Podman storage and network configs, so `podman run` found no network
that `podman network create` had just made. Podman's own tmpfiles.d creates
/var/lib/cni only at boot (`D!`), so a fresh install hit this until a reboot.

The package now ships the directory in tmpfiles.d, which dh_installtmpfiles
applies at install. The .rpm keeps lemonade's home in /opt, and Podman 5 makes
no such mount, so neither needs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(ds4): move ds4:rocm to a container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(halogen): read the gfx1151 KFD node through system_info and report the setup steps

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(rocmfpx): add the ROCm FPX container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): keep DNS on rootful Podman's per-model networks

Podman 4's CNI backend gives an --internal network created with
--disable-dns no gateway, so the host has no route to the container and
rootful lemond, which connects at the container's address, waited on
llama-server until the test timed out. Only rootless Podman needs DNS
off, and it reaches the container through a published port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(containers): pick the ROCm container's GPU and check SELinux for /dev/kfd backends

ds4:rocm is the first container backend that maps /dev/kfd. Its container
gets HIP_VISIBLE_DEVICES for the GPU lemond sized it for, read from the KFD
topology next to system_info's other KFD reads, and hosts with SELinux
enforcing must allow containers to map GPU devices.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): mount a model directory one file at a time, for Halogen's tokenizer

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci: keep container backend images on the newest build of their tags

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(api): regenerate for the rocmfpx section

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* fix(app): show container setup steps in a collapsible section

The Setup guide button passed `action` to window.open, but lemond's
`action` holds a command, steps, or a link. A non-link action now shows
as a "Setup required" disclosure with the failure message and steps,
regardless of the technical-details toggle; links keep the button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check GPU device access instead of video/render membership

Desktop distros such as Ubuntu and Arch grant the logged-in account
/dev/kfd and /dev/dri access through ACLs, so an account outside video
and render could use the GPU yet was told to fix its groups. The setup
check now tests read/write access to /dev/kfd and each render node.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): ask Podman its mode before the host check

container_setup_failure() ran check_host() before check_podman(), so the
first pass after startup guessed rootless and could report a GPU access
failure on rootful Podman that the next pass cleared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check Docker with docker info instead of a fixed socket

The socket probe only looked at /var/run/docker.sock, so DOCKER_HOST,
Docker contexts and Docker Desktop's socket read as a refused account.
docker info follows the CLI's own connection, and its answer also
identifies Docker Desktop and rootless Docker, which cannot run
container backends, so those now get Podman as the fix step. The spec's
device-node rows now describe the access check instead of group
membership.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(lemond.service): keep PrivateTmp and give Podman's private /tmp state to tmpfiles.d

04919f697 turned PrivateTmp off for every lemond.service user, containers or
not, raising systemd-analyze security exposure from 8.5 to 8.7. Its reason was
`podman` run as lemonade from a shell: in the host's /tmp it finds none of the
service's runtime state, and Podman 5 then refreshes the shared database, so
lemond loses track of its running containers.

PrivateTmp=yes is back. XDG_RUNTIME_DIR stays unset, so rootless Podman still
keeps its runtime state in its own fallback in /tmp, which pasta's AppArmor
profile allows; under PrivateTmp that is the service's private /tmp.

Podman's own tmpfiles.d exempts its fallback only in the host's /tmp, and
age-based cleanup of /tmp reaches into the service's private one, so a new
tmpfiles.d entry exempts that instead. The .rpm installs it under /opt with a
link in /usr/lib/tmpfiles.d, like the unit, and applies it in %post;
dh_installtmpfiles applies it for the .deb.

The guide gives the command that runs Podman in the service's /tmp, through
JoinsNamespaceOf=lemond.service, in place of a plain `sudo -u lemonade podman`.
It uses --pty: SELinux on Fedora 44 denies dbus-broker the caller's pipes
that --pipe passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): escape container names so distinct models never share one

name_token() mapped every rejected character to `-`, so `user.foo/bar`,
`user.foo bar` and `user.foo-bar` shared a container and network name,
and starting one removed the other. Rejected characters now become `_`
plus two hex digits and `_` is doubled, so the mapping is one-to-one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): return a failed result for an empty command

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(containers): explain how Lemonade chooses Podman or Docker, with service steps for rootful Podman and Docker

The guide said only that Lemonade uses Podman when installed and Docker
otherwise. It now lists when each engine runs (rootless Podman by default,
rootful through CONTAINER_HOST or a root lemond, Docker without Podman) and
that rootful Podman and Docker are root-equivalent.

Its Docker step for lemond.service did nothing: the packages pull in Podman,
which takes precedence, so it now removes Podman first. Rootful Podman under
lemond.service had no steps, and root's socket is closed to lemonade, so the
guide gives a dedicated socket and service for lemonade that leave root's
podman.socket untouched. User-mode lemond shares the user's own Podman and
follows the CONTAINER_HOST its environment sets, which the guide now says.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require lemonade's subordinate IDs only for local rootless Podman

With CONTAINER_HOST pointing at root's Podman socket, as the guide's rootful
setup does, check_podman() still demanded subordinate UID and GID ranges for
lemonade and reported subordinate_ids when they were missing. Root's Podman
maps container IDs onto its own ranges and never uses lemonade's, so the check
blocked a working rootful setup on hosts where lemonade has no ranges.

The check now runs only when Podman is local and rootless, the same condition
check_host() already applies to the device-group checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): report rootful Podman on CNI instead of timing out

Rootful lemond connects at the container's address, and Podman 4's CNI
backend gives an --internal network no gateway on the host, with DNS on or
off. A model load therefore waited out the whole startup timeout (8 minutes
on Ubuntu 24.04 with Podman 4.9.3) and failed with "llama-server failed to
start". Publishing a port does not help: rootful Podman does not forward a
port published on 127.0.0.1 into an internal network on either backend.

check_podman() now reads the network backend in the same `podman info` call
that reports rootless mode, and reports rootful_cni with the way back to
rootless Podman: remove CONTAINER_HOST from /etc/default/lemond (service),
unset it (user mode), or run lemond as a regular account (root). The guide
names switching root's Podman to netavark as well, and warns that the
`podman system reset` it needs deletes all of root's containers and images.
Rootless Podman publishes a port and works on CNI, and rootful Podman on
netavark keeps working, so neither is affected.

The create_network comment named CNI for netavark's behavior, now corrected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(ds4): mark all ds4 models as suggested

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): drop per-model recipe_options pins

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(containers): explain the rootless port vs rootful address once

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): give a ROCm container the GPU its backend supports

get_rocm_arch() prefers a discrete GPU, so on a Strix Halo with an eGPU
HIP_VISIBLE_DEVICES pointed ds4 at the eGPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): stop calling the 81 GB model the only one

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): list model sizes in GB like the rest of the registry

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: give tool calls 100 tokens instead of 300

DS4's DSML tool-call markup takes 55 tokens for calculator_calculate(1+1),
just over the old 50. 300 let any backend ramble for paragraphs first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: accept an incomplete stream only when the token cap ended it

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(containers): keep the runner's persistent Hugging Face cache

Devlab Dispatch runners set HF_HOME to a cache on their scratch disk that
survives the job. Pointing it at RUNNER_TEMP downloaded every model on
every run, 70 minutes for DS4's 87 GB checkpoint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(ds4): drop the workspace-volume note now models use the runner cache

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep the desktop's memory free and auto-size the context

ds4-server grew its caches until the GPU pool was nearly full, which on a
Strix Halo starved the compositor and ended the login session. ds4 now
gets a free floor and a model tensor cache cap from one memory plan.

ds4 also reads its GGUF metadata, so auto-tune knows the model's 1M
context window and KV shape, and it sizes the context from what is free
above that floor through a new BackendOps hook: about 80k tokens on a
128 GB Strix Halo instead of the 4096 fallback.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): pin the 2026-10-24 build of the rocm-10.0 image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(router): re-run auto-tune for the retry after evicting every model

A load that fails for lack of memory is retried after evicting everything,
but the retry reused the context sized while those models still held the
memory. DS4 retried at the 4096 fallback with 80k tokens available.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(rocmfpx): pin the 2026-10-14 build of the rocm-10.0-rocmfpx image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(rocmfpx): keep one Qwen3.8-27B and add Gemma 4 and Qwen3.6 MoE models

Of the three Qwen3.8-27B builds, kingjones777's STRIX-MTP has by far the
lowest perplexity (2.61 against 6.55 for ROCmI4 and 7.36 for FAST on the
same text) at the same decode speed, with vision and MTP. It becomes the
suggested model and the test model; the other two and Qwopus3.6-27B go.

Gemma-4-26B-A4B and Qwen3.6-35B-A3B add different families and MoE
architectures, each passing chat, tool calls and vision at 54 and 72
tokens/s decode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(halogen): serve the v2 checkpoint on the 0.18.19 image

Halogen's default checkpoint since 0.15 is v2: one file plus its lookup
table, closer to the original model than w4b and its overlays, and about
3.5 GiB smaller. The four w4b variants become one model, v2 with the
vision tower, and the image moves to 0.18.19.

Lemonade now leaves the KV pool, slots and prompt cache to Halogen's
defaults, which match the old pins at the native context, so a smaller
ctx_size now shrinks the pool: 65536 takes 79.0 GiB instead of 89.8.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(halogen): refuse a start the host cannot hold, so the router evicts

Halogen sizes its pool from MemTotal, blind to other models, and on a host
short of its weights plus that pool it stalls in the kernel instead of
failing. It now refuses below the weights plus min_resident_gb of
MemAvailable, so the router evicts the other models and retries, as DS4
does. A GTT-only check misses a 22 GB llama.cpp co-tenant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(router): count Halogen's pinned weights as used when loading beside it

MemAvailable counts Halogen's 63 GiB of pinned weights as reclaimable
cache, so with Halogen resident lemond saw 78 GiB free where 15 GiB was.
A 22 GB model then loaded beside it and overcommitted the host. A backend
now reports such memory; the router evicts its holder when the next model
does not fit beside it, and auto-tune counts it as used when it does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* revert(halogen): drop the memory checks for a host-exclusive slot policy

Halogen is built to own its machine, and its pinned weights read as free
memory, so checks against free memory in either load order are fragile.
The next commit gives it the machine instead.

This reverts commits bfccc318c and 84c23c286.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(router): add the ExclusiveHost slot policy and give it to Halogen

A backend with this policy shares the machine with no other local model:
loading it evicts every other local model, and loading another local
model evicts it. Cloud models stay. Halogen takes it because it sizes its
pool from MemTotal and its pinned weights read as free memory, so nothing
can safely load beside it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(debian): keep the postinst chown out of Podman's storage and off symlinks

The postinst re-owns /var/lib/lemonade on every install with
`find ... -exec chown lemonade:lemonade`. Rootless Podman now keeps the
service's image storage in that home under .local/share/containers, so
the walk entered every image layer. Plain chown follows symlinks, and
layers are full of absolute ones (/bin/sh -> /usr/bin/busybox), so root
re-owned the host's files: reinstalling the same .deb on Ubuntu 24.04
after pulling two images handed /run, /run/lock, /etc/ssl/certs,
/usr/bin/busybox and 13 other host files to lemonade. The walk also
flattened the layers' subordinate-ID owners and cleared their setuid
bits, so `su` in an ubuntu image lost setuid.

Prune Podman's storage, which lemonade already owns and Podman manages,
and use chown -h so a symlink anywhere in the home is re-owned itself
instead of its target. The chown -R this walk replaced in #3393 never
followed symlinks, so -h restores that.

Tested on a fresh Ubuntu 24.04 VM: after the reinstall no host file
changes owner, the layers keep their 5 sub-UID files and 8 setuid files,
and a root-owned file in ~/.config is still re-owned to lemonade.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(nathanw): pin the 2026-10-25 vulkan-radv-performance image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): run resident with DSpark when the GPU pool holds the model

The streaming plan was tuned for a 62 GiB pool, where the 81 GiB IQ2XXS
model cannot be resident. On a 128 GB Strix Halo with the default 115 GiB
GTT window it still streamed experts from disk and decoded at 2.4 tok/s.
When the pool holds the weights plus 24 GiB for the desktop, ds4 now runs
resident (217-311 tok/s prefill, 12.5-14 tok/s decode) and loads the
model's DSpark support file, which streaming cannot use. The IQ2XXS
models gain their DSpark drafts; smaller pools keep the streaming plan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): don't pass Lemonade's /no_think prefix to DeepSeek

ds4-server takes the reasoning_effort and chat_template_kwargs Lemonade
sends when a client turns thinking off, so the /no_think prefix Lemonade
adds beside them for other templates only reaches DeepSeek as text. With
it, the resident Vision model answered the tool-call test with "Let me
try again" and ran out of tokens before closing the call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(nathanw): default to 2048-token batches

llama-server's 512-token ubatch held the Vulkan performance fork well
below its author's published prefill. At 2048, which the author measures
and recommends for MoE models, Qwen3.6-35B-A3B prefills at 1625 tok/s at
4k and 1909 at 32k (from 1373 and 1531) and Qwen3.8-Flash-Next at 717
and 909 (from 580 and 689), with decode unchanged. A user's own -b or
-ub still wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(rocmfpx): default to 2048-token batches

At 2048 rather than llama-server's 512, Qwen3.6-35B-A3B-ROCmFP4-MTP
prefills at 1789 tok/s at 4k and 1440 at 32k (from 1388 and 1125), with
decode unchanged; the dense 27B is unchanged. A longer MTP draft than the
build's default of 3 helped neither model, so it stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep ds4's own 16 GiB floor when resident

A 24 GiB reserve made the load check ask for 110.3 GiB free on a 115 GiB
pool that an idle desktop leaves at 108.7, so the resident model never
started, and it put the 97.6 GB Hybrid model on the resident path with a
check it could never pass. A resident model allocates its context up
front rather than growing into the floor, so ds4's own 16 GiB is enough.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep the memory-plan comment within the 12-line limit

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB96uc8rYAthscmomBh

* fix(packaging): recommend Podman only when Docker is missing

Recommends: podman installed Podman alongside an existing Docker, and since
Podman takes precedence when both are on PATH, Docker users had to remove it
again. The .deb now recommends podman | docker.io | docker-ce, and the .rpm
(podman or docker or docker-ce), so an installed Docker satisfies it. On
Fedora, moby-engine provides docker; Docker's own docker-ce does not.

The .rpm's recommendation also never reached the package on Fedora 43:
CPack before CMake 4.1 ignores CPACK_RPM_PACKAGE_RECOMMENDS, so the tag goes
into the spec preamble through CPACK_RPM_SPEC_MORE_DEFINE instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(packaging): warn when lemonade's subordinate ID range can't be allocated

The postinsts ignored a failed usermod --add-subuids/--add-subgids with
|| true, so the only sign was usermod's own error, with nothing tying it to
container backends. They now say what the failure breaks. It still doesn't
fail the install, since only container backends need the range.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): grant GPU access through render alone

Of the nodes a container backend opens, video owns only /dev/dri/card*, the
display node; /dev/kfd and the renderD* nodes belong to render. On a Strix
Halo host, nathanw ran inference on the GPU at the same speed as the
lemonade account with only render, where it could not open card1, as with
video and render, and with no card1 in the container at all. So the
packages add lemonade to render only, as they did before container
backends, and the setup steps and Docker's --group-add ask for render alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): run without PrivateTmp so Podman's state stays in the host's /tmp

With PrivateTmp, rootless Podman's runtime state sat in the service's private
/tmp, which took three workarounds: a tmpfiles.d entry to keep age-based
cleanup out of it, packaging to install that entry, and a systemd-run
JoinsNamespaceOf= command in the guide, because a plain
`sudo -u lemonade podman` saw an empty /tmp and Podman 5 then reset the state
of the containers lemond was running.

In the host's /tmp, Podman's own tmpfiles.d already protects that state and
plain `podman` sees it, so the workarounds go. The cost is the private /tmp,
a small step next to the NoNewPrivileges and RestrictNamespaces rootless
Podman already needs off.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(backends): keep the previous container image until the new pin is committed

Stage version.txt in a sibling directory, check the write, then swap it
into place. The previous image is removed only after the swap succeeds,
so a failed directory creation or marker write no longer leaves a
working backend without its image.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(packaging): allocate subordinate IDs when nsswitch.conf says subid: files

subid: files means the local /etc/subuid and /etc/subgid, so only a
subid: line naming another source (sss, ldap, ...) is left to the
administrator.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(containers): include the lemond port in container names

Two lemond instances on one container daemon loading the same model
produced the same name, and start() removes that name unconditionally,
so the second instance killed the first one's container. The name is
now lemonade-<port>-<recipe>-<backend>-<model>, still stable per
instance so a load clears that instance's own crash leftovers, and the
container carries an ai.lemonade.instance label.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* refactor(containers): trim the install staging and drop the unused instance label

The staging directory is hidden and cleared at the start of the next
install, so the failure paths no longer clean it up. The port in the
container name already keeps instances apart, so the ai.lemonade.instance
label is dropped until something filters on it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(ds4): launch without a free-memory check, as llamacpp does

ds4 was the only backend that refused to start on an estimate of free GPU
memory. On a host with a large BIOS carve-out that estimate reads far
below what the GPU can use, so ds4 refused every load. A load that
really runs short now fails or times out in start_server like any other
backend, and the router evicts and retries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB4k4N92f7HVjp2wtBG

* fix(lemond-user.service): keep the sandbox and run containers through podman.socket

In a user manager, every sandboxing option the unit had on main takes away
something rootless Podman needs: the seccomp-based ones set no-new-privileges,
which stops the setuid newuidmap/newgidmap helpers, and PrivateTmp and
ProtectSystem confine the service to a user namespace that maps only the
user's own UID. So the unit had dropped them all.

The unit now keeps them and sets CONTAINER_HOST to the user's podman.socket.
`podman` in the unit only sends requests to Podman's API service, which
systemd starts outside the unit, and that service creates the containers.
lemond treats a socket in the account's own runtime directory as rootless
Podman, and passes the crun annotation run.oci.keep_original_groups=1 there,
since the Podman API rejects --group-add keep-groups.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require crun for rootless Podman and recommend it

Rootless containers reach the GPU through the account's render group, which
--group-add keep-groups (and its run.oci.keep_original_groups annotation)
carries into the container. Only crun supports that; runc always resets a
container's supplementary groups, so under runc the engine cannot open the
render node and silently runs on the CPU, about 14x slower on nathanw.

Podman installs crun by default, but on Debian and Ubuntu a host that had
docker.io first already has runc, which satisfies Podman's crun | runc
dependency. The Podman setup check now reads the OCI runtime from
`podman info` and, for rootless Podman on anything but crun, asks for the
host's install command for crun. That answer is not cached, so installing
crun takes effect without restarting lemond. The .deb and .rpm also
recommend crun.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): give the podman.socket and CONTAINER_HOST steps for a failing podman info

The setup check's step for a failing `podman info` depends on CONTAINER_HOST
since the user unit moved to podman.socket; the spec's tables still gave
only the generic step.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): expect the lemond port in container names

8e03e4d renamed containers to lemonade-<port>-<recipe>-<backend>-<model>,
but the smoke test still asserted the old lemonade-<recipe>-<backend>-
prefix, failing test_03_load_and_chat on docker and both podman modes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB7BgnHh2Hv3FiEwQHz

* feat(halogen): pin the 0.18.22 release tag instead of latest

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(halogen): turn reasoning off per request for the Responses API

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(halogen): list the bundle files in server_models.json

The lookup table, vision tower and tokenizer files become checkpoints, so
the download check covers each one and the select_checkpoint_files override
and the halogen_* model fields go away.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: simplify container pin updater to open a PR and let CI validate it

Drop the build/validate jobs and the shared test-container-backend action.
The weekly job now only resolves the newest digest of each pinned tag and
opens a ci:backends-labeled PR with GH_TOKEN, so test-container-backends in
cpp_server_build_test_release.yml validates it before merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* ci: run the container pin lookup on PRs that change pins or backend descriptors

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* ci: move container pins to the newest version tag and merge the update PR automatically

A pin whose tag carries version numbers, such as halogen's 0.18.22, now
moves to the highest-numbered tag of the same shape before its digest is
resolved. The update PR gets auto-merge, and older update PRs it
supersedes are closed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* ci: fall back to GITHUB_TOKEN for the pin update PR and retry registry errors

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

* ci: open the container pin PR the same way the other updaters do

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB8rNF9LzZYEx4c5dbK

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Sawan Srivastava <[email protected]>
2026-11-03 21:12:01 +00:00
204f00df74 feat(halogen): add the Halogen Flash container backend (#3712)
* feat(backends): run container backends through ContainerManager, starting with llamacpp:nathanw

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): list every missing setup step and ask for consent at install

Container setup now reports what a user still has to do in one pass,
in the order they do it, and the CLI finishes the install once only
consent is left.

- Setup checks run in two groups. Before consent: the container tool
  on PATH, then the video/render groups (or the Docker socket), then
  enable_containers. These read only PATH, groups and sockets, so no
  container command runs before the user opts in; Podman counts as
  rootful when CONTAINER_HOST is set or lemond runs as root, until
  podman info answers. After consent: podman info, then SELinux.
- Every failed check is reported at once. /system-info gives one
  problem per line in message, numbered steps in action (install
  commands, group changes, enable_containers, and logging out last),
  and the failed checks' ids in setup_checks.
- lemonade backends prints message and action lines side by side.
- lemonade backends install, run and load check the backend's setup
  before installing or downloading anything. When enable_containers
  is the only step left, they show the existing warning, enable it on
  yes and finish the command; backends install --yes skips the prompt.
  Otherwise they print every problem and step and exit 1.
- The spec, user guide, CLI and API docs follow the new order and
  fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* fix(cli): read the selected backend only when recipe options were given

lemonade run and load without a --<recipe> option have no recipe
options, and reading the backend option from them aborted the CLI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* style(containers): trim the setup comments the comment-slop hook flagged

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* ci(containers): gate the container smoke test like the other hosted test jobs

The signing and release-branch skips exist to spare self-hosted runners;
the smoke test runs on ubuntu-latest.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(containers): pin the container smoke test to Ubuntu 24.04

The job installs the 24.04 .deb on the bare runner, and ubuntu-latest moves
to 26.04 in November 2026, where libmbedcrypto7t64 does not exist. The
comments now say why the job runs on the bare runner and needs the PPA.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): assert lemond's mode in the smoke test and log at debug

test_03 now checks the published port on lemond's container, so each leg
proves lemond detected the intended mode, not only that the tool runs in it.
LEMONADE_CI_MODE puts llama-server's output in the uploaded logs, as in the
other jobs that start lemond.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci: say why backends-gate also lists jobs that run on every PR

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): cut the container spec changes back to what the implementation made false

Keeps the opt-in invariants (off by default, install and load refused while
off, no container command before opt-in), rootful Podman's connection path,
the Podman answers check, and reporting every failed check at once. Drops
setup_checks, action ordering, CLI prompting, and the expect_rootless detail.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): name the enable warning instead of quoting it

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(llamacpp): list nathanw as a guest backend, as its descriptor declares

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(cli): word the enable_containers prompts as enabling containers, not backends

The setting enables every container, whatever its tier, so the warning no
longer calls the images community-built.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(backends): drop the image allowlist comment from ContainerPolicy

ContainerManager::allowed_image is the allowlist; the comment restated it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* refactor(containers): leave GPU selection and the SELinux check to the first ROCm container backend

llamacpp:nathanw maps only /dev/dri, so nothing here reached the
HIP_VISIBLE_DEVICES lookup or the SELinux check, both gated on /dev/kfd.
needs_gfx1151_cwsr_fix goes back to its own KFD read.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): drop checks that restate code, and mount single files only

The directory mounts serve Halogen's tokenizer and move to that PR; here
every model file llamacpp names is a GGUF.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): take the smoke test's backend as --backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): leave Podman and Docker alone while enable_containers is false

With containers disabled, lemond no longer sweeps at startup, connects to
the Docker socket, runs `image inspect`, or removes images on uninstall.
Setting enable_containers to false unloads every model running in a
container first, so none is left that a later crash would orphan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015BUXEd42tPQH67MQPW1XZh

* Update to a modern pin

* refactor(containers): drop the startup sweep

A killed lemond's containers already stop and remove themselves: the
attached `run --rm` child gets SIGTERM from PR_SET_PDEATHSIG and proxies it
into the container. Verified with Docker and rootful/rootless Podman. The
smoke test now kills lemond with a model loaded and checks no container
remains.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(load): list nathanw among the llamacpp_backend choices

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* ci(containers): cap the Dispatch container job at 45 minutes

A hung job would otherwise hold a pool machine for up to 4 hours.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* test(containers): skip the killed-lemond check under rootful Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(containers): link container images to their registry pages

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): skip the killed-lemond check under rootful Docker too

The Docker daemon owns the container, so whether it stops after lemond is
killed depends on the docker client forwarding SIGTERM in time, which is
racy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5SJqLuAuPwGaJQvWTwMai

* refactor(containers): drop the enable_containers setting

Container backends no longer need an opt-in before they install or
load. The setup assistant's remaining checks still report what is
missing.

- Remove the config key, its validation, getter and config effect.
- Remove the CLI consent prompt and pre-flight check, and the --yes
  flags on `config set` and `backends install` that only served it.
- Always check the Docker socket, read the image on disk for installed
  state, and remove the image on uninstall.
- Remove helpers left unused: containers_enabled,
  Router::get_container_model_names, WrappedServer::runs_in_container,
  ServerProcess::in_container.
- Update the spec, guides, generated API docs, tests and CI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* perf(containers): run container setup checks once per system-info build

The checks are host-wide, so every container backend got the same
report while each one ran them again, `podman info` included. Drop the
unused recipe and backend parameters from container_setup_failure and
compute its report at most once per pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* test(containers): fail when listing labeled containers or networks fails

A failed `ps` or `network ls` printed nothing, so the checks that expect
no leftovers passed without listing anything.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* feat(containers): run container backends from lemond.service with rootless Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): create Podman networks without a DNS server

Every model load failed under lemond.service with Podman 5 (Fedora 43/44,
Ubuntu 26.04, Debian 13):

  netavark: error while applying dns entries: aardvark-dns failed to start:
  Failed to connect to user scope bus via local transport

`podman network create` turns DNS on by default, and rootless netavark
(1.14 and later) starts aardvark-dns with `systemd-run --scope --user`, which
needs the account's systemd user manager. The lemonade system account has no
login session, so it has none.

Each per-model network holds one container, and lemond reaches it through
its published port or inspected address, never by name, so the network
needs no DNS server. Docker has no such option and is unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): let rootless Podman keep its runtime state in the host's /tmp

Every model load failed under lemond.service on Ubuntu 26.04 and Debian 13:

  Error: setting up Pasta: pasta failed with exit code 1: Couldn't open PID
  file /run/lemonade/containers/networks/rootless-netns/rootless-netns-conn.pid:
  Permission denied

Podman 5 sets up rootless networking with pasta, under $XDG_RUNTIME_DIR, which
the unit set to /run/lemonade. The AppArmor profile Ubuntu and Debian ship for
pasta allows writes only under /tmp, /run/user/<uid> and home directories under
/home, so it denied the PID file. ProtectHome=yes hides /run/user, and the
account has no login session to create /run/user/<uid> in any case.

With XDG_RUNTIME_DIR unset, Podman uses its own fallback in /tmp
(/tmp/storage-run-<uid>, or /tmp/containers-user-<uid> on Podman 4), which the
profile allows and Podman's own tmpfiles.d exempts from age-based cleanup.
lemond's own runtime directory stays /run/lemonade, through RuntimeDirectory=.

PrivateTmp goes with it. In a private /tmp, `podman` run as lemonade from a
shell finds no runtime state, and Podman 5 then refreshes the shared database:
the running container drops out of lemond's view, `podman stop` reports no such
container, and the engine keeps holding the GPU until the service stops.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(debian): create /var/lib/cni at install

On Ubuntu 24.04, every model load under lemond.service failed until the host
next rebooted:

  Error: unable to find network with name or ID lemonade-<...>: network not found

Podman 4's rootless network namespace bind-mounts a private directory over
/var/lib/cni, or, while that does not exist, over its nearest existing parent,
/var/lib. That mount hid /var/lib/lemonade, the lemonade account's home, which
holds its Podman storage and network configs, so `podman run` found no network
that `podman network create` had just made. Podman's own tmpfiles.d creates
/var/lib/cni only at boot (`D!`), so a fresh install hit this until a reboot.

The package now ships the directory in tmpfiles.d, which dh_installtmpfiles
applies at install. The .rpm keeps lemonade's home in /opt, and Podman 5 makes
no such mount, so neither needs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): keep DNS on rootful Podman's per-model networks

Podman 4's CNI backend gives an --internal network created with
--disable-dns no gateway, so the host has no route to the container and
rootful lemond, which connects at the container's address, waited on
llama-server until the test timed out. Only rootless Podman needs DNS
off, and it reaches the container through a published port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(ds4): move ds4:rocm to a container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): pick the ROCm container's GPU and check SELinux for /dev/kfd backends

ds4:rocm is the first container backend that maps /dev/kfd. Its container
gets HIP_VISIBLE_DEVICES for the GPU lemond sized it for, read from the KFD
topology next to system_info's other KFD reads, and hosts with SELinux
enforcing must allow containers to map GPU devices.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(containers): restore the Dispatch container job's 4-hour timeout

Four ds4 jobs downloading DS4's 81 GB checkpoint at once on fresh Dispatch
machines each ran past 45 minutes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(containers): run container backends from lemond.service with rootless Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): create Podman networks without a DNS server

Every model load failed under lemond.service with Podman 5 (Fedora 43/44,
Ubuntu 26.04, Debian 13):

  netavark: error while applying dns entries: aardvark-dns failed to start:
  Failed to connect to user scope bus via local transport

`podman network create` turns DNS on by default, and rootless netavark
(1.14 and later) starts aardvark-dns with `systemd-run --scope --user`, which
needs the account's systemd user manager. The lemonade system account has no
login session, so it has none.

Each per-model network holds one container, and lemond reaches it through
its published port or inspected address, never by name, so the network
needs no DNS server. Docker has no such option and is unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): let rootless Podman keep its runtime state in the host's /tmp

Every model load failed under lemond.service on Ubuntu 26.04 and Debian 13:

  Error: setting up Pasta: pasta failed with exit code 1: Couldn't open PID
  file /run/lemonade/containers/networks/rootless-netns/rootless-netns-conn.pid:
  Permission denied

Podman 5 sets up rootless networking with pasta, under $XDG_RUNTIME_DIR, which
the unit set to /run/lemonade. The AppArmor profile Ubuntu and Debian ship for
pasta allows writes only under /tmp, /run/user/<uid> and home directories under
/home, so it denied the PID file. ProtectHome=yes hides /run/user, and the
account has no login session to create /run/user/<uid> in any case.

With XDG_RUNTIME_DIR unset, Podman uses its own fallback in /tmp
(/tmp/storage-run-<uid>, or /tmp/containers-user-<uid> on Podman 4), which the
profile allows and Podman's own tmpfiles.d exempts from age-based cleanup.
lemond's own runtime directory stays /run/lemonade, through RuntimeDirectory=.

PrivateTmp goes with it. In a private /tmp, `podman` run as lemonade from a
shell finds no runtime state, and Podman 5 then refreshes the shared database:
the running container drops out of lemond's view, `podman stop` reports no such
container, and the engine keeps holding the GPU until the service stops.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(halogen): add the Halogen Flash container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(debian): create /var/lib/cni at install

On Ubuntu 24.04, every model load under lemond.service failed until the host
next rebooted:

  Error: unable to find network with name or ID lemonade-<...>: network not found

Podman 4's rootless network namespace bind-mounts a private directory over
/var/lib/cni, or, while that does not exist, over its nearest existing parent,
/var/lib. That mount hid /var/lib/lemonade, the lemonade account's home, which
holds its Podman storage and network configs, so `podman run` found no network
that `podman network create` had just made. Podman's own tmpfiles.d creates
/var/lib/cni only at boot (`D!`), so a fresh install hit this until a reboot.

The package now ships the directory in tmpfiles.d, which dh_installtmpfiles
applies at install. The .rpm keeps lemonade's home in /opt, and Podman 5 makes
no such mount, so neither needs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(ds4): move ds4:rocm to a container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(halogen): read the gfx1151 KFD node through system_info and report the setup steps

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(rocmfpx): add the ROCm FPX container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): keep DNS on rootful Podman's per-model networks

Podman 4's CNI backend gives an --internal network created with
--disable-dns no gateway, so the host has no route to the container and
rootful lemond, which connects at the container's address, waited on
llama-server until the test timed out. Only rootless Podman needs DNS
off, and it reaches the container through a published port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(containers): pick the ROCm container's GPU and check SELinux for /dev/kfd backends

ds4:rocm is the first container backend that maps /dev/kfd. Its container
gets HIP_VISIBLE_DEVICES for the GPU lemond sized it for, read from the KFD
topology next to system_info's other KFD reads, and hosts with SELinux
enforcing must allow containers to map GPU devices.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): mount a model directory one file at a time, for Halogen's tokenizer

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(api): regenerate for the rocmfpx section

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* fix(app): show container setup steps in a collapsible section

The Setup guide button passed `action` to window.open, but lemond's
`action` holds a command, steps, or a link. A non-link action now shows
as a "Setup required" disclosure with the failure message and steps,
regardless of the technical-details toggle; links keep the button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check GPU device access instead of video/render membership

Desktop distros such as Ubuntu and Arch grant the logged-in account
/dev/kfd and /dev/dri access through ACLs, so an account outside video
and render could use the GPU yet was told to fix its groups. The setup
check now tests read/write access to /dev/kfd and each render node.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): ask Podman its mode before the host check

container_setup_failure() ran check_host() before check_podman(), so the
first pass after startup guessed rootless and could report a GPU access
failure on rootful Podman that the next pass cleared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check Docker with docker info instead of a fixed socket

The socket probe only looked at /var/run/docker.sock, so DOCKER_HOST,
Docker contexts and Docker Desktop's socket read as a refused account.
docker info follows the CLI's own connection, and its answer also
identifies Docker Desktop and rootless Docker, which cannot run
container backends, so those now get Podman as the fix step. The spec's
device-node rows now describe the access check instead of group
membership.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(lemond.service): keep PrivateTmp and give Podman's private /tmp state to tmpfiles.d

04919f697 turned PrivateTmp off for every lemond.service user, containers or
not, raising systemd-analyze security exposure from 8.5 to 8.7. Its reason was
`podman` run as lemonade from a shell: in the host's /tmp it finds none of the
service's runtime state, and Podman 5 then refreshes the shared database, so
lemond loses track of its running containers.

PrivateTmp=yes is back. XDG_RUNTIME_DIR stays unset, so rootless Podman still
keeps its runtime state in its own fallback in /tmp, which pasta's AppArmor
profile allows; under PrivateTmp that is the service's private /tmp.

Podman's own tmpfiles.d exempts its fallback only in the host's /tmp, and
age-based cleanup of /tmp reaches into the service's private one, so a new
tmpfiles.d entry exempts that instead. The .rpm installs it under /opt with a
link in /usr/lib/tmpfiles.d, like the unit, and applies it in %post;
dh_installtmpfiles applies it for the .deb.

The guide gives the command that runs Podman in the service's /tmp, through
JoinsNamespaceOf=lemond.service, in place of a plain `sudo -u lemonade podman`.
It uses --pty: SELinux on Fedora 44 denies dbus-broker the caller's pipes
that --pipe passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): escape container names so distinct models never share one

name_token() mapped every rejected character to `-`, so `user.foo/bar`,
`user.foo bar` and `user.foo-bar` shared a container and network name,
and starting one removed the other. Rejected characters now become `_`
plus two hex digits and `_` is doubled, so the mapping is one-to-one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): return a failed result for an empty command

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(containers): explain how Lemonade chooses Podman or Docker, with service steps for rootful Podman and Docker

The guide said only that Lemonade uses Podman when installed and Docker
otherwise. It now lists when each engine runs (rootless Podman by default,
rootful through CONTAINER_HOST or a root lemond, Docker without Podman) and
that rootful Podman and Docker are root-equivalent.

Its Docker step for lemond.service did nothing: the packages pull in Podman,
which takes precedence, so it now removes Podman first. Rootful Podman under
lemond.service had no steps, and root's socket is closed to lemonade, so the
guide gives a dedicated socket and service for lemonade that leave root's
podman.socket untouched. User-mode lemond shares the user's own Podman and
follows the CONTAINER_HOST its environment sets, which the guide now says.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require lemonade's subordinate IDs only for local rootless Podman

With CONTAINER_HOST pointing at root's Podman socket, as the guide's rootful
setup does, check_podman() still demanded subordinate UID and GID ranges for
lemonade and reported subordinate_ids when they were missing. Root's Podman
maps container IDs onto its own ranges and never uses lemonade's, so the check
blocked a working rootful setup on hosts where lemonade has no ranges.

The check now runs only when Podman is local and rootless, the same condition
check_host() already applies to the device-group checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): report rootful Podman on CNI instead of timing out

Rootful lemond connects at the container's address, and Podman 4's CNI
backend gives an --internal network no gateway on the host, with DNS on or
off. A model load therefore waited out the whole startup timeout (8 minutes
on Ubuntu 24.04 with Podman 4.9.3) and failed with "llama-server failed to
start". Publishing a port does not help: rootful Podman does not forward a
port published on 127.0.0.1 into an internal network on either backend.

check_podman() now reads the network backend in the same `podman info` call
that reports rootless mode, and reports rootful_cni with the way back to
rootless Podman: remove CONTAINER_HOST from /etc/default/lemond (service),
unset it (user mode), or run lemond as a regular account (root). The guide
names switching root's Podman to netavark as well, and warns that the
`podman system reset` it needs deletes all of root's containers and images.
Rootless Podman publishes a port and works on CNI, and rootful Podman on
netavark keeps working, so neither is affected.

The create_network comment named CNI for netavark's behavior, now corrected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(ds4): mark all ds4 models as suggested

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): drop per-model recipe_options pins

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(containers): explain the rootless port vs rootful address once

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): give a ROCm container the GPU its backend supports

get_rocm_arch() prefers a discrete GPU, so on a Strix Halo with an eGPU
HIP_VISIBLE_DEVICES pointed ds4 at the eGPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): stop calling the 81 GB model the only one

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): list model sizes in GB like the rest of the registry

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: give tool calls 100 tokens instead of 300

DS4's DSML tool-call markup takes 55 tokens for calculator_calculate(1+1),
just over the old 50. 300 let any backend ramble for paragraphs first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: accept an incomplete stream only when the token cap ended it

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(containers): keep the runner's persistent Hugging Face cache

Devlab Dispatch runners set HF_HOME to a cache on their scratch disk that
survives the job. Pointing it at RUNNER_TEMP downloaded every model on
every run, 70 minutes for DS4's 87 GB checkpoint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(ds4): drop the workspace-volume note now models use the runner cache

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep the desktop's memory free and auto-size the context

ds4-server grew its caches until the GPU pool was nearly full, which on a
Strix Halo starved the compositor and ended the login session. ds4 now
gets a free floor and a model tensor cache cap from one memory plan.

ds4 also reads its GGUF metadata, so auto-tune knows the model's 1M
context window and KV shape, and it sizes the context from what is free
above that floor through a new BackendOps hook: about 80k tokens on a
128 GB Strix Halo instead of the 4096 fallback.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): pin the 2026-10-24 build of the rocm-10.0 image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(router): re-run auto-tune for the retry after evicting every model

A load that fails for lack of memory is retried after evicting everything,
but the retry reused the context sized while those models still held the
memory. DS4 retried at the 4096 fallback with 80k tokens available.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(rocmfpx): pin the 2026-10-14 build of the rocm-10.0-rocmfpx image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(rocmfpx): keep one Qwen3.8-27B and add Gemma 4 and Qwen3.6 MoE models

Of the three Qwen3.8-27B builds, kingjones777's STRIX-MTP has by far the
lowest perplexity (2.61 against 6.55 for ROCmI4 and 7.36 for FAST on the
same text) at the same decode speed, with vision and MTP. It becomes the
suggested model and the test model; the other two and Qwopus3.6-27B go.

Gemma-4-26B-A4B and Qwen3.6-35B-A3B add different families and MoE
architectures, each passing chat, tool calls and vision at 54 and 72
tokens/s decode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(halogen): serve the v2 checkpoint on the 0.18.19 image

Halogen's default checkpoint since 0.15 is v2: one file plus its lookup
table, closer to the original model than w4b and its overlays, and about
3.5 GiB smaller. The four w4b variants become one model, v2 with the
vision tower, and the image moves to 0.18.19.

Lemonade now leaves the KV pool, slots and prompt cache to Halogen's
defaults, which match the old pins at the native context, so a smaller
ctx_size now shrinks the pool: 65536 takes 79.0 GiB instead of 89.8.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(halogen): refuse a start the host cannot hold, so the router evicts

Halogen sizes its pool from MemTotal, blind to other models, and on a host
short of its weights plus that pool it stalls in the kernel instead of
failing. It now refuses below the weights plus min_resident_gb of
MemAvailable, so the router evicts the other models and retries, as DS4
does. A GTT-only check misses a 22 GB llama.cpp co-tenant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(router): count Halogen's pinned weights as used when loading beside it

MemAvailable counts Halogen's 63 GiB of pinned weights as reclaimable
cache, so with Halogen resident lemond saw 78 GiB free where 15 GiB was.
A 22 GB model then loaded beside it and overcommitted the host. A backend
now reports such memory; the router evicts its holder when the next model
does not fit beside it, and auto-tune counts it as used when it does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* revert(halogen): drop the memory checks for a host-exclusive slot policy

Halogen is built to own its machine, and its pinned weights read as free
memory, so checks against free memory in either load order are fragile.
The next commit gives it the machine instead.

This reverts commits bfccc318c and 84c23c286.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(router): add the ExclusiveHost slot policy and give it to Halogen

A backend with this policy shares the machine with no other local model:
loading it evicts every other local model, and loading another local
model evicts it. Cloud models stay. Halogen takes it because it sizes its
pool from MemTotal and its pinned weights read as free memory, so nothing
can safely load beside it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(debian): keep the postinst chown out of Podman's storage and off symlinks

The postinst re-owns /var/lib/lemonade on every install with
`find ... -exec chown lemonade:lemonade`. Rootless Podman now keeps the
service's image storage in that home under .local/share/containers, so
the walk entered every image layer. Plain chown follows symlinks, and
layers are full of absolute ones (/bin/sh -> /usr/bin/busybox), so root
re-owned the host's files: reinstalling the same .deb on Ubuntu 24.04
after pulling two images handed /run, /run/lock, /etc/ssl/certs,
/usr/bin/busybox and 13 other host files to lemonade. The walk also
flattened the layers' subordinate-ID owners and cleared their setuid
bits, so `su` in an ubuntu image lost setuid.

Prune Podman's storage, which lemonade already owns and Podman manages,
and use chown -h so a symlink anywhere in the home is re-owned itself
instead of its target. The chown -R this walk replaced in #3393 never
followed symlinks, so -h restores that.

Tested on a fresh Ubuntu 24.04 VM: after the reinstall no host file
changes owner, the layers keep their 5 sub-UID files and 8 setuid files,
and a root-owned file in ~/.config is still re-owned to lemonade.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(nathanw): pin the 2026-10-25 vulkan-radv-performance image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): run resident with DSpark when the GPU pool holds the model

The streaming plan was tuned for a 62 GiB pool, where the 81 GiB IQ2XXS
model cannot be resident. On a 128 GB Strix Halo with the default 115 GiB
GTT window it still streamed experts from disk and decoded at 2.4 tok/s.
When the pool holds the weights plus 24 GiB for the desktop, ds4 now runs
resident (217-311 tok/s prefill, 12.5-14 tok/s decode) and loads the
model's DSpark support file, which streaming cannot use. The IQ2XXS
models gain their DSpark drafts; smaller pools keep the streaming plan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): don't pass Lemonade's /no_think prefix to DeepSeek

ds4-server takes the reasoning_effort and chat_template_kwargs Lemonade
sends when a client turns thinking off, so the /no_think prefix Lemonade
adds beside them for other templates only reaches DeepSeek as text. With
it, the resident Vision model answered the tool-call test with "Let me
try again" and ran out of tokens before closing the call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(nathanw): default to 2048-token batches

llama-server's 512-token ubatch held the Vulkan performance fork well
below its author's published prefill. At 2048, which the author measures
and recommends for MoE models, Qwen3.6-35B-A3B prefills at 1625 tok/s at
4k and 1909 at 32k (from 1373 and 1531) and Qwen3.8-Flash-Next at 717
and 909 (from 580 and 689), with decode unchanged. A user's own -b or
-ub still wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(rocmfpx): default to 2048-token batches

At 2048 rather than llama-server's 512, Qwen3.6-35B-A3B-ROCmFP4-MTP
prefills at 1789 tok/s at 4k and 1440 at 32k (from 1388 and 1125), with
decode unchanged; the dense 27B is unchanged. A longer MTP draft than the
build's default of 3 helped neither model, so it stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep ds4's own 16 GiB floor when resident

A 24 GiB reserve made the load check ask for 110.3 GiB free on a 115 GiB
pool that an idle desktop leaves at 108.7, so the resident model never
started, and it put the 97.6 GB Hybrid model on the resident path with a
check it could never pass. A resident model allocates its context up
front rather than growing into the floor, so ds4's own 16 GiB is enough.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep the memory-plan comment within the 12-line limit

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB96uc8rYAthscmomBh

* fix(packaging): recommend Podman only when Docker is missing

Recommends: podman installed Podman alongside an existing Docker, and since
Podman takes precedence when both are on PATH, Docker users had to remove it
again. The .deb now recommends podman | docker.io | docker-ce, and the .rpm
(podman or docker or docker-ce), so an installed Docker satisfies it. On
Fedora, moby-engine provides docker; Docker's own docker-ce does not.

The .rpm's recommendation also never reached the package on Fedora 43:
CPack before CMake 4.1 ignores CPACK_RPM_PACKAGE_RECOMMENDS, so the tag goes
into the spec preamble through CPACK_RPM_SPEC_MORE_DEFINE instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(packaging): warn when lemonade's subordinate ID range can't be allocated

The postinsts ignored a failed usermod --add-subuids/--add-subgids with
|| true, so the only sign was usermod's own error, with nothing tying it to
container backends. They now say what the failure breaks. It still doesn't
fail the install, since only container backends need the range.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): grant GPU access through render alone

Of the nodes a container backend opens, video owns only /dev/dri/card*, the
display node; /dev/kfd and the renderD* nodes belong to render. On a Strix
Halo host, nathanw ran inference on the GPU at the same speed as the
lemonade account with only render, where it could not open card1, as with
video and render, and with no card1 in the container at all. So the
packages add lemonade to render only, as they did before container
backends, and the setup steps and Docker's --group-add ask for render alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): run without PrivateTmp so Podman's state stays in the host's /tmp

With PrivateTmp, rootless Podman's runtime state sat in the service's private
/tmp, which took three workarounds: a tmpfiles.d entry to keep age-based
cleanup out of it, packaging to install that entry, and a systemd-run
JoinsNamespaceOf= command in the guide, because a plain
`sudo -u lemonade podman` saw an empty /tmp and Podman 5 then reset the state
of the containers lemond was running.

In the host's /tmp, Podman's own tmpfiles.d already protects that state and
plain `podman` sees it, so the workarounds go. The cost is the private /tmp,
a small step next to the NoNewPrivileges and RestrictNamespaces rootless
Podman already needs off.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(backends): keep the previous container image until the new pin is committed

Stage version.txt in a sibling directory, check the write, then swap it
into place. The previous image is removed only after the swap succeeds,
so a failed directory creation or marker write no longer leaves a
working backend without its image.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(packaging): allocate subordinate IDs when nsswitch.conf says subid: files

subid: files means the local /etc/subuid and /etc/subgid, so only a
subid: line naming another source (sss, ldap, ...) is left to the
administrator.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(containers): include the lemond port in container names

Two lemond instances on one container daemon loading the same model
produced the same name, and start() removes that name unconditionally,
so the second instance killed the first one's container. The name is
now lemonade-<port>-<recipe>-<backend>-<model>, still stable per
instance so a load clears that instance's own crash leftovers, and the
container carries an ai.lemonade.instance label.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* refactor(containers): trim the install staging and drop the unused instance label

The staging directory is hidden and cleared at the start of the next
install, so the failure paths no longer clean it up. The port in the
container name already keeps instances apart, so the ai.lemonade.instance
label is dropped until something filters on it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(ds4): launch without a free-memory check, as llamacpp does

ds4 was the only backend that refused to start on an estimate of free GPU
memory. On a host with a large BIOS carve-out that estimate reads far
below what the GPU can use, so ds4 refused every load. A load that
really runs short now fails or times out in start_server like any other
backend, and the router evicts and retries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB4k4N92f7HVjp2wtBG

* fix(lemond-user.service): keep the sandbox and run containers through podman.socket

In a user manager, every sandboxing option the unit had on main takes away
something rootless Podman needs: the seccomp-based ones set no-new-privileges,
which stops the setuid newuidmap/newgidmap helpers, and PrivateTmp and
ProtectSystem confine the service to a user namespace that maps only the
user's own UID. So the unit had dropped them all.

The unit now keeps them and sets CONTAINER_HOST to the user's podman.socket.
`podman` in the unit only sends requests to Podman's API service, which
systemd starts outside the unit, and that service creates the containers.
lemond treats a socket in the account's own runtime directory as rootless
Podman, and passes the crun annotation run.oci.keep_original_groups=1 there,
since the Podman API rejects --group-add keep-groups.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require crun for rootless Podman and recommend it

Rootless containers reach the GPU through the account's render group, which
--group-add keep-groups (and its run.oci.keep_original_groups annotation)
carries into the container. Only crun supports that; runc always resets a
container's supplementary groups, so under runc the engine cannot open the
render node and silently runs on the CPU, about 14x slower on nathanw.

Podman installs crun by default, but on Debian and Ubuntu a host that had
docker.io first already has runc, which satisfies Podman's crun | runc
dependency. The Podman setup check now reads the OCI runtime from
`podman info` and, for rootless Podman on anything but crun, asks for the
host's install command for crun. That answer is not cached, so installing
crun takes effect without restarting lemond. The .deb and .rpm also
recommend crun.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): give the podman.socket and CONTAINER_HOST steps for a failing podman info

The setup check's step for a failing `podman info` depends on CONTAINER_HOST
since the user unit moved to podman.socket; the spec's tables still gave
only the generic step.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): expect the lemond port in container names

8e03e4d renamed containers to lemonade-<port>-<recipe>-<backend>-<model>,
but the smoke test still asserted the old lemonade-<recipe>-<backend>-
prefix, failing test_03_load_and_chat on docker and both podman modes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB7BgnHh2Hv3FiEwQHz

* feat(halogen): pin the 0.18.22 release tag instead of latest

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(halogen): turn reasoning off per request for the Responses API

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(halogen): list the bundle files in server_models.json

The lookup table, vision tower and tokenizer files become checkpoints, so
the download check covers each one and the select_checkpoint_files override
and the halogen_* model fields go away.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Sawan Srivastava <[email protected]>
2026-11-03 18:54:14 +00:00
Jeremy FowersandClaude Opus 5.5 152f6fff35 feat(rocmfpx): add the ROCm FPX container backend (#3711)
* feat(rocmfpx): add the ROCm FPX container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(api): regenerate for the rocmfpx section

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* chore(rocmfpx): pin the 2026-10-14 build of the rocm-10.0-rocmfpx image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(rocmfpx): keep one Qwen3.8-27B and add Gemma 4 and Qwen3.6 MoE models

Of the three Qwen3.8-27B builds, kingjones777's STRIX-MTP has by far the
lowest perplexity (2.61 against 6.55 for ROCmI4 and 7.36 for FAST on the
same text) at the same decode speed, with vision and MTP. It becomes the
suggested model and the test model; the other two and Qwopus3.6-27B go.

Gemma-4-26B-A4B and Qwen3.6-35B-A3B add different families and MoE
architectures, each passing chat, tool calls and vision at 54 and 72
tokens/s decode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(rocmfpx): default to 2048-token batches

At 2048 rather than llama-server's 512, Qwen3.6-35B-A3B-ROCmFP4-MTP
prefills at 1789 tok/s at 4k and 1440 at 32k (from 1388 and 1125), with
decode unchanged; the dense 27B is unchanged. A longer MTP draft than the
build's default of 3 helped neither model, so it stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-11-03 18:54:14 +00:00
07af4f36b1 feat(ds4): move ds4:rocm to a container backend (#3710)
* feat(backends): run container backends through ContainerManager, starting with llamacpp:nathanw

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): list every missing setup step and ask for consent at install

Container setup now reports what a user still has to do in one pass,
in the order they do it, and the CLI finishes the install once only
consent is left.

- Setup checks run in two groups. Before consent: the container tool
  on PATH, then the video/render groups (or the Docker socket), then
  enable_containers. These read only PATH, groups and sockets, so no
  container command runs before the user opts in; Podman counts as
  rootful when CONTAINER_HOST is set or lemond runs as root, until
  podman info answers. After consent: podman info, then SELinux.
- Every failed check is reported at once. /system-info gives one
  problem per line in message, numbered steps in action (install
  commands, group changes, enable_containers, and logging out last),
  and the failed checks' ids in setup_checks.
- lemonade backends prints message and action lines side by side.
- lemonade backends install, run and load check the backend's setup
  before installing or downloading anything. When enable_containers
  is the only step left, they show the existing warning, enable it on
  yes and finish the command; backends install --yes skips the prompt.
  Otherwise they print every problem and step and exit 1.
- The spec, user guide, CLI and API docs follow the new order and
  fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* fix(cli): read the selected backend only when recipe options were given

lemonade run and load without a --<recipe> option have no recipe
options, and reading the backend option from them aborted the CLI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* style(containers): trim the setup comments the comment-slop hook flagged

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* ci(containers): gate the container smoke test like the other hosted test jobs

The signing and release-branch skips exist to spare self-hosted runners;
the smoke test runs on ubuntu-latest.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(containers): pin the container smoke test to Ubuntu 24.04

The job installs the 24.04 .deb on the bare runner, and ubuntu-latest moves
to 26.04 in November 2026, where libmbedcrypto7t64 does not exist. The
comments now say why the job runs on the bare runner and needs the PPA.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): assert lemond's mode in the smoke test and log at debug

test_03 now checks the published port on lemond's container, so each leg
proves lemond detected the intended mode, not only that the tool runs in it.
LEMONADE_CI_MODE puts llama-server's output in the uploaded logs, as in the
other jobs that start lemond.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci: say why backends-gate also lists jobs that run on every PR

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): cut the container spec changes back to what the implementation made false

Keeps the opt-in invariants (off by default, install and load refused while
off, no container command before opt-in), rootful Podman's connection path,
the Podman answers check, and reporting every failed check at once. Drops
setup_checks, action ordering, CLI prompting, and the expect_rootless detail.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): name the enable warning instead of quoting it

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(llamacpp): list nathanw as a guest backend, as its descriptor declares

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(cli): word the enable_containers prompts as enabling containers, not backends

The setting enables every container, whatever its tier, so the warning no
longer calls the images community-built.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(backends): drop the image allowlist comment from ContainerPolicy

ContainerManager::allowed_image is the allowlist; the comment restated it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* refactor(containers): leave GPU selection and the SELinux check to the first ROCm container backend

llamacpp:nathanw maps only /dev/dri, so nothing here reached the
HIP_VISIBLE_DEVICES lookup or the SELinux check, both gated on /dev/kfd.
needs_gfx1151_cwsr_fix goes back to its own KFD read.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): drop checks that restate code, and mount single files only

The directory mounts serve Halogen's tokenizer and move to that PR; here
every model file llamacpp names is a GGUF.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): take the smoke test's backend as --backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): leave Podman and Docker alone while enable_containers is false

With containers disabled, lemond no longer sweeps at startup, connects to
the Docker socket, runs `image inspect`, or removes images on uninstall.
Setting enable_containers to false unloads every model running in a
container first, so none is left that a later crash would orphan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015BUXEd42tPQH67MQPW1XZh

* Update to a modern pin

* refactor(containers): drop the startup sweep

A killed lemond's containers already stop and remove themselves: the
attached `run --rm` child gets SIGTERM from PR_SET_PDEATHSIG and proxies it
into the container. Verified with Docker and rootful/rootless Podman. The
smoke test now kills lemond with a model loaded and checks no container
remains.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(load): list nathanw among the llamacpp_backend choices

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* ci(containers): cap the Dispatch container job at 45 minutes

A hung job would otherwise hold a pool machine for up to 4 hours.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* test(containers): skip the killed-lemond check under rootful Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(containers): link container images to their registry pages

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): skip the killed-lemond check under rootful Docker too

The Docker daemon owns the container, so whether it stops after lemond is
killed depends on the docker client forwarding SIGTERM in time, which is
racy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5SJqLuAuPwGaJQvWTwMai

* refactor(containers): drop the enable_containers setting

Container backends no longer need an opt-in before they install or
load. The setup assistant's remaining checks still report what is
missing.

- Remove the config key, its validation, getter and config effect.
- Remove the CLI consent prompt and pre-flight check, and the --yes
  flags on `config set` and `backends install` that only served it.
- Always check the Docker socket, read the image on disk for installed
  state, and remove the image on uninstall.
- Remove helpers left unused: containers_enabled,
  Router::get_container_model_names, WrappedServer::runs_in_container,
  ServerProcess::in_container.
- Update the spec, guides, generated API docs, tests and CI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* perf(containers): run container setup checks once per system-info build

The checks are host-wide, so every container backend got the same
report while each one ran them again, `podman info` included. Drop the
unused recipe and backend parameters from container_setup_failure and
compute its report at most once per pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* test(containers): fail when listing labeled containers or networks fails

A failed `ps` or `network ls` printed nothing, so the checks that expect
no leftovers passed without listing anything.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* feat(containers): run container backends from lemond.service with rootless Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): create Podman networks without a DNS server

Every model load failed under lemond.service with Podman 5 (Fedora 43/44,
Ubuntu 26.04, Debian 13):

  netavark: error while applying dns entries: aardvark-dns failed to start:
  Failed to connect to user scope bus via local transport

`podman network create` turns DNS on by default, and rootless netavark
(1.14 and later) starts aardvark-dns with `systemd-run --scope --user`, which
needs the account's systemd user manager. The lemonade system account has no
login session, so it has none.

Each per-model network holds one container, and lemond reaches it through
its published port or inspected address, never by name, so the network
needs no DNS server. Docker has no such option and is unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): let rootless Podman keep its runtime state in the host's /tmp

Every model load failed under lemond.service on Ubuntu 26.04 and Debian 13:

  Error: setting up Pasta: pasta failed with exit code 1: Couldn't open PID
  file /run/lemonade/containers/networks/rootless-netns/rootless-netns-conn.pid:
  Permission denied

Podman 5 sets up rootless networking with pasta, under $XDG_RUNTIME_DIR, which
the unit set to /run/lemonade. The AppArmor profile Ubuntu and Debian ship for
pasta allows writes only under /tmp, /run/user/<uid> and home directories under
/home, so it denied the PID file. ProtectHome=yes hides /run/user, and the
account has no login session to create /run/user/<uid> in any case.

With XDG_RUNTIME_DIR unset, Podman uses its own fallback in /tmp
(/tmp/storage-run-<uid>, or /tmp/containers-user-<uid> on Podman 4), which the
profile allows and Podman's own tmpfiles.d exempts from age-based cleanup.
lemond's own runtime directory stays /run/lemonade, through RuntimeDirectory=.

PrivateTmp goes with it. In a private /tmp, `podman` run as lemonade from a
shell finds no runtime state, and Podman 5 then refreshes the shared database:
the running container drops out of lemond's view, `podman stop` reports no such
container, and the engine keeps holding the GPU until the service stops.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(debian): create /var/lib/cni at install

On Ubuntu 24.04, every model load under lemond.service failed until the host
next rebooted:

  Error: unable to find network with name or ID lemonade-<...>: network not found

Podman 4's rootless network namespace bind-mounts a private directory over
/var/lib/cni, or, while that does not exist, over its nearest existing parent,
/var/lib. That mount hid /var/lib/lemonade, the lemonade account's home, which
holds its Podman storage and network configs, so `podman run` found no network
that `podman network create` had just made. Podman's own tmpfiles.d creates
/var/lib/cni only at boot (`D!`), so a fresh install hit this until a reboot.

The package now ships the directory in tmpfiles.d, which dh_installtmpfiles
applies at install. The .rpm keeps lemonade's home in /opt, and Podman 5 makes
no such mount, so neither needs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): keep DNS on rootful Podman's per-model networks

Podman 4's CNI backend gives an --internal network created with
--disable-dns no gateway, so the host has no route to the container and
rootful lemond, which connects at the container's address, waited on
llama-server until the test timed out. Only rootless Podman needs DNS
off, and it reaches the container through a published port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(ds4): move ds4:rocm to a container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): pick the ROCm container's GPU and check SELinux for /dev/kfd backends

ds4:rocm is the first container backend that maps /dev/kfd. Its container
gets HIP_VISIBLE_DEVICES for the GPU lemond sized it for, read from the KFD
topology next to system_info's other KFD reads, and hosts with SELinux
enforcing must allow containers to map GPU devices.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(containers): restore the Dispatch container job's 4-hour timeout

Four ds4 jobs downloading DS4's 81 GB checkpoint at once on fresh Dispatch
machines each ran past 45 minutes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(containers): run container backends from lemond.service with rootless Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): create Podman networks without a DNS server

Every model load failed under lemond.service with Podman 5 (Fedora 43/44,
Ubuntu 26.04, Debian 13):

  netavark: error while applying dns entries: aardvark-dns failed to start:
  Failed to connect to user scope bus via local transport

`podman network create` turns DNS on by default, and rootless netavark
(1.14 and later) starts aardvark-dns with `systemd-run --scope --user`, which
needs the account's systemd user manager. The lemonade system account has no
login session, so it has none.

Each per-model network holds one container, and lemond reaches it through
its published port or inspected address, never by name, so the network
needs no DNS server. Docker has no such option and is unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): let rootless Podman keep its runtime state in the host's /tmp

Every model load failed under lemond.service on Ubuntu 26.04 and Debian 13:

  Error: setting up Pasta: pasta failed with exit code 1: Couldn't open PID
  file /run/lemonade/containers/networks/rootless-netns/rootless-netns-conn.pid:
  Permission denied

Podman 5 sets up rootless networking with pasta, under $XDG_RUNTIME_DIR, which
the unit set to /run/lemonade. The AppArmor profile Ubuntu and Debian ship for
pasta allows writes only under /tmp, /run/user/<uid> and home directories under
/home, so it denied the PID file. ProtectHome=yes hides /run/user, and the
account has no login session to create /run/user/<uid> in any case.

With XDG_RUNTIME_DIR unset, Podman uses its own fallback in /tmp
(/tmp/storage-run-<uid>, or /tmp/containers-user-<uid> on Podman 4), which the
profile allows and Podman's own tmpfiles.d exempts from age-based cleanup.
lemond's own runtime directory stays /run/lemonade, through RuntimeDirectory=.

PrivateTmp goes with it. In a private /tmp, `podman` run as lemonade from a
shell finds no runtime state, and Podman 5 then refreshes the shared database:
the running container drops out of lemond's view, `podman stop` reports no such
container, and the engine keeps holding the GPU until the service stops.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(debian): create /var/lib/cni at install

On Ubuntu 24.04, every model load under lemond.service failed until the host
next rebooted:

  Error: unable to find network with name or ID lemonade-<...>: network not found

Podman 4's rootless network namespace bind-mounts a private directory over
/var/lib/cni, or, while that does not exist, over its nearest existing parent,
/var/lib. That mount hid /var/lib/lemonade, the lemonade account's home, which
holds its Podman storage and network configs, so `podman run` found no network
that `podman network create` had just made. Podman's own tmpfiles.d creates
/var/lib/cni only at boot (`D!`), so a fresh install hit this until a reboot.

The package now ships the directory in tmpfiles.d, which dh_installtmpfiles
applies at install. The .rpm keeps lemonade's home in /opt, and Podman 5 makes
no such mount, so neither needs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(ds4): move ds4:rocm to a container backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): keep DNS on rootful Podman's per-model networks

Podman 4's CNI backend gives an --internal network created with
--disable-dns no gateway, so the host has no route to the container and
rootful lemond, which connects at the container's address, waited on
llama-server until the test timed out. Only rootless Podman needs DNS
off, and it reaches the container through a published port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(containers): pick the ROCm container's GPU and check SELinux for /dev/kfd backends

ds4:rocm is the first container backend that maps /dev/kfd. Its container
gets HIP_VISIBLE_DEVICES for the GPU lemond sized it for, read from the KFD
topology next to system_info's other KFD reads, and hosts with SELinux
enforcing must allow containers to map GPU devices.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(app): show container setup steps in a collapsible section

The Setup guide button passed `action` to window.open, but lemond's
`action` holds a command, steps, or a link. A non-link action now shows
as a "Setup required" disclosure with the failure message and steps,
regardless of the technical-details toggle; links keep the button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check GPU device access instead of video/render membership

Desktop distros such as Ubuntu and Arch grant the logged-in account
/dev/kfd and /dev/dri access through ACLs, so an account outside video
and render could use the GPU yet was told to fix its groups. The setup
check now tests read/write access to /dev/kfd and each render node.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): ask Podman its mode before the host check

container_setup_failure() ran check_host() before check_podman(), so the
first pass after startup guessed rootless and could report a GPU access
failure on rootful Podman that the next pass cleared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check Docker with docker info instead of a fixed socket

The socket probe only looked at /var/run/docker.sock, so DOCKER_HOST,
Docker contexts and Docker Desktop's socket read as a refused account.
docker info follows the CLI's own connection, and its answer also
identifies Docker Desktop and rootless Docker, which cannot run
container backends, so those now get Podman as the fix step. The spec's
device-node rows now describe the access check instead of group
membership.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(lemond.service): keep PrivateTmp and give Podman's private /tmp state to tmpfiles.d

04919f697 turned PrivateTmp off for every lemond.service user, containers or
not, raising systemd-analyze security exposure from 8.5 to 8.7. Its reason was
`podman` run as lemonade from a shell: in the host's /tmp it finds none of the
service's runtime state, and Podman 5 then refreshes the shared database, so
lemond loses track of its running containers.

PrivateTmp=yes is back. XDG_RUNTIME_DIR stays unset, so rootless Podman still
keeps its runtime state in its own fallback in /tmp, which pasta's AppArmor
profile allows; under PrivateTmp that is the service's private /tmp.

Podman's own tmpfiles.d exempts its fallback only in the host's /tmp, and
age-based cleanup of /tmp reaches into the service's private one, so a new
tmpfiles.d entry exempts that instead. The .rpm installs it under /opt with a
link in /usr/lib/tmpfiles.d, like the unit, and applies it in %post;
dh_installtmpfiles applies it for the .deb.

The guide gives the command that runs Podman in the service's /tmp, through
JoinsNamespaceOf=lemond.service, in place of a plain `sudo -u lemonade podman`.
It uses --pty: SELinux on Fedora 44 denies dbus-broker the caller's pipes
that --pipe passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): escape container names so distinct models never share one

name_token() mapped every rejected character to `-`, so `user.foo/bar`,
`user.foo bar` and `user.foo-bar` shared a container and network name,
and starting one removed the other. Rejected characters now become `_`
plus two hex digits and `_` is doubled, so the mapping is one-to-one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): return a failed result for an empty command

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(containers): explain how Lemonade chooses Podman or Docker, with service steps for rootful Podman and Docker

The guide said only that Lemonade uses Podman when installed and Docker
otherwise. It now lists when each engine runs (rootless Podman by default,
rootful through CONTAINER_HOST or a root lemond, Docker without Podman) and
that rootful Podman and Docker are root-equivalent.

Its Docker step for lemond.service did nothing: the packages pull in Podman,
which takes precedence, so it now removes Podman first. Rootful Podman under
lemond.service had no steps, and root's socket is closed to lemonade, so the
guide gives a dedicated socket and service for lemonade that leave root's
podman.socket untouched. User-mode lemond shares the user's own Podman and
follows the CONTAINER_HOST its environment sets, which the guide now says.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require lemonade's subordinate IDs only for local rootless Podman

With CONTAINER_HOST pointing at root's Podman socket, as the guide's rootful
setup does, check_podman() still demanded subordinate UID and GID ranges for
lemonade and reported subordinate_ids when they were missing. Root's Podman
maps container IDs onto its own ranges and never uses lemonade's, so the check
blocked a working rootful setup on hosts where lemonade has no ranges.

The check now runs only when Podman is local and rootless, the same condition
check_host() already applies to the device-group checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): report rootful Podman on CNI instead of timing out

Rootful lemond connects at the container's address, and Podman 4's CNI
backend gives an --internal network no gateway on the host, with DNS on or
off. A model load therefore waited out the whole startup timeout (8 minutes
on Ubuntu 24.04 with Podman 4.9.3) and failed with "llama-server failed to
start". Publishing a port does not help: rootful Podman does not forward a
port published on 127.0.0.1 into an internal network on either backend.

check_podman() now reads the network backend in the same `podman info` call
that reports rootless mode, and reports rootful_cni with the way back to
rootless Podman: remove CONTAINER_HOST from /etc/default/lemond (service),
unset it (user mode), or run lemond as a regular account (root). The guide
names switching root's Podman to netavark as well, and warns that the
`podman system reset` it needs deletes all of root's containers and images.
Rootless Podman publishes a port and works on CNI, and rootful Podman on
netavark keeps working, so neither is affected.

The create_network comment named CNI for netavark's behavior, now corrected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(ds4): mark all ds4 models as suggested

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): drop per-model recipe_options pins

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(containers): explain the rootless port vs rootful address once

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): give a ROCm container the GPU its backend supports

get_rocm_arch() prefers a discrete GPU, so on a Strix Halo with an eGPU
HIP_VISIBLE_DEVICES pointed ds4 at the eGPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): stop calling the 81 GB model the only one

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): list model sizes in GB like the rest of the registry

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: give tool calls 100 tokens instead of 300

DS4's DSML tool-call markup takes 55 tokens for calculator_calculate(1+1),
just over the old 50. 300 let any backend ramble for paragraphs first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: accept an incomplete stream only when the token cap ended it

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(containers): keep the runner's persistent Hugging Face cache

Devlab Dispatch runners set HF_HOME to a cache on their scratch disk that
survives the job. Pointing it at RUNNER_TEMP downloaded every model on
every run, 70 minutes for DS4's 87 GB checkpoint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(ds4): drop the workspace-volume note now models use the runner cache

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep the desktop's memory free and auto-size the context

ds4-server grew its caches until the GPU pool was nearly full, which on a
Strix Halo starved the compositor and ended the login session. ds4 now
gets a free floor and a model tensor cache cap from one memory plan.

ds4 also reads its GGUF metadata, so auto-tune knows the model's 1M
context window and KV shape, and it sizes the context from what is free
above that floor through a new BackendOps hook: about 80k tokens on a
128 GB Strix Halo instead of the 4096 fallback.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(ds4): pin the 2026-10-24 build of the rocm-10.0 image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(router): re-run auto-tune for the retry after evicting every model

A load that fails for lack of memory is retried after evicting everything,
but the retry reused the context sized while those models still held the
memory. DS4 retried at the 4096 fallback with 80k tokens available.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(debian): keep the postinst chown out of Podman's storage and off symlinks

The postinst re-owns /var/lib/lemonade on every install with
`find ... -exec chown lemonade:lemonade`. Rootless Podman now keeps the
service's image storage in that home under .local/share/containers, so
the walk entered every image layer. Plain chown follows symlinks, and
layers are full of absolute ones (/bin/sh -> /usr/bin/busybox), so root
re-owned the host's files: reinstalling the same .deb on Ubuntu 24.04
after pulling two images handed /run, /run/lock, /etc/ssl/certs,
/usr/bin/busybox and 13 other host files to lemonade. The walk also
flattened the layers' subordinate-ID owners and cleared their setuid
bits, so `su` in an ubuntu image lost setuid.

Prune Podman's storage, which lemonade already owns and Podman manages,
and use chown -h so a symlink anywhere in the home is re-owned itself
instead of its target. The chown -R this walk replaced in #3393 never
followed symlinks, so -h restores that.

Tested on a fresh Ubuntu 24.04 VM: after the reinstall no host file
changes owner, the layers keep their 5 sub-UID files and 8 setuid files,
and a root-owned file in ~/.config is still re-owned to lemonade.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(nathanw): pin the 2026-10-25 vulkan-radv-performance image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): run resident with DSpark when the GPU pool holds the model

The streaming plan was tuned for a 62 GiB pool, where the 81 GiB IQ2XXS
model cannot be resident. On a 128 GB Strix Halo with the default 115 GiB
GTT window it still streamed experts from disk and decoded at 2.4 tok/s.
When the pool holds the weights plus 24 GiB for the desktop, ds4 now runs
resident (217-311 tok/s prefill, 12.5-14 tok/s decode) and loads the
model's DSpark support file, which streaming cannot use. The IQ2XXS
models gain their DSpark drafts; smaller pools keep the streaming plan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): don't pass Lemonade's /no_think prefix to DeepSeek

ds4-server takes the reasoning_effort and chat_template_kwargs Lemonade
sends when a client turns thinking off, so the /no_think prefix Lemonade
adds beside them for other templates only reaches DeepSeek as text. With
it, the resident Vision model answered the tool-call test with "Let me
try again" and ran out of tokens before closing the call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(nathanw): default to 2048-token batches

llama-server's 512-token ubatch held the Vulkan performance fork well
below its author's published prefill. At 2048, which the author measures
and recommends for MoE models, Qwen3.6-35B-A3B prefills at 1625 tok/s at
4k and 1909 at 32k (from 1373 and 1531) and Qwen3.8-Flash-Next at 717
and 909 (from 580 and 689), with decode unchanged. A user's own -b or
-ub still wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep ds4's own 16 GiB floor when resident

A 24 GiB reserve made the load check ask for 110.3 GiB free on a 115 GiB
pool that an idle desktop leaves at 108.7, so the resident model never
started, and it put the 97.6 GB Hybrid model on the resident path with a
check it could never pass. A resident model allocates its context up
front rather than growing into the floor, so ds4's own 16 GiB is enough.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ds4): keep the memory-plan comment within the 12-line limit

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB96uc8rYAthscmomBh

* fix(packaging): recommend Podman only when Docker is missing

Recommends: podman installed Podman alongside an existing Docker, and since
Podman takes precedence when both are on PATH, Docker users had to remove it
again. The .deb now recommends podman | docker.io | docker-ce, and the .rpm
(podman or docker or docker-ce), so an installed Docker satisfies it. On
Fedora, moby-engine provides docker; Docker's own docker-ce does not.

The .rpm's recommendation also never reached the package on Fedora 43:
CPack before CMake 4.1 ignores CPACK_RPM_PACKAGE_RECOMMENDS, so the tag goes
into the spec preamble through CPACK_RPM_SPEC_MORE_DEFINE instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(packaging): warn when lemonade's subordinate ID range can't be allocated

The postinsts ignored a failed usermod --add-subuids/--add-subgids with
|| true, so the only sign was usermod's own error, with nothing tying it to
container backends. They now say what the failure breaks. It still doesn't
fail the install, since only container backends need the range.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): grant GPU access through render alone

Of the nodes a container backend opens, video owns only /dev/dri/card*, the
display node; /dev/kfd and the renderD* nodes belong to render. On a Strix
Halo host, nathanw ran inference on the GPU at the same speed as the
lemonade account with only render, where it could not open card1, as with
video and render, and with no card1 in the container at all. So the
packages add lemonade to render only, as they did before container
backends, and the setup steps and Docker's --group-add ask for render alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): run without PrivateTmp so Podman's state stays in the host's /tmp

With PrivateTmp, rootless Podman's runtime state sat in the service's private
/tmp, which took three workarounds: a tmpfiles.d entry to keep age-based
cleanup out of it, packaging to install that entry, and a systemd-run
JoinsNamespaceOf= command in the guide, because a plain
`sudo -u lemonade podman` saw an empty /tmp and Podman 5 then reset the state
of the containers lemond was running.

In the host's /tmp, Podman's own tmpfiles.d already protects that state and
plain `podman` sees it, so the workarounds go. The cost is the private /tmp,
a small step next to the NoNewPrivileges and RestrictNamespaces rootless
Podman already needs off.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(backends): keep the previous container image until the new pin is committed

Stage version.txt in a sibling directory, check the write, then swap it
into place. The previous image is removed only after the swap succeeds,
so a failed directory creation or marker write no longer leaves a
working backend without its image.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(packaging): allocate subordinate IDs when nsswitch.conf says subid: files

subid: files means the local /etc/subuid and /etc/subgid, so only a
subid: line naming another source (sss, ldap, ...) is left to the
administrator.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(containers): include the lemond port in container names

Two lemond instances on one container daemon loading the same model
produced the same name, and start() removes that name unconditionally,
so the second instance killed the first one's container. The name is
now lemonade-<port>-<recipe>-<backend>-<model>, still stable per
instance so a load clears that instance's own crash leftovers, and the
container carries an ai.lemonade.instance label.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* refactor(containers): trim the install staging and drop the unused instance label

The staging directory is hidden and cleared at the start of the next
install, so the failure paths no longer clean it up. The port in the
container name already keeps instances apart, so the ai.lemonade.instance
label is dropped until something filters on it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(ds4): launch without a free-memory check, as llamacpp does

ds4 was the only backend that refused to start on an estimate of free GPU
memory. On a host with a large BIOS carve-out that estimate reads far
below what the GPU can use, so ds4 refused every load. A load that
really runs short now fails or times out in start_server like any other
backend, and the router evicts and retries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB4k4N92f7HVjp2wtBG

* fix(lemond-user.service): keep the sandbox and run containers through podman.socket

In a user manager, every sandboxing option the unit had on main takes away
something rootless Podman needs: the seccomp-based ones set no-new-privileges,
which stops the setuid newuidmap/newgidmap helpers, and PrivateTmp and
ProtectSystem confine the service to a user namespace that maps only the
user's own UID. So the unit had dropped them all.

The unit now keeps them and sets CONTAINER_HOST to the user's podman.socket.
`podman` in the unit only sends requests to Podman's API service, which
systemd starts outside the unit, and that service creates the containers.
lemond treats a socket in the account's own runtime directory as rootless
Podman, and passes the crun annotation run.oci.keep_original_groups=1 there,
since the Podman API rejects --group-add keep-groups.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require crun for rootless Podman and recommend it

Rootless containers reach the GPU through the account's render group, which
--group-add keep-groups (and its run.oci.keep_original_groups annotation)
carries into the container. Only crun supports that; runc always resets a
container's supplementary groups, so under runc the engine cannot open the
render node and silently runs on the CPU, about 14x slower on nathanw.

Podman installs crun by default, but on Debian and Ubuntu a host that had
docker.io first already has runc, which satisfies Podman's crun | runc
dependency. The Podman setup check now reads the OCI runtime from
`podman info` and, for rootless Podman on anything but crun, asks for the
host's install command for crun. That answer is not cached, so installing
crun takes effect without restarting lemond. The .deb and .rpm also
recommend crun.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): give the podman.socket and CONTAINER_HOST steps for a failing podman info

The setup check's step for a failing `podman info` depends on CONTAINER_HOST
since the user unit moved to podman.socket; the spec's tables still gave
only the generic step.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): expect the lemond port in container names

8e03e4d renamed containers to lemonade-<port>-<recipe>-<backend>-<model>,
but the smoke test still asserted the old lemonade-<recipe>-<backend>-
prefix, failing test_03_load_and_chat on docker and both podman modes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB7BgnHh2Hv3FiEwQHz

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Sawan Srivastava <[email protected]>
2026-11-03 17:25:45 +00:00
a5b414b7fb feat(backends): run container backends through ContainerManager, starting with llamacpp:nathanw (#3709)
* feat(backends): run container backends through ContainerManager, starting with llamacpp:nathanw

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): list every missing setup step and ask for consent at install

Container setup now reports what a user still has to do in one pass,
in the order they do it, and the CLI finishes the install once only
consent is left.

- Setup checks run in two groups. Before consent: the container tool
  on PATH, then the video/render groups (or the Docker socket), then
  enable_containers. These read only PATH, groups and sockets, so no
  container command runs before the user opts in; Podman counts as
  rootful when CONTAINER_HOST is set or lemond runs as root, until
  podman info answers. After consent: podman info, then SELinux.
- Every failed check is reported at once. /system-info gives one
  problem per line in message, numbered steps in action (install
  commands, group changes, enable_containers, and logging out last),
  and the failed checks' ids in setup_checks.
- lemonade backends prints message and action lines side by side.
- lemonade backends install, run and load check the backend's setup
  before installing or downloading anything. When enable_containers
  is the only step left, they show the existing warning, enable it on
  yes and finish the command; backends install --yes skips the prompt.
  Otherwise they print every problem and step and exit 1.
- The spec, user guide, CLI and API docs follow the new order and
  fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* fix(cli): read the selected backend only when recipe options were given

lemonade run and load without a --<recipe> option have no recipe
options, and reading the backend option from them aborted the CLI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* style(containers): trim the setup comments the comment-slop hook flagged

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* ci(containers): gate the container smoke test like the other hosted test jobs

The signing and release-branch skips exist to spare self-hosted runners;
the smoke test runs on ubuntu-latest.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(containers): pin the container smoke test to Ubuntu 24.04

The job installs the 24.04 .deb on the bare runner, and ubuntu-latest moves
to 26.04 in November 2026, where libmbedcrypto7t64 does not exist. The
comments now say why the job runs on the bare runner and needs the PPA.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): assert lemond's mode in the smoke test and log at debug

test_03 now checks the published port on lemond's container, so each leg
proves lemond detected the intended mode, not only that the tool runs in it.
LEMONADE_CI_MODE puts llama-server's output in the uploaded logs, as in the
other jobs that start lemond.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci: say why backends-gate also lists jobs that run on every PR

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): cut the container spec changes back to what the implementation made false

Keeps the opt-in invariants (off by default, install and load refused while
off, no container command before opt-in), rootful Podman's connection path,
the Podman answers check, and reporting every failed check at once. Drops
setup_checks, action ordering, CLI prompting, and the expect_rootless detail.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): name the enable warning instead of quoting it

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(llamacpp): list nathanw as a guest backend, as its descriptor declares

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(cli): word the enable_containers prompts as enabling containers, not backends

The setting enables every container, whatever its tier, so the warning no
longer calls the images community-built.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(backends): drop the image allowlist comment from ContainerPolicy

ContainerManager::allowed_image is the allowlist; the comment restated it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* refactor(containers): leave GPU selection and the SELinux check to the first ROCm container backend

llamacpp:nathanw maps only /dev/dri, so nothing here reached the
HIP_VISIBLE_DEVICES lookup or the SELinux check, both gated on /dev/kfd.
needs_gfx1151_cwsr_fix goes back to its own KFD read.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): drop checks that restate code, and mount single files only

The directory mounts serve Halogen's tokenizer and move to that PR; here
every model file llamacpp names is a GGUF.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): take the smoke test's backend as --backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): leave Podman and Docker alone while enable_containers is false

With containers disabled, lemond no longer sweeps at startup, connects to
the Docker socket, runs `image inspect`, or removes images on uninstall.
Setting enable_containers to false unloads every model running in a
container first, so none is left that a later crash would orphan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015BUXEd42tPQH67MQPW1XZh

* Update to a modern pin

* refactor(containers): drop the startup sweep

A killed lemond's containers already stop and remove themselves: the
attached `run --rm` child gets SIGTERM from PR_SET_PDEATHSIG and proxies it
into the container. Verified with Docker and rootful/rootless Podman. The
smoke test now kills lemond with a model loaded and checks no container
remains.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(load): list nathanw among the llamacpp_backend choices

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* ci(containers): cap the Dispatch container job at 45 minutes

A hung job would otherwise hold a pool machine for up to 4 hours.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* test(containers): skip the killed-lemond check under rootful Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(containers): link container images to their registry pages

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): skip the killed-lemond check under rootful Docker too

The Docker daemon owns the container, so whether it stops after lemond is
killed depends on the docker client forwarding SIGTERM in time, which is
racy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5SJqLuAuPwGaJQvWTwMai

* refactor(containers): drop the enable_containers setting

Container backends no longer need an opt-in before they install or
load. The setup assistant's remaining checks still report what is
missing.

- Remove the config key, its validation, getter and config effect.
- Remove the CLI consent prompt and pre-flight check, and the --yes
  flags on `config set` and `backends install` that only served it.
- Always check the Docker socket, read the image on disk for installed
  state, and remove the image on uninstall.
- Remove helpers left unused: containers_enabled,
  Router::get_container_model_names, WrappedServer::runs_in_container,
  ServerProcess::in_container.
- Update the spec, guides, generated API docs, tests and CI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* perf(containers): run container setup checks once per system-info build

The checks are host-wide, so every container backend got the same
report while each one ran them again, `podman info` included. Drop the
unused recipe and backend parameters from container_setup_failure and
compute its report at most once per pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* test(containers): fail when listing labeled containers or networks fails

A failed `ps` or `network ls` printed nothing, so the checks that expect
no leftovers passed without listing anything.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* ci(containers): restore the Dispatch container job's 4-hour timeout

Four ds4 jobs downloading DS4's 81 GB checkpoint at once on fresh Dispatch
machines each ran past 45 minutes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(containers): run container backends from lemond.service with rootless Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): create Podman networks without a DNS server

Every model load failed under lemond.service with Podman 5 (Fedora 43/44,
Ubuntu 26.04, Debian 13):

  netavark: error while applying dns entries: aardvark-dns failed to start:
  Failed to connect to user scope bus via local transport

`podman network create` turns DNS on by default, and rootless netavark
(1.14 and later) starts aardvark-dns with `systemd-run --scope --user`, which
needs the account's systemd user manager. The lemonade system account has no
login session, so it has none.

Each per-model network holds one container, and lemond reaches it through
its published port or inspected address, never by name, so the network
needs no DNS server. Docker has no such option and is unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): let rootless Podman keep its runtime state in the host's /tmp

Every model load failed under lemond.service on Ubuntu 26.04 and Debian 13:

  Error: setting up Pasta: pasta failed with exit code 1: Couldn't open PID
  file /run/lemonade/containers/networks/rootless-netns/rootless-netns-conn.pid:
  Permission denied

Podman 5 sets up rootless networking with pasta, under $XDG_RUNTIME_DIR, which
the unit set to /run/lemonade. The AppArmor profile Ubuntu and Debian ship for
pasta allows writes only under /tmp, /run/user/<uid> and home directories under
/home, so it denied the PID file. ProtectHome=yes hides /run/user, and the
account has no login session to create /run/user/<uid> in any case.

With XDG_RUNTIME_DIR unset, Podman uses its own fallback in /tmp
(/tmp/storage-run-<uid>, or /tmp/containers-user-<uid> on Podman 4), which the
profile allows and Podman's own tmpfiles.d exempts from age-based cleanup.
lemond's own runtime directory stays /run/lemonade, through RuntimeDirectory=.

PrivateTmp goes with it. In a private /tmp, `podman` run as lemonade from a
shell finds no runtime state, and Podman 5 then refreshes the shared database:
the running container drops out of lemond's view, `podman stop` reports no such
container, and the engine keeps holding the GPU until the service stops.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(debian): create /var/lib/cni at install

On Ubuntu 24.04, every model load under lemond.service failed until the host
next rebooted:

  Error: unable to find network with name or ID lemonade-<...>: network not found

Podman 4's rootless network namespace bind-mounts a private directory over
/var/lib/cni, or, while that does not exist, over its nearest existing parent,
/var/lib. That mount hid /var/lib/lemonade, the lemonade account's home, which
holds its Podman storage and network configs, so `podman run` found no network
that `podman network create` had just made. Podman's own tmpfiles.d creates
/var/lib/cni only at boot (`D!`), so a fresh install hit this until a reboot.

The package now ships the directory in tmpfiles.d, which dh_installtmpfiles
applies at install. The .rpm keeps lemonade's home in /opt, and Podman 5 makes
no such mount, so neither needs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): keep DNS on rootful Podman's per-model networks

Podman 4's CNI backend gives an --internal network created with
--disable-dns no gateway, so the host has no route to the container and
rootful lemond, which connects at the container's address, waited on
llama-server until the test timed out. Only rootless Podman needs DNS
off, and it reaches the container through a published port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app): show container setup steps in a collapsible section

The Setup guide button passed `action` to window.open, but lemond's
`action` holds a command, steps, or a link. A non-link action now shows
as a "Setup required" disclosure with the failure message and steps,
regardless of the technical-details toggle; links keep the button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check GPU device access instead of video/render membership

Desktop distros such as Ubuntu and Arch grant the logged-in account
/dev/kfd and /dev/dri access through ACLs, so an account outside video
and render could use the GPU yet was told to fix its groups. The setup
check now tests read/write access to /dev/kfd and each render node.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): ask Podman its mode before the host check

container_setup_failure() ran check_host() before check_podman(), so the
first pass after startup guessed rootless and could report a GPU access
failure on rootful Podman that the next pass cleared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check Docker with docker info instead of a fixed socket

The socket probe only looked at /var/run/docker.sock, so DOCKER_HOST,
Docker contexts and Docker Desktop's socket read as a refused account.
docker info follows the CLI's own connection, and its answer also
identifies Docker Desktop and rootless Docker, which cannot run
container backends, so those now get Podman as the fix step. The spec's
device-node rows now describe the access check instead of group
membership.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(lemond.service): keep PrivateTmp and give Podman's private /tmp state to tmpfiles.d

04919f697 turned PrivateTmp off for every lemond.service user, containers or
not, raising systemd-analyze security exposure from 8.5 to 8.7. Its reason was
`podman` run as lemonade from a shell: in the host's /tmp it finds none of the
service's runtime state, and Podman 5 then refreshes the shared database, so
lemond loses track of its running containers.

PrivateTmp=yes is back. XDG_RUNTIME_DIR stays unset, so rootless Podman still
keeps its runtime state in its own fallback in /tmp, which pasta's AppArmor
profile allows; under PrivateTmp that is the service's private /tmp.

Podman's own tmpfiles.d exempts its fallback only in the host's /tmp, and
age-based cleanup of /tmp reaches into the service's private one, so a new
tmpfiles.d entry exempts that instead. The .rpm installs it under /opt with a
link in /usr/lib/tmpfiles.d, like the unit, and applies it in %post;
dh_installtmpfiles applies it for the .deb.

The guide gives the command that runs Podman in the service's /tmp, through
JoinsNamespaceOf=lemond.service, in place of a plain `sudo -u lemonade podman`.
It uses --pty: SELinux on Fedora 44 denies dbus-broker the caller's pipes
that --pipe passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): escape container names so distinct models never share one

name_token() mapped every rejected character to `-`, so `user.foo/bar`,
`user.foo bar` and `user.foo-bar` shared a container and network name,
and starting one removed the other. Rejected characters now become `_`
plus two hex digits and `_` is doubled, so the mapping is one-to-one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): return a failed result for an empty command

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(containers): explain how Lemonade chooses Podman or Docker, with service steps for rootful Podman and Docker

The guide said only that Lemonade uses Podman when installed and Docker
otherwise. It now lists when each engine runs (rootless Podman by default,
rootful through CONTAINER_HOST or a root lemond, Docker without Podman) and
that rootful Podman and Docker are root-equivalent.

Its Docker step for lemond.service did nothing: the packages pull in Podman,
which takes precedence, so it now removes Podman first. Rootful Podman under
lemond.service had no steps, and root's socket is closed to lemonade, so the
guide gives a dedicated socket and service for lemonade that leave root's
podman.socket untouched. User-mode lemond shares the user's own Podman and
follows the CONTAINER_HOST its environment sets, which the guide now says.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require lemonade's subordinate IDs only for local rootless Podman

With CONTAINER_HOST pointing at root's Podman socket, as the guide's rootful
setup does, check_podman() still demanded subordinate UID and GID ranges for
lemonade and reported subordinate_ids when they were missing. Root's Podman
maps container IDs onto its own ranges and never uses lemonade's, so the check
blocked a working rootful setup on hosts where lemonade has no ranges.

The check now runs only when Podman is local and rootless, the same condition
check_host() already applies to the device-group checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): report rootful Podman on CNI instead of timing out

Rootful lemond connects at the container's address, and Podman 4's CNI
backend gives an --internal network no gateway on the host, with DNS on or
off. A model load therefore waited out the whole startup timeout (8 minutes
on Ubuntu 24.04 with Podman 4.9.3) and failed with "llama-server failed to
start". Publishing a port does not help: rootful Podman does not forward a
port published on 127.0.0.1 into an internal network on either backend.

check_podman() now reads the network backend in the same `podman info` call
that reports rootless mode, and reports rootful_cni with the way back to
rootless Podman: remove CONTAINER_HOST from /etc/default/lemond (service),
unset it (user mode), or run lemond as a regular account (root). The guide
names switching root's Podman to netavark as well, and warns that the
`podman system reset` it needs deletes all of root's containers and images.
Rootless Podman publishes a port and works on CNI, and rootful Podman on
netavark keeps working, so neither is affected.

The create_network comment named CNI for netavark's behavior, now corrected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(containers): explain the rootless port vs rootful address once

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(containers): keep the runner's persistent Hugging Face cache

Devlab Dispatch runners set HF_HOME to a cache on their scratch disk that
survives the job. Pointing it at RUNNER_TEMP downloaded every model on
every run, 70 minutes for DS4's 87 GB checkpoint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(debian): keep the postinst chown out of Podman's storage and off symlinks

The postinst re-owns /var/lib/lemonade on every install with
`find ... -exec chown lemonade:lemonade`. Rootless Podman now keeps the
service's image storage in that home under .local/share/containers, so
the walk entered every image layer. Plain chown follows symlinks, and
layers are full of absolute ones (/bin/sh -> /usr/bin/busybox), so root
re-owned the host's files: reinstalling the same .deb on Ubuntu 24.04
after pulling two images handed /run, /run/lock, /etc/ssl/certs,
/usr/bin/busybox and 13 other host files to lemonade. The walk also
flattened the layers' subordinate-ID owners and cleared their setuid
bits, so `su` in an ubuntu image lost setuid.

Prune Podman's storage, which lemonade already owns and Podman manages,
and use chown -h so a symlink anywhere in the home is re-owned itself
instead of its target. The chown -R this walk replaced in #3393 never
followed symlinks, so -h restores that.

Tested on a fresh Ubuntu 24.04 VM: after the reinstall no host file
changes owner, the layers keep their 5 sub-UID files and 8 setuid files,
and a root-owned file in ~/.config is still re-owned to lemonade.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(nathanw): pin the 2026-10-25 vulkan-radv-performance image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(nathanw): default to 2048-token batches

llama-server's 512-token ubatch held the Vulkan performance fork well
below its author's published prefill. At 2048, which the author measures
and recommends for MoE models, Qwen3.6-35B-A3B prefills at 1625 tok/s at
4k and 1909 at 32k (from 1373 and 1531) and Qwen3.8-Flash-Next at 717
and 909 (from 580 and 689), with decode unchanged. A user's own -b or
-ub still wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(packaging): recommend Podman only when Docker is missing

Recommends: podman installed Podman alongside an existing Docker, and since
Podman takes precedence when both are on PATH, Docker users had to remove it
again. The .deb now recommends podman | docker.io | docker-ce, and the .rpm
(podman or docker or docker-ce), so an installed Docker satisfies it. On
Fedora, moby-engine provides docker; Docker's own docker-ce does not.

The .rpm's recommendation also never reached the package on Fedora 43:
CPack before CMake 4.1 ignores CPACK_RPM_PACKAGE_RECOMMENDS, so the tag goes
into the spec preamble through CPACK_RPM_SPEC_MORE_DEFINE instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(packaging): warn when lemonade's subordinate ID range can't be allocated

The postinsts ignored a failed usermod --add-subuids/--add-subgids with
|| true, so the only sign was usermod's own error, with nothing tying it to
container backends. They now say what the failure breaks. It still doesn't
fail the install, since only container backends need the range.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): grant GPU access through render alone

Of the nodes a container backend opens, video owns only /dev/dri/card*, the
display node; /dev/kfd and the renderD* nodes belong to render. On a Strix
Halo host, nathanw ran inference on the GPU at the same speed as the
lemonade account with only render, where it could not open card1, as with
video and render, and with no card1 in the container at all. So the
packages add lemonade to render only, as they did before container
backends, and the setup steps and Docker's --group-add ask for render alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): run without PrivateTmp so Podman's state stays in the host's /tmp

With PrivateTmp, rootless Podman's runtime state sat in the service's private
/tmp, which took three workarounds: a tmpfiles.d entry to keep age-based
cleanup out of it, packaging to install that entry, and a systemd-run
JoinsNamespaceOf= command in the guide, because a plain
`sudo -u lemonade podman` saw an empty /tmp and Podman 5 then reset the state
of the containers lemond was running.

In the host's /tmp, Podman's own tmpfiles.d already protects that state and
plain `podman` sees it, so the workarounds go. The cost is the private /tmp,
a small step next to the NoNewPrivileges and RestrictNamespaces rootless
Podman already needs off.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(backends): keep the previous container image until the new pin is committed

Stage version.txt in a sibling directory, check the write, then swap it
into place. The previous image is removed only after the swap succeeds,
so a failed directory creation or marker write no longer leaves a
working backend without its image.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(packaging): allocate subordinate IDs when nsswitch.conf says subid: files

subid: files means the local /etc/subuid and /etc/subgid, so only a
subid: line naming another source (sss, ldap, ...) is left to the
administrator.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(containers): include the lemond port in container names

Two lemond instances on one container daemon loading the same model
produced the same name, and start() removes that name unconditionally,
so the second instance killed the first one's container. The name is
now lemonade-<port>-<recipe>-<backend>-<model>, still stable per
instance so a load clears that instance's own crash leftovers, and the
container carries an ai.lemonade.instance label.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* refactor(containers): trim the install staging and drop the unused instance label

The staging directory is hidden and cleared at the start of the next
install, so the failure paths no longer clean it up. The port in the
container name already keeps instances apart, so the ai.lemonade.instance
label is dropped until something filters on it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(lemond-user.service): keep the sandbox and run containers through podman.socket

In a user manager, every sandboxing option the unit had on main takes away
something rootless Podman needs: the seccomp-based ones set no-new-privileges,
which stops the setuid newuidmap/newgidmap helpers, and PrivateTmp and
ProtectSystem confine the service to a user namespace that maps only the
user's own UID. So the unit had dropped them all.

The unit now keeps them and sets CONTAINER_HOST to the user's podman.socket.
`podman` in the unit only sends requests to Podman's API service, which
systemd starts outside the unit, and that service creates the containers.
lemond treats a socket in the account's own runtime directory as rootless
Podman, and passes the crun annotation run.oci.keep_original_groups=1 there,
since the Podman API rejects --group-add keep-groups.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require crun for rootless Podman and recommend it

Rootless containers reach the GPU through the account's render group, which
--group-add keep-groups (and its run.oci.keep_original_groups annotation)
carries into the container. Only crun supports that; runc always resets a
container's supplementary groups, so under runc the engine cannot open the
render node and silently runs on the CPU, about 14x slower on nathanw.

Podman installs crun by default, but on Debian and Ubuntu a host that had
docker.io first already has runc, which satisfies Podman's crun | runc
dependency. The Podman setup check now reads the OCI runtime from
`podman info` and, for rootless Podman on anything but crun, asks for the
host's install command for crun. That answer is not cached, so installing
crun takes effect without restarting lemond. The .deb and .rpm also
recommend crun.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): give the podman.socket and CONTAINER_HOST steps for a failing podman info

The setup check's step for a failing `podman info` depends on CONTAINER_HOST
since the user unit moved to podman.socket; the spec's tables still gave
only the generic step.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): expect the lemond port in container names

8e03e4d renamed containers to lemonade-<port>-<recipe>-<backend>-<model>,
but the smoke test still asserted the old lemonade-<recipe>-<backend>-
prefix, failing test_03_load_and_chat on docker and both podman modes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB7BgnHh2Hv3FiEwQHz

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Sawan Srivastava <[email protected]>
2026-11-03 15:45:14 +00:00
Piotr Wilkin (ilintar)andjeremyfowers 4e368aad98 chore: bump pwilkin backend versions (#3993)
* chore(backends): bump TRELLIS to v0.8.1

TRELLIS moves from v0.4.3 to v0.8.1. All six release assets still use the
trellis-<backend>-<os>-x64.<zip|tar.gz> names the install cases expect, and the
binary contract is unchanged: trellis-server --models <dir> --host 127.0.0.1
--port <p> --res 512, with GET /health readiness. Since v0.4.3 the changes are
additive (CORS, Pixal3D, retopology, --threads/--device-style extras).

The per-asset sha256 values are the digests GitHub publishes for each v0.8.1
asset and replace the v0.4.3 block.

Note: v0.6.0 split CUDA into trellis-cuda-* (CUDA 13.1, Turing+) and the new
trellis-cuda12-* (CUDA 12.9, Pascal/Volta). The cuda pin now resolves to the
CUDA 13.1 archive; a cuda12 variant is not added here.

* chore(backends): bump ACE-Step to v0.1.2

ACE-Step moves from v0.1.1 to v0.1.2. v0.1.2 is the first release built on the
fork after syncing 38 upstream commits from ServeurpersoCom/acestep.cpp master
(ggml 0.26.0, static batched decode, heterogeneous request batching, --device,
fail-loud on a taken port).

Lemonade's launch contract is unchanged: --models/--host/--port/--keep-loaded,
the /lm, /synth, /understand, /vae, /health, /props, /logs, /job routes, and the
ace-batch-boundary multipart response. --device replaces the GGML_BACKEND env
var, which Lemonade never set.

All six assets keep the acestep-<backend>-<os>-x64.<zip|tar.gz> names. The
per-asset sha256 values are the digests GitHub publishes for the v0.1.2 assets.

* feat(trellis): add the CUDA 12 build for Pascal and Volta GPUs

v0.8.1 is the first TRELLIS release after upstream split its CUDA artifacts:
trellis-cuda-* is now CUDA 13.1 and needs Turing or newer, and Pascal/Volta
moved to a separate trellis-cuda12-* family. Pinning only cuda therefore left
those cards with no working build.

Declare cuda12 as a support row restricted to sm_60, sm_61, sm_62, sm_70 and
sm_72, placed before the existing cuda row: within a recipe the row order is
the backend preference order, so cuda12 wins where it matches. cuda keeps its
unconstrained nvidia_gpu row, so every card that resolved to cuda before still
does, including one whose compute capability cannot be determined.

The launch path compared backend == "cuda" exactly, which left a cuda12 launch
with an empty environment: no loader path for the bundled CUDA runtime and no
CUDA_VISIBLE_DEVICES. Match the family by prefix, as the rocm variant selector
in get_install_params already does.

Both cuda12 archives carry the sha256 GitHub publishes for v0.8.1.

* docs(config): regenerate the example config for the trellis cuda12 variant

The bin_variants addition emits a trellis.cuda12_bin default, so the generated config example in this file drifted. Caught by the backend-docs-drift CI job.

* docs(api): re-record the ACE-Step and TRELLIS examples for their new pins

gen_api_boilerplate.py keys recorded responses on the recipe's Vulkan pin, so the acestep v0.1.2 and trellis v0.8.1 bumps invalidated these two Binary examples. Re-recorded both examples against the new pinned Vulkan backends.

---------

Co-authored-by: jeremyfowers <[email protected]>
2026-11-03 02:14:36 +00:00
Jeremy FowersandClaude Opus 5.5 fc865d1535 refactor(models): list every model file in server_models.json (#4041)
* refactor(models): list every model file in server_models.json

The main checkpoint now downloads any exact file the variant names, and a
variant naming a folder with no GGUF in it downloads that folder. ACE-Step
and ThinkSound list their companion files as checkpoints, so the download
check covers each file. The ACE-Step, ThinkSound, OpenMOSS and Moonshine
select_checkpoint_files overrides are removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(backends): drop the note about the OpenMOSS duplicate download

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(models): let only the pull manifest mark a folder checkpoint in progress

A stray .partial left in a snapshot by an unrelated file made every later
pull of ThinkSound fail its final check. The manifest is what an interrupted
pull leaves behind, so it alone marks a folder in progress, and the lookup
climbs to the snapshot root so nested folders like Moonshine's see it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(backends): remove the select_checkpoint_files hook

No backend overrides it any more, and the recipe argument that fed it
leaves the file selectors with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-02 22:28:57 +00:00
fl0rianr c306b768e0 feat(backends): add TheNoise CUDA support (#4001)
* feat(thenoise): enable portable CUDA backend on Linux

* chore(backends): regenerate TheNoise CUDA support metadata

* fix(thenoise): restrict linux to x86
2026-10-29 17:40:54 +00:00
Satya Devineni f9004ca0a8 Adding zero-shot classifier support (#3952)
* main into zero shot, post refactoring

* cleanup

* cleanup

* CR feedback: fixed the residency document clarification bug

* cr feedback: fake tests with propoer assertions

* pr feedback: better policy checks and logging for backend failures

* pr feedback: adding on_truncation

* pr feedback: adding the truncation support for classifier and fixing documentation issues

* CI fix and doc enhancement

* pr feedback: fixed edge cases

* added check for 0.3.7 truncated verification

* Added the example lfm2 ONNX model

* pr feedback: added max-length and 3 flag truncate flags

* pin bump to 0.4.0 and more tests for zero-shot

* CI fix

* pr feedback: clarified on the PII detector
2026-10-29 17:21:53 +00:00
Iswarya Alex b258334007 update release process (#3979) 2026-10-28 14:54:16 +00:00
fl0rianr 06cfa30653 chore(app): make browser chat persistant by default (#3984) 2026-10-28 00:03:22 +00:00
Michele Balistreriandfl0rianr fb8935641c Model Manager refactoring (#3828)
* draft model manager refactoring

* draft model management spec

* address review comments

* remove eol

* remove some non-relevant comments

* step 0: tests

* step 1: move recipe option store

* step 2: locator

* step 3: artifact transfer

* step 4a: store_builder

* step 4b: store_snapshot

* step 4c: catalog

* step 5: change notifier, generation on the snapshot

- ModelChangeNotifier with two signals and one subscriber each; ModelManager
  owns it and Server registers both routing subscribers on it
- StoreSnapshot::helper_models computed at publish by collect_helper_models();
  Server::active_policy_helper_models() and the startup seed block are gone
- notify_models_changed fires the snapshot generation; notify_generation_ and
  next_notify_generation() deleted
- fix: build_cache no longer mints a generation on a read that changes nothing,
  which had made generation-based coalescing impossible
- fix: set_model_update_available_for_test wrote the cache without publishing
- test_change_notifier: 16 checks, CI ON

* step 6a: RegistryId and the registry descriptor table

- RegistryId (string, no enum) plus RegistryDescriptor holding the per-host
  spellings, display name, scheme prefix, cache-dir prefix and default revision
- model_registry.cpp vocabulary and cache-dir naming read the table; the enum
  no longer carries facts of its own
- registry_id_from() yields nullopt for an unknown host, the primitive behind
  the spec's warn-and-skip delta (not wired to the load path yet)
- fix: descriptor_for() returned a pointer into a by-value vector
- registry_id.cpp compiled into the CLI as well; it does not link core
- test_registry_identity: 18 checks, CI ON

* step 6b: remove RemoteRegistrySource; registries are strings

- model_registry.h exposes models::RegistryId; the enum is deleted
- function names unchanged, only the carried type: parse/name/display/scheme/
  is_remote/detect_url/search/cache_dir_name/model_registry/ModelRegistry::source
- require_descriptor() throws when a caller invents an id
- test/app/app-regression/registrySearch.test.cjs slices model_registry.cpp by
  literal text; updated to match, and added to the standing gate list
- Locator now carries optional<RegistryId>

* test: pin the unknown-registry load-path delta

A persisted entry naming an unregistered host warns naming model and id,
contributes no entry, and leaves the rest of the catalog loading. That is
already the behavior via parse_model_source_fields throwing inside the
per-entry catch in build_cache; this pins it so a later step cannot regress it.

Test-only: ctest 81/81, app regression 136/136.

* step 6c': backends stop naming hosts

6b renamed the hf/modelscope dichotomy instead of removing it. Backends may
handle a source differently, but not by splitting the world in two hosts.

- vLLM quant probe: the identity test became an endpoint fact, the URL is built
  from the descriptor, and the hand-rolled "models--" + $HOME cache naming uses
  hf_cache::repo_id_to_cache_dir_name() + get_hf_cache_dir(). Passing the repo id
  rather than the raw checkpoint also fixes a latent miss for repo:variant ids.
- RegistryDescriptor gains endpoint_default; empty for ModelScope, which serves
  files through its API, preserving today's never-fetch behavior.
- FLM no longer guesses Hugging Face when the model manager is absent; both sites
  throw, as vLLM already did.
- dropped two unused default args that asserted a host.

Remaining sites for step 7 (vllm snapshot branch, flm --modelscope argv, whisper
resolve URL) need a port fact and are recorded in the plan.

Gates: ctest 81/81, cli2 73 OK, endpoints 171 OK, llm/vulkan 31 OK.

* step 6c: ArtifactSource, FetchableRepository, registration macro

- ArtifactRef names a checkpoint; from_locator carries the path for bytes that
  came from no host, so two files never share a ref
- ArtifactSource answers resolve/present/acquisition/deletion for one checkpoint
- FetchableRepository layers the pullable role on it; the whole interface is
  implementable from the value types alone
- LEMONADE_REGISTER_ARTIFACT_REPOSITORY is now the single writer of the
  descriptor table: seeded deque (pointer stability, not vector), replace on same
  id, first factory kept with duplicate claims reported rather than link-ordered
- RepositoryDescriptor and descriptor() deliberately absent; the spec lets step 12
  add them with a default

test/cpp/test_artifact_source.cpp, CI ON, 20 checks, mutation-checked twice.

Gates: ctest 82/82, app regression 136/136, cli2 73 OK, endpoints 171 OK,
llm/vulkan 31 OK.

* step 7a: artifact_resolver

* step 7b: fetchable_repository

* step 13: scancatalog

* step 7c: artifact_resolver

* move npu download

* step 7f: vllm/flm download

* reduce comment slop

* step 14: ListedCatalog per provider, and locality leaves the design

Cloud listing becomes one catalog per installed provider, so an
unreachable provider costs only its own entries.
CloudServer::discover_provider_models() owns the credential and
plaintext-endpoint guards for every caller of a listing, which deletes
the duplicated guard block in refresh_cloud_models() and orphans
CloudOps::discover_models().

CatalogDescriptor replaces the id()/required() overrides and carries
{id, required} only. Locality is deleted from the design rather than
introduced: every minter already distinguishes itself in the name it
emits (provider id leading a listing name, -FLM for discovery, the
parent-directory qualifier for the scan), nothing splits a name on '.',
and no persisted format ever carried a middle segment. Registering
user.<provider>.NAME is therefore settled by precedence, documented,
not by a vocabulary guard. The startup duplicate-claim check goes with
it: with no minter minting a locality it could only fire on a false
positive, and its remedy was to drop a provider's whole model set.

Gates: ctest 86/86, app regression 136/136, cli2 73 OK/2 skip,
endpoints 171 OK/3 skip (mock-provider cases ran), llm/vulkan 31 OK/2 skip.

* step 15: json_catalog

* step 15b:  registry documents

* cleanup

* step 8a: update scan

* step 8b: model sync

* fix ci tests

* step 9a: delete plan

* 9b: artifact store

* 9c: download policy

* 9d: npu_cache

* 9e: ingest

* 16: labels

* merge fix

* step 17-i: delete shards

* step 17-ii: fix and enable tests

* step 10a-b: alias manager + resolve()

* step 10c: every surface resolves through the manager.

* step 10d: fixes

* step 11: ModelManagerConfig

* step 12a: docs

* step 12b: model catalogs

* step 18a: start build cache work

* step 18b: catalogsetdeps

* step 19: catalog_locator

* step 19b: http catalog locator

* step 19c: configurable model catalogs

* step 20a: read capability hints only from the keys that carry them

* step 20b: a rebuild stops re-fetching a catalog it just read

* step 20c: a fetched catalog has a size limit and its cache an owner

* step 21a: a read stops taking the model store lock

* step 21b: the store lock covers the commit, not the composition

* step 21b-i: a commit stops walking the filesystem

* step 21c-i: publishing derives the name tables

* step 21c-ii: a write seeds a draft and the publish moves it out

* step 22: a filter test states the machine it means

* step 23: the update flag a scan publishes gets a gate

* step 26+27: the machine probe and the name tables leave the facade

* remove excessive comment

* step 28: modelstore

* step 29: CloudRows

* step 30: move build_cache

* step 31: store patches

* step 31 followup

* port PR #3882

* probes

* P0: the facade-shape gate reads both include spellings and one-way budgets

* P1: the dependency graph points one way

Every file under src/cpp/server/models/ included the facade header, so the
DAG read bottom-up: the layer existed in directories but not in reality. The
reason was structural. ModelInfo — the value object that crosses the whole
server by value — lived in the facade header, so anything that took a
ModelInfo had to name the orchestrator to spell its arguments.

ModelInfo, ModelFileInfo, and GgufMetadata move to models/model_info.h;
UnknownModelError and InvalidModelDefinitionError move to
models/model_errors.h. The facade now includes the leaves, never the other
way: the ratchet pins the models layer's facade-header count at zero, and
the include-graph grep confirms it. Consumers of the moved types got the
explicit include they were borrowing through the facade, including auto_tune.h,
which named no model header at all and worked by accident.

The same inversion hid inside ArtifactRef. A ref is an address — repo,
revision, variant — and two refs that compare equal name the same bytes; but
it also carried `const ArtifactLayout* layout` and a sibling path, so the
resolver had to mutate the address before handing it to a repository, and
placement — which is a property of where the bytes land — became part of what
an address is. Placement moves out: the resolver answers a SourcePlacement
beside the ref, create_repository takes it, FetchableRepository holds it,
and ArtifactRef is back to a value that can travel alone. The
sibling-layout tests now assert the binding where it lives, on the source.

Three headers are public, and the spec's Source Layout section says so:
model_manager.h (behavior), model_info.h (the value object), store_snapshot.h
(the read-only set a consumer holds). A fourth consumer, server.cpp, reads only
the snapshot, so it left the escape whitelist; auto_tune.h joins the sanctioned
side by naming model_info.h. The line budget travels 1103 -> 1105 for the two
includes model_manager.cpp took on to stop borrowing them transitively.

Gate: cpp-ci 114/114; endpoints 178 OK / 3 skip; llm/vulkan 31 OK / 2 skip;
whisper 12 OK / 2 skip; cli2 73 OK / 2 skip; app 136. Mutation-checked: the
facade-header ratchet at zero, a private models header reaching a consumer in
both include spellings, a sanctioned include passing unflagged, and a retired
whitelist name demanding deletion.

* P2a: the token stops bytes, and credentials stay on their origin

Cancellation had no parameter. A download noticed a cancel only when a
progress report happened to return false, so a stalled transfer with no bytes
and no reports could not be cancelled at all, and every caller that wanted to
stop one had to smuggle the request through the reporting channel.
utils::RequestCancelToken already existed for inference; it lived in
utils/http_client.h, out of reach of a transfer seam that must not know about
HTTP. The token moves to its own leaf, utils/cancel_token.h, as
utils::CancelToken — the same currency for inference and for model transfers —
and download_file, download_attempt, ArtifactTransfer::execute and
FileTransfer::transfer all take it. ByteProgress returns void: it reports
bytes, nothing else. A DownloadProgressCallback that returns false now closes
the update channel instead of secretly cancelling, and the only message that
stops a plan is the token, checked before each file and on every curl tick.

The second owed defect was credential scope. Rule 2 of Transfer And Layout
says a repository's auth_headers() travel only while the origin still matches
the origin that minted them, at every hop. libcurl re-sends custom headers to
any host a Location names, so the download no longer lets libcurl follow: it
walks the hops one request at a time, drops the header list at a cross-origin
boundary and never restores it, enforces the policy's scheme set on every
target itself, and refuses a 3xx body into the partial file. Production
behavior is unchanged — ExternalHttpsOnly is still the default policy — and
HttpFileTransfer gained the policy seam the fixture has been asking for in a
comment since it was written.

The token is wired where cancels are born: the download job hands the worker a
flag its cancel endpoints set, so a cancel stops bytes on the next socket tick
rather than at the next progress report; the legacy streaming path answers from
socket death; the pull chain carries it from the facade through ingest and the
BackendOpsContext down to the transfer.

Gate: cpp-ci 115/115 including the new FileTransferTest (the spec's
test_file_transfer, 21 checks over two loopback origins: credential kept
direct and on a same-origin redirect, stripped cross-origin, never restored
after a strip, disallowed redirect scheme refused before bytes, one mixed
scheme plan one progress total, a file://-only plan, mid-transfer cancel with
the partial preserved); endpoints 178 OK / 3 skip; llm/vulkan 31 OK / 2 skip;
whisper 12 OK / 2 skip; cli2 73 OK / 2 skip; app 136; a real 174 MB Hugging
Face pull in 3.2 s through the manual-hop engine. Mutations by exit code:
token check removed, cancel dies mid-transfer; strip disabled, the cross-origin
check fails; strip unconditional, the same-origin check fails; progress-false
made cancel again, the mute test dies. M1 is what surfaced the redundancy the
mutation was meant to prove: two channels watched the token in the tick; the
wrapper's copy is gone and the HTTP client's is the one place. Restores
verified, grep MUT zero.

* P2b: the main pull plans through the repository seam

Every checkpoint of a pull is an ArtifactRef bound to one FetchableRepository;
the file set is registry_download_plan's, auth headers come from the source, and
no ModelRegistry survives in the download path. The reuse merge, manifest,
pinning and provenance stay where the spec puts them.

test_pull_registry drives the whole ModelManager against scripted sources:
exact URL plan, snapshot placement, pins, manifest lifecycle, refusal words,
and a pre-set cancel token that leaves no artifact.

Facade ceiling 1106 -> 1107 for the repository_for wiring line.

* P2c: the update scan asks sources, not registries

Each (source, repository) group opens a FetchableRepository, honors
can_go_stale() before opening its mouth, lists latest and previous through
list(), and takes its headers from the source. registry_for and its legacy
ModelRegistry& are gone from UpdateScanDeps and the facade config; the
artifact-aware refinement stays in registry_files, composed as before.

test_update_available ports to StubRepository and gains three checks for the
frozen-source rule: never listed, reports nothing, moves no flag.

Facade unchanged at 1107 lines.

* P2d: the registry class lives with its adapters, nowhere else

model_registry.h moved out of the public include path into src/cpp/server/,
and only model_registry.cpp and models/registry_repository.cpp may name it --
the facade-shape gate now enforces that named set. Wire facts (file trees,
search rows, provider names, cache-dir naming) moved to
lemon/models/registry_types.h, a public leaf: they persist on disk, so their
shape is public by design. RepoListing carries the host's raw_metadata.

Search became a source answer: FetchableRepository::search with the
supports_search() gate, exposed through ModelManager::search_registry so the
API layer keeps talking to the facade. hf_variants reads variants through
create_repository.

Standing acceptance rule: store, sync, ingest, scan and the facade pair carry
zero provider string literals; only the adapter pair names the legacy header.
Both mutation-proven this phase.

Facade 1107 -> 1124 lines for search_registry.

* P3: provenance learns which checkpoint landed where

v1 files read forever, verbatim. A v2 write keeps the v1 sentence in the main
repository's file and adds checkpoints[type] = {selection, snapshot_id}; an
auxiliary repository -- which v1 refused to let speak at all -- now records
only its own checkpoint under version 2, so a shared side cache can name every
model that filled it without any of them claiming the whole.

The pull commit loop names the slot per repository. RegistryProvenanceTest
pins v1 read, v2 shapes, the shared aux file and moved-snapshot bookkeeping;
PullRegistryTest pins them after a real pull.

Mutation-proven: the v1 answer, the aux guard and the slot routing each have
a check that dies without them.

* F4 trim: a locator reads, it does not probe

CatalogLocator::changed() had no production caller -- invalidation is event
driven (watcher, settings write, ingest) and fetched bodies are windowed
(fresh_for plus conditional GET), so a standalone HEAD round trip was dead
weight with a live cost. It, both implementations, and HttpClient::head are
gone; the spec's staleness rows now describe what the read observes rather
than a probe nobody runs.

CatalogState stays: it is what read() hands back so the next read asks
conditionally. CatalogLocatorTest keeps the read-side truth, minus the probe.

* P4a: the store owns its build and its patches

ensure_current holds the compose retry loop -- the facade's build_cache is one
line now. StorePatches is gone: patch_download, patch_removed and patch_options
are ModelStore methods, the artifacts store arriving per call so the store
keeps no dependency of its own. The bodies moved verbatim; the tests moved
with them and lost nothing.

Facade 1124 -> 1097: the one-way ceiling pays a refund this phase.
Mutation-proven by test_compose_retry (attempts 1 -> both retry checks die).

* the repository seam is explained once, where it is filled in

Three structs restated which source answers for a checkpoint. ModelManagerConfig
is the origin -- ingest and update scan take it by assignment -- so it keeps the
explanation and the plumbed copies just point at it.

* callback bags shrink where the collaborator was restyled, not tested around

UpdateScanDeps stops restyling the artifact cache as three lambdas - the
disk baseline and the processed-snapshot fast path now read the
ModelArtifactStore itself, and the registry-source rule collapses to the
one free function that already owned it. ModelIngest drops its pin and
patch_downloaded wrappers and calls the registries and store it already
holds.

Read paths stop copying the world to answer one question: the facade
publishes snapshot(), and model_get, model suggestions on a miss, the
register echo, and the two MCP 'find a local model' walks read rows
instead of cloning maps. The echo regains an assertion in
test_000a, which the mutation check proved it needed.

* the facade declares no test hooks and holds no override members

The four hooks existed because substitutions had nowhere else to live.
They have somewhere else now:

- test_extra_model_discovery drives ScanCatalog directly; the device
  rule for the operator's directory moved onto the catalog itself.
- test_model_sync_and_auto_update drives SyncService with its own deps
  - canned scan, download recorder, phase bus - so the queue state
  machine is tested at the queue, not through eight ModelManagers with
  their real behavior patched out. The stale-flag case now proves the
  stronger thing: a set flag never downloads a model on its own when
  the fresh check fails.
- the phase callback and both override members are deleted with their
  setters; FacadeShapeTest's four-name whitelist becomes two zero
  assertions - no _for_test anywhere under src/cpp, no *_override_
  member in the facade header - and a probe hook planted in an
  unrelated product file trips the gate by name.

Facade: 1088 -> 1076 lines; header sheds 33.

* options are a read and a write, named as the spec names them

The facade spoke about options in six verbs; the spec knows two. GET,
POST dry-run, DELETE, the load-time save and the load-time tombstone
layer now share one read - options(name[, changes]) returns the entry,
the layering beneath it, and what changes would resolve to - and two
writes: set_options merges, replace_options replaces. preview_saved was
the clearest smell: what-a-write-would-produce is a read, so it lives
in the read.

FacadeShape grows honest ceilings: facade lines 1082, header method
declarations 71, members 15 - all one-way, so shrinking owes no edit
and growing names itself. The counters earn their numbers: planted
declarations and members are counted and refused.

* the facade locks twice and waits never

Both direct locks are the options file's write ordering, documented
where they sit; publishing has exactly one road, StoreWrite. Ratcheted
so a third lock has to argue for itself.

* check_updates and sync_status, the names the spec uses

Two renames onto the facade surface the spec already spells; nothing
else moved. Live proof: update-models --check and the update/sync
endpoints pass against a fresh server.

* checkpoint_status[] on the wire, and the spec says what the code does

Every checkpoint of every listed model now answers for itself - type,
present, required, registry, path - from the same ArtifactSources a pull
would open. Building that read exposed a real seam gap: source_for
never threaded ModelManagerConfig.repository_for, so a fixture host was
obeyed by pull and scan but bypassed by status; it now reaches every
consumer, and test_pull_registry pins the whole answer, honest scripted
presence included.

The wire contract earns its pins: /v1/models rows carry a present,
required, path-bearing main entry for a downloaded model and a boolean
update_available; docs/api shows both fields with their entries; the
app refuses to export checkpoint_status into a portable file, because
its paths belong to one machine.

Spec reconciliation, the CODE->SPEC list closed: the facade section
describes the shipped surface - snapshot reads, the options read/write
pair, config-as-the-only-door with the zero-hook gate named - and says
outright there is no ModelView and no generated model-object pass, with
the drift guards that actually exist in its place. Source Layout lists
the four public models headers and the private registry header;
staleness item 5 reads as event-plus-window, CatalogLocator::changed()
dead; test_update_available names repository_for; ModelSyncServiceTest
is no longer an aspiration - the suite is renamed to it.

Facade ceiling 1109 with checkpoint_status; declaration ceiling 72.

* S1: the spec describes shipped code, not the design it preceded

docs/dev/specs/model-management.md had drifted from what the tree does in ten
places. Each was checked against the implementation before being rewritten:

- Catalogs are objects built per store build by `product_catalogs()`, not
  singletons; the six shipped ones are named with their rank, claim, and the
  three input shapes (pinned document, `CatalogLocator`, callable).
- Locators: `file_catalog_locator` and `http_catalog_locator` are the two that
  ship, with their read policy, cache pair (`<id>.json`, `<id>.json.validators`,
  body written first), and the 8 MB body cap. No resource locator: the built-in
  registry arrives already read via `RegistryDocuments`.
- Store: `resolve()` returns `ResolvedModel`; there is no `model_path()`, no
  `ModelView`. `StoreWrite` is the composition's write type; it is still public
  on the facade, which is recorded as a known gap rather than a rule.
- `checkpoint_status[]` reads presence from `ArtifactSource::present()`, so it
  can disagree with `downloaded` on an interrupted pull. Documented as shipped.
- SyncService is `src/cpp/server/models/sync_service.{h,cpp}` with the real
  enqueue/wait/cancel surface; `models_changed` carries a `reason` and a
  generation that changes on catalog mutations only.
- Docs section: the real descriptor structs (`RegistryDescriptor`, `DocEntry`,
  `CatalogDescriptor`), the real region markers and region names, and the
  host_specific rule that keeps a machine-dependent row out of a committed page.

Removed the probe-and-detector table row, which described a mechanism deleted
before this spec section was last touched.

No code changed; generators and cpp-ci are unaffected (119/119 re-verified).

* S2b: SyncService started its worker before stop_ existed, and no test had a bound

ModelSyncServiceTest hung often enough to be killed by hand. Tracing the
worker's transitions showed the cause in product code: sync_service.h declared
`std::thread worker_;` before `bool stop_ = false;`. Members initialize in
declaration order and constructing the thread starts it, so run_worker()'s
first act -- waiting on `stop_ || is_sync_running` -- read stop_ before its
initializer ran, with no synchronization. Memory that happens to read non-zero
makes the worker believe it was already asked to stop, so it returns at once:
the service is dead on arrival, is_sync_running stays true, and
wait_until_idle()/wait_for() block forever. That fits every observation --
intermittent, load-sensitive, and blocked at 0% CPU with every thread in
futex_wait.

Fix: move the stop flag into State, where it initializes with the rest of the
guarded state and lives under the mutex the worker waits on, and leave worker_
declared last so the invariant is visible at the declaration. Router and
JobManager use the same wait idiom in the correct order; SyncService was the
only instance. As a backstop, both waits now also wake when the worker has
exited and log a warning instead of waiting for a transition that can no longer
happen, so a future dead worker costs a wrong status rather than a hung request
thread.

test_model_sync_service.cpp also had a real use-after-free of its own: every
parking scenario declared the SyncService before the state the worker parked on,
so ~SyncService joined after those locals were freed, while bus.sink still
captured them by reference and was never cleared. One PhaseGate now owns the
park, is declared before the service, takes itself off the bus in its
destructor, and bounds both directions of the rendezvous, so a missed phase is a
named FAIL instead of a hang.

New regression test constructs 200 services in a row and requires each to run
its first generation within a deadline; forcing the worker to stop on entry
makes it fail on attempt 0 in all three runs.

Every test now carries a ctest TIMEOUT (default 120s, 300s for the two whose
runtime is defined by waiting on a timeout constant) so a stuck test is one red
line instead of an unattended run: 143 at 120s, 2 at 300s, measured against a
suite whose slowest test is 14s and 115 of 119 finish under 0.3s.

cpp-ci 119/119; 960 sync-test runs at 16-way concurrency with no stall and no
failure, against 5 stalls in the first 32 runs before the fix.

* S2: the shape gate now counts what it claims, and measures what was unmeasured

Four rules in test_facade_shape were reporting something other than the truth.

Members (G1): the count was lines ending `_;`, so `cloud_registry_ = nullptr;` and the
two-line `catalog_fetch_clock_ = std::make_shared<...>()` were invisible and a new member
written with an initializer would never trip the ceiling. Members are now counted by
declaration: comments stripped, statements split on `;`, class-body indentation, angle
depth tracked so `std::function<std::string()> x_;` is a member while `void f();` is not.
Honest count is 18 -- the review that opened this step said 17 and was itself one short,
missing `default_model_source_provider_`, whose type contains the `()` that hid it from the
grep the count was based on.

Substrings (G3): `find_in(file, "model_registry.h")` counted a sentence naming the header,
and an include someone commented out counted too. Includes are now parsed from lines whose
first non-blank character is `#`, over comment-stripped text.

Direct-only includes (G2): the escaping whitelist saw `#include <lemon/models/...>` but not
the relative spelling, and it missed the more serious fact that a whitelisted *header* hands
models types to everything that includes it. A new named set lists the headers allowed to
re-export the models layer -- five of them -- and a failure prints what each one drags in.
Whitelisting `backend_ops.h` for `ArtifactFetchService` really does reach every backend that
includes it, and that is now visible instead of implied.

Shrink-punishing ratchets (G4): every "at most" needle failed when the count went *down*
with "ceiling is stale", which is exactly the churn the refactor wants. They now fail only
over the ceiling and print a note asking for it to be tightened.

Three rules that did not exist, all needed by later steps: the facade header's reach
(29 product files, one-way -- three include spellings, and the bare `#include
"model_manager.h"` used by the backend tree accounts for 7 of them), `StoreWrite` confined
to the facade, and in-flight markers (`.download_manifest.json`, `.partial`) confined to the
eight files that can currently decide presence. That last one is the shape of D2/R1: presence
has two authorities today, and the list is what S5 has to shrink.

Eleven mutations, all as required. Two caught defects in the new code rather than confirming
the old: may_only_shrink reported "unexpected" and then still passed when every whitelisted
name happened to be present, and the member counter returned 1 until the statement splitter
was fixed. kRulesVersion prints with the results so a binary older than the tree is visible
in the output rather than inferred from an impossible failure.

cpp-ci 119/119.

* S2b: nothing any more stops a cpp test from dialing out or forking

The hermeticity audit came back clean -- no C++ test needs external HTTP or a
running lemond, so none was deleted -- and an audit is worth exactly as much as
the rule that keeps it true. Two checks, both seeded at the honest zero.

A non-loopback host *name* is not the thing to ban: test_model_registry.cpp,
test_cloud_provider_registry_config.cpp and test_config_default_source.cpp pass
huggingface.co, api.fireworks.ai and friends to pure functions to check URL
building and endpoint classification, and a blanket ban would tax the tests that
verify URL handling. The rule is a non-loopback host and a request on the same
line, over comment-stripped text.

Only the named test spawns a process, with test_process_manager.cpp on the list
because process management is its subject. A test that spawned lemond would also
make one test's server another test's interference: ctest runs these in parallel.

Three mutations: a real HttpClient against huggingface.co fails, the same line
commented out passes (so the rule reads code, not prose), and a popen added to
another test fails. The gate caught itself on the first run -- it holds the token
tables as data and matched its own patterns -- so it is excluded from the two
scans over test/cpp, which costs nothing since it neither dials out nor forks.

Why the count is zero is written in the gate's comment: every create_repository()
call in test/cpp stops at resolve()/acquisition(), a plan and a path with no
request, and test_update_available.cpp injects config.repository_for. A reader
can then tell a rule that holds from a rule nobody ever checked.

cpp-ci 119/119.

* S3: declaration order is initialization order, and the declaration ceiling was fiction

ModelManager declared registries_, recipe_options_, architecture_defaults_ above config_
while its init list wrote config_ first. Actual construction follows the declarations, so
alias_manager_(config_.cache_dir) ran after config_ only by luck of where the members
happened to sit: registries_ and recipe_options_ build from static helpers and read no
member. Give that file a member that reads config_ in its initializer, placed above
config_, and it reads an object that does not exist yet -- which is not a hypothetical, it
is how SyncService hung. Declarations now run config_, extra_models_dir_, alias_manager_,
registries_, recipe_options_, and the init list already matched.

Found by asking for -Wreorder explicitly, which the build never does: no -Wall anywhere,
so this defect class is invisible otherwise. The same warning fired on WrappedServer, whose
init list wrote last_backend_activity_ before instance_id_ while declaring them the other
way round; both initializers are independent, so it was cosmetic, and it is aligned too.

recipes_all_models_filtered_snapshot() had exactly one caller, a test, and differed from the
public recipes_with_all_models_filtered() by a build_cache(). Deleted: the concurrent reader
now uses manager.snapshot()->empty_recipes(), a public non-rebuilding const read that already
existed, so the side-table exposure goes away without weakening what the test stresses.

Also, the header declaration ceiling measured nothing. It counted `);` occurrences across the
whole file -- missing every method ending `) const;`, counting doc comments -- and reported 71
against a ceiling of 72 while ModelManager's own brace depth holds 87 function declarations.
It now counts declarations at class scope, nested type bodies excluded, and the ceiling says
87; adding one method fails, which the old counter could not do. S8's real starting surface is
87 declarations across 29 includers. The re-export detail dump printed on every run including
passes, where it read like a failure; it prints on failure now.

cpp-ci 119/119, cli2 73 tests OK, gate green, comment gate 0.

* S4: a recipe is policy, so it stops riding in an address

ArtifactRef carried `recipe` while operator== ignored it. That is a field which changes what
a plan contains and asserts nothing about identity: two refs equal as addresses produced
different downloads. It is what lets the shared plan builder reach for a recipe at all, since
the only way registry_download_plan could ask which files a model wants was through the ref
handed to it.

Moved to SourcePlacement, beside the layout and sibling it already travelled with, and read
back through repository.recipe() where the plan is built. Placement is resolver output, was
already threaded through create_repository, RepositoryFactory, both registration macros and
the FetchableRepository constructor, so this is a field move and a getter rather than a new
channel. The four mint sites stopped setting it; placement_for() and the host-scheme branch
set it; ingest builds one placement per pull, because every checkpoint of a pull belongs to
the same model and so to the same recipe; update_scan does the same for its probe.

checkpoint_type stays, and the header now says why the two are treated differently: which
checkpoint is a question about bytes, which recipe is a question about what to do with them.
The probes in hf_variants and search_registry needed no change -- they list and search and
never build a plan, so an empty recipe was already the right answer for them.

The new layout test asks the question the field used to make unanswerable: the same ref under
two placements yields plans that differ only in the files the policy selected and agree on the
destination. Moonshine was the natural second policy and throws when a listing has no folder
by that name; ThinkSound wants a fixed set of audio files and finds none in the fixture, which
says the same thing without an exception.

cpp-ci 119/119, whisper 12 OK (2 skipped), generators --check, comment gate 0. Whisper needs
XDG_RUNTIME_DIR pointing somewhere writable in the server's environment before it will load
anything; recorded because the error it produces otherwise reads like a model-load failure.

* S5: presence gets one implementation, and it takes a path rather than a source

downloaded and checkpoint_status[].present were computed twice, differently. The store
applied existence, in-flight markers and backend validation; LocalPathArtifactSource applied
existence plus validation; a registry checkpoint applied existence alone. An interrupted
download reported downloaded:false beside present:true, and a repository holding an HTML error
page named .gguf reported present:true.

The three checks now live in one function, checkpoint_bytes_present(path, validator), and the
marker half in models/download_markers.{h,cpp} -- interrupted_download() names
.download_manifest.json and .partial nowhere else. Both sources and the store's complete()
call it, so no caller can hold a different opinion about the same bytes. The registry source
validates with the ops of the recipe in its SourcePlacement, which is why S4 came first.

The plan said to make complete() a loop over sources. That was tried and it is wrong:
adopt_extra_cache() asks complete() whether a row would be whole, and the row it asks has no
provenance yet -- the resolver reads a bare org/repo checkpoint as a registry checkpoint, the
registry source looks only in the managed cache, and a model whose bytes sit complete in the
extra models directory is refused adoption and then loses its resolved path too, because
compose only resolves rows it believes are downloaded. The store decides which path a
checkpoint resolves to -- adopted caches, shard families resolved to the one file the engine
opens -- so the authority is a function over that path. Asking a source derives the location a
second time from provenance, which is the second opinion this step exists to remove.

Finding, from failing to see the bug first: checkpoint_status reports present:false with no
reason when a source cannot even be built, and the wire carries no reason field. Every
registry case in test_model_download_state was therefore false/false -- agreeing, vacuously.
A bare ModelManager wires no default model source, so no registry source can be built for an
org/repo checkpoint; production always does (RuntimeConfig::default_model_source). Five test
binaries now share one helper that takes the name from parse_remote_registry_source("")
instead of repeating the literal.

The characterization test was wrong too, and the mutation caught it. It asserted the two
answers agreed; deleting the marker check from the helper then broke just one of three marker
cases, because with no markers both authorities wrongly answer present and still agree. Each
case now pins the absolute answer. Re-run: M-A trips all three, M-B (registry stops
validating) trips the .gguf-of-HTML case alone, M-C (optional checkpoints ignored) trips the
whisper side cache alone.

One divergence is left and now documented rather than hidden: a row that adopted an
extra-directory cache reads downloaded:true beside present:false, because the registry source
answers for the managed cache only. Both fixes cost something -- reading the extra roots from
the source risks writing refs/main into a directory lemonade does not own, and recording the
adoption on the row changes the source the API reports and which rows the update scan visits.
That is a step of its own, not a smuggled-in extra.

cpp-ci 119/119, cli2 73 OK, endpoints 178 OK, whisper 12 OK, app regression 136, generators
--check, comment gate 0.

* S6: invalidation invalidates; it does not rebuild or publish

The write path published twice for every model change. `Write` publishes in its destructor,
and `invalidate_cache()` published a draft that is only a copy of what is already published --
so an invalidation announced a snapshot that says nothing changed, and the rebuild that follows
announces the change. Deleting the publish from the invalidation is the whole step, and it
needs the flag write to take the writer lock, since a reader can now hold the shared lock for
the whole read instead of a copy.

`invalidate_models_cache()`, `catalog_set_changed()`, the `DirectoryWatcher` callback and
`deps.persist_size` -- "content changed" and "the cache might be stale", the two ways a model
write used to end -- point at `ModelStore::invalidate()`. `persist_size` takes the size off the
published snapshot rather than opening a write to get a draft. `StoreWrite` scopes in the
facade 7 -> 3: two options patches and the download self-heal S7 renames. Live, one touch in
the extra models directory produces exactly one `Cache built`, and a burst of two produces one.

`test_generation_survives_a_rebuild` asserted the opposite -- "invalidating publishes, so a
lock-free reader sees it" -- which was the intended behavior written as a test of the old one.
It is replaced by `test_invalidation_publishes_nothing` in the store, and the notifier gains
`test_invalidation_marks_stale_without_publishing` and `test_an_invalidation_announces_nothing`.

Two things the plan had wrong: `Write::invalidate_cache()` has four callers left, not two; and
`StoreSnapshot::valid` is copied from `cache_valid_` at publish, so an invalidated store still
hands out a snapshot reading `valid: true`. Safe while `patch_download` is its only reader --
that path is guarded by `Write::cache_valid()` -- and worth reconciling if S7 touches either.

Verification: ctest -L cpp-ci 119/119; the comment gate is clean; both doc generators
report no drift; endpoints 178 tests OK (3 skipped) and whisper 12 OK (2 skipped). cli2 stops
at `test_092`, which fails the same way with this commit stashed and passes when run alone:
its shared repository is also `USER_MODEL_TE_CHECKPOINT`'s, and earlier cli2 tests register and
download the model that claims it. A fixture collision, not a delete regression.

* tests: the dummy model's text encoder gets a repository of its own

`test_092_delete_preserves_cross_repo_dependency` asserts the shared repository
directory is gone once the last model that uses it is deleted. `user.Dummy-Model`,
registered and pulled by earlier tests in the same persistent suite, resolved its
text encoder inside that same repository, so the delete correctly kept the bytes and
the assertion failed. The fixture already warns about this in two comments -- "only
holds while nothing else claims it" -- and the rule is stated for the main checkpoint
but was never applied to the text encoder.

Moved to a ~11 MB quant of `mradermacher/Tiny-LLM-GGUF`, a repository no other fixture
touches. Both consumers of the constant compare the checkpoint string, so nothing else
changes.

Why it hid: the repository held an unclaimed orphan file, and deleting a model whose
bytes nobody else claims removes the directory over it. Once the cache was cleared and
the suite re-downloaded Dummy-Model through the server, the ownership claim was written
and the collision became visible.

Verification: cli2 73 OK (2 skipped) -- previously 40 run, failfast at test_092 -- and
endpoints 178 OK (3 skipped), which exercises the constant in both directions.

* S7: the store answers reads, so collaborators stop reaching back into the facade

ModelStore took the read side the spec assigns it -- current(), resolve, exists, info,
resolve_name, public_name_for, rejection_reason, supported_models(), downloaded_models(),
resolved_paths_for, is_downloaded -- plus the one AliasManager resolution needs and the
composer its owner installs, because composing reads catalogs, registries, the machine
probe and saved options and none of that belongs to the store. A store with no composer
answers from what it published and never builds, which is what a test that patches rows
directly wants; the eleven sites that default-constructed one now name an in-memory
AliasManager.

ModelIngest::Deps lost seven read lambdas and three signal ones: models_changed and
model_updated became one ModelChangeNotifier*, persist_size moved into ingest (it needed
only the registries and the store it already held), and SyncService::Deps lost three and
gained a ModelStore*. Fields across the deps and hooks bags: 41 -> 27. make_ingest_deps()
is 34 lines, then 13. The facade's read verbs are one-line delegations; the file went
1096 lines -> 904 and its header 87 declarations -> 85, with both ceilings tightened.
wait_for_sync() was dead with no caller anywhere and is gone, and
remove_model_from_cache() -- a wrapper for one store call -- is inlined into the delete.

Three things the plan prescribed are not what shipped, and the spec now says why.
exists_unfiltered is not a store verb: it asks the registries about rows the host filter
removed, so the published set cannot answer it, and ModelIngest computes it from the
RegistryDocuments it holds -- a store method would be a second registry reader for one
caller. resolved_paths_for moved to ModelStore rather than ModelArtifactStore, because it
reads one published row's recorded paths, which is a snapshot question; the plan called it
the opposite. info() throws for a name nothing answers, since that is the contract the
facade's get_model_info has always had and every caller depended on; the nullable question
is read()->find(), and rule 6's wording distinguishes them.

A pinned contract caught a regression mid-step. Delegating resolved_paths_for through
current() turned a pure read into a compose-path call, which queues behind an in-flight
patch, and "a read answers while a writer holds the store" failed. Which verbs ensure and
which never wait is now written in the header, in the spec, and in that test.

Moving the self-heal changed behavior. The facade corrected a missing-bytes row with a
hand-rolled write that flipped that one row; the store verb routes through patch_download,
which also settles the collections routing through the model. A collection whose
component's bytes vanished no longer reports itself downloaded. Nothing pinned the old
narrow behavior, so this is a change to notice rather than one to assume.

Mutation checks. Dropping the alias fallback from ModelStore::resolve fails
NameResolutionTest, which covers the six steps end to end. test_model_alias does not catch
it and cannot: it exercises AliasManager alone, which is the point of the spec's rule that
aliases are consulted at resolution time and never folded into the snapshot. Dropping the
exists guard in ingest's pull fails PullRegistryTest, not the endpoints test_000a the plan
predicted.

Verification: ctest -L cpp-ci 119/119 after touching every source and rebuilding; app
regression 136 passed; both doc generators report no drift; the comment gate in CI form is
clean. Integration ran green against this code with comment-only edits still to come --
cli2 73 OK (2 skipped), whisper 12 OK (2 skipped), endpoints 178 OK (3 skipped) -- and the
repeat of that battery could not finish: this machine lost network egress partway (server
log full of "Could not resolve hostname", curl to huggingface.co returning 000), and the
one cli2 failure, test_044's config set, followed test_043 rebinding the listen host.
Re-run cli2, whisper and endpoints before relying on this commit end to end.

* S8: no header includes the facade header

A header that includes model_manager.h hands the whole models layer to
everyone behind it. Three of them did — backend_manager.h, wrapped_server.h
and backends/backend_ops.h, each included by 53-58 files — so editing the
facade recompiled 75 of the tree's product files. It now reaches 22, all of
them translation units that call it.

model_manager_types.h declares ModelManager and ModelInfo for the headers
that name the orchestrator without calling it; the alternative, writing the
pair out in each header, duplicates the struct/class kind MSVC warns about
and buys ~1 TU per header where the fan-out is small. Headers that read
models facts name the leaf for each fact instead: download_progress.h,
model_info.h, registry_types.h, artifact_fetch.h.

FacadeShapeTest now ratchets transitive reach rather than the direct-include
count, which a cosmetic edit could satisfy, and fails if any header includes
the facade at all. allowed_reexporters is compared as a set — it was failing
on ordering, not membership. download_progress.h joins the public read side.

Verified: cpp-ci 119/119, cli2 73 OK, endpoints 178 OK, whisper 12 OK, app
regression 136 passed, both doc generators --check clean.

* S9a: three facade helpers stop being public

forget_registered_model, save_model_options and start_directory_watcher were public, and every
product call to them comes from inside model_manager.cpp. The two tests that drove
save_model_options drive the public replace_options verb, which performs the same file-plus-cache
write, so no seam is lost by closing them.

download_from_huggingface_engine has no caller in the tree and stays: its comment says it is a
source-compatibility alias for integrations built against the original API, and an in-repo scan
cannot see those callers.

StoreWrite stays public for one reason - test_model_manager_shim holds a writer while a reader
runs, and with no read-only accessor for the facade's ModelStore that is the only way to express
the test. The comment names the blocker: give ModelManager a const store() seam and re-home the
writer hold, and the token becomes private.

FacadeShapeTest's direct-includer ceiling drops to its honest value of 22, so an added includer
fails instead of being absorbed by slack. cpp-ci 119/119.

* An invalidation landing mid-compose is no longer silently discarded

S6 moved invalidation off the write path: invalidate() takes the writer lock, clears
cache_valid_, and publishes nothing. That removed the only signal a compose in flight had.
Build::commit() refused a candidate by comparing generation_, which an invalidation no longer
moves, so a compose racing a persist would land a set built from catalogs enumerated before
that persist and set cache_valid_ = true on top of it. The stale set was then current: the
model that just finished downloading stayed missing until something else invalidated.

An invalidation now bumps invalidations_, a counter no client watches, and Build records it
beside the generation. Bumping generation itself was rejected: it is the signal that a set was
published, and an invalidation publishes nothing.

ComposeRetryTest caught this by accident. It had been simulating the racing writer with a raw
StoreWrite, whose destructor publishes, so it exercised the pre-S6 mechanism and passed; pointed
at the verb product code actually calls, it failed. test_store now pins the same case one level
down, where the store owns the race.

Also in this commit, the rest of S9b:
- ModelManager gains const store(), the read seam. A write scope needs a non-const ModelStore,
  so no caller of it can hold the facade's writer, which is what let StoreWrite go private.
- The reader-not-blocked-by-a-writer check moves from test_model_manager_shim to test_store,
  where the store is the thing under test; the shim test no longer needs write access.
- FacadeShapeTest gains "only the models layer and the facade open a store write scope": ingest,
  cloud_rows and update_scan write, gateways and backends cannot.

cpp-ci 119/119, cli2 73 OK, endpoints 178 OK.

* S9c: four facade verbs with no product caller go away

generation(), all_models(), has_alias() and checkpoints_complete() were one-line pass-throughs
that nothing in the product called. The store already answers the first two through the read
seam added last commit, so the tests now say manager.store().generation() and
store().read()->models -- which is also what the read migration will leave the gateways saying.

checkpoints_complete() asked ModelArtifactStore::complete() about a row, and the thirteen tests
that used it were handing it rows that are not in any store. complete() needs nothing from the
manager but the row, so test_model_download_state now holds its own artifact store: the checks
are about a row and the bytes on disk, and that is the pair they name.

has_alias() turned out to have no callers at all - the three hits the caller census counted are
AliasManager's own method, called on an AliasManager. A receiver type is part of a caller count.

FacadeShapeTest's budgets re-struck to their honest values: 86 -> 82 header declarations,
904 -> 889 lines. cpp-ci 119/119.

* S9c: resolved_paths_for leaves the facade

Nothing in the product called it. The two callers the caller census counted are inside ingest,
where they already go to the store directly - the same receiver-type mistake as has_alias last
commit. The store's own version is const, so the shim test reads it off the store seam.

Budgets: 879 lines, 81 header declarations.

* spec: the facade's read verbs stay, and why

Plan item 2b said to delete the one-line read delegations once the store answered reads. That
cannot be done: a facade read composes, composing publishes, and publishing takes the writer. A
ModelStore& handed to server.cpp to save a delegation is a store write scope waiting to happen in
a file that has no business holding one.

Rule 6b records the shape that is actually safe: the read verbs stay on the facade, and
ModelManager::store() is const, offering only what answers from the published snapshot without
waiting on a writer - read(), generation(), descriptors(), resolved_paths_for().

* spec: the facade sketch becomes the shipped surface

The sketch ended its alias group in "..." and stood for thirty-five verbs that ship. It now lists
them, grouped by what they are asked for, and the name-set diff between header and sketch is
empty in both directions.

Two corrections it forced. wait_for_sync() never shipped - the verb is wait_until_sync_idle().
resolve_model_name() was missing from the reads group. download_from_huggingface_engine() is
written down with the reason it survives an empty caller list: source compatibility for
integrations built against the original API, whose callers this repo cannot see.

* S10: the resolver mints refs and opens every repository

Pull and update scan each re-implemented selection: assembling ArtifactRefs from checkpoint
strings, filtering the lazy checkpoints, parsing repo_id and variant. Three copies of rules that
decide what a pull downloads, each able to drift from the others.

ArtifactSourceResolver gains refs_for(info) and repository_for(ref, placement).
download_from_registry takes both; the update scan, hf_variants' pull listing and
search_registry take repository_for. ingest and update_scan lose their repository_for Deps
lambda: the injected host now reaches them through the resolver's hook, which is where
ModelManager wires ModelManagerConfig::repository_for, so a stubbed pull stubs one thing.

The facade builds one resolver at construction. It used to build hooks and a resolver inside
every source_for() call, which is once per checkpoint.

FacadeShapeTest now refuses `create_repository(` anywhere but the resolver, the factory that
declares it, and the facade's one wiring line. That is "one site binds a checkpoint to a source"
taken literally.

Two divergences are deliberate and now written into spec rule 7: the pull keeps its own list() +
registry_download_plan() rather than acquisition() (one listing serves three decisions), and the
update check keeps group_aux_checkpoint_variants because a malformed auxiliary checkpoint is
skipped silently by a check and refused loudly by a pull.

test_update_scan had been reaching the real factory through an unset seam and relying on it to
throw; it now installs a stub that answers "can go stale" and fails on the tree, which is the
shape it was always pretending to test.

cpp-ci 119/119, cli2 73 OK, whisper 12 OK, endpoints 178 OK; /pull/variants returns 12 variants
for a live repo through the new seam.

* S11 (part): fold checkpoint_grammar and definition_labels into the headers that own them

checkpoint_grammar was two functions parsing a ref's own parts; they now sit with ArtifactRef,
which is what the grammar describes. definition_labels was row policy -- the label set a
registration derives -- and json_catalog is where a row is parsed, so it moved there and took its
backend-descriptor include with it. Two .cpp link units gone, two headers fewer.

The other six candidates in the S11 table do not survive the step's own rule, and each reason is
now written next to the row it refutes:

- catalog_fetch_clock: four owners (catalog_set deps, configured_catalog, model_manager member,
  the locator), not "its only user". Folding into any one makes three peers depend on a sibling
  for a type all four share.
- registry_documents: holds a mutex and publishes immutable snapshots. The step excludes anything
  with a mutex, and this row contradicts that.
- routing_parse_options: three parse sites build their tiers differently; that is the point of it.
  No host owns the concept.
- recipe_option_layers -> recipe_options_store.h: the store is one rung of the ladder the folder
  builds. Making the rung own the ladder inverts it, and the store has three mutexes.
- fetchable_repository.cpp -> registry_id.cpp: the registration table maps ids to repository
  factories. Inside registry_id.cpp the id type would depend on every repository, which is the
  dependency the factory exists to invert.

* S12: one StoreWrite binary for the store's write side; 3 CMake blocks become 1

test_store, test_store_build and test_store_patches all asked the same question of the same
object -- what a writer does to the published snapshot, and what a reader sees while it
happens -- so they are one process now, with each file's helpers kept in its own namespace
rather than renamed until they stopped colliding. 73 check() call sites in, 73 PASS lines out.

StorePatchesTest was listed here as "targets a class deleted in P4a". It does not: it exercises
patch_download and patch_removed, both live, so it merged on its actual surface instead of being
deleted. Deleting it would have dropped five checks over store writes that nothing else covers.

StoreSnapshot stays separate. It is the read side, and merging a read-side binary into a
write-side one would leave a binary named for half of what it tests.

Also removes a third copy of the saved-options rationale; composition.h owns that sentence.

* S13a: repository bookkeeping leaves artifact_store.cpp into its own unit

A repository cache's snapshot pointer and its processed-model ledger were six methods at the end
of a 1176-line file, beside download cleanup that has nothing to do with either. They move to
repository_provenance.{h,cpp} and the class forwards, so callers are untouched. The store is now
1055 lines; the extracted rules are 171, and RegistryProvenanceTest already covered them without
needing a new fixture.

* S13b: collections leave ingest.cpp into their own unit

Fetching a manifest, registering the components it names, deciding whether a collection may be
registered at all, and refilling a slim entry from a cached manifest: four methods plus three
helpers that only they used, 469 lines out of a 1471-line file. They share one input — the
manifest — which is why they belong together and not spread across the ingest.

ModelIngest keeps its public validate_collection() and populate_from_cached_manifest() and
forwards, so no caller changed; register_components and resolve_from_manifest were already private
and are now the collection unit's. The back-pointer to the ingest is there because a collection
pulls its components through the same path a plain model does rather than owning a second copy of
the download code. The destructor moves out-of-line for the unique_ptr.

ingest.cpp is 1058 lines. cli2 73 OK, endpoints 178 OK, whisper 12 OK, both doc generators
current, ctest 117/117.

* S14 items 1 and 2: delegated delete gets its fixture; a mistyped config value stops emptying the model set

Two carried defects, both about absence.

Delegated delete had no fixture. The path is real -- flm's descriptor declares self_manages_downloads,
so its source answers Deletion::Kind::Delegate, ownership_of records the recipe, and remove_self_managed_model
does the removal -- but nothing pinned it, so nothing said which side of that chain a change had broken.
The new case registers an flm row, deletes it, and requires the request to reach the backend: with no flm
executable the delegate refuses, and the refusal is the evidence. A CacheDir branch completes silently and
looks like success, which is why mutating `kind == Delegate` to false now fails two checks instead of none.
It needs disable_model_filtering for the same reason test_model_delete_shared_repo.cpp does -- flm is a
system package the test host will not have, and filtering would drop the row before the delete reached it.

backend_string/bool/int/double read config_[section][key].get<T>() after checking only that the key exists.
config.json is hand-edited, so a value of the wrong type throws type_error.302 out of recipe detection,
where it is caught and logged -- leaving `recipes` absent, which the router reads as "no recipe is
available" and filters every model on the machine. One bad key cost the whole set. All four now read
through one lookup that treats absence and mismatch alike, so a mistyped value costs at most the setting
it holds. Pinned by feeding build_recipes_info a document whose llamacpp.backend is a number: before, the
test binary aborted with the exception; after, the table survives with the recipe in it.

Top-level keys were already validated at construction, so they are untouched -- this was specific to the
per-backend readers, which had no validation behind them.

ctest 117/117.

* S15 (part): budgets struck to what they measure, and printed where a shrink will show

Three of the five facade budgets sat exactly at their ceiling with nothing saying so, which is the
same drift the ceilings exist to catch -- one line added somewhere else would have failed for a
reason unrelated to the line. All five now read the measured value: 876 lines, 82 declarations,
19 members, 22 direct and 22 transitive includers. The closure equaling the direct count is not a
coincidence to tidy; it holds because no header propagates the facade, and that has its own check.

Adds one summary line to FacadeShapeTest's output listing each budget against its ceiling. A
ceiling only says "not worse"; without the measured number a shrink is invisible unless someone
goes looking, and the reason to notice a shrink is to tighten the ceiling before something backfills it.

Also records S14 item 3 as investigated-and-left rather than open. validate_checkpoint_file() was
offered as the hook that already answers "may this file complete this checkpoint", and it does not:
it returns "" for a non-.gguf path, skipping magic-number validation rather than rejecting the file,
so routing the three literals through it refuses models that load today. Each site is written up
where the next reader will look instead of reopening the question.

* S15: the store's forwarding declarations point at the provenance rules instead of restating them

Splitting a unit copies its doc comments along with its signatures, and six of them ended up
describing the same behavior twice -- once where it is decided, once where it is forwarded. A pair
like that goes stale on the first change to either side. The header keeps one line saying what the
group is and where the rules live; the parameter note stays only where the default is not visible.

* S15: one sentence describes the provenance group, at its own header

The forwarding block restated in different words what repository_provenance.h already says about
the same five functions. A pointer is enough from a file that decides nothing.

* S15: registry_source_of moves to the header that owns registry names

It normalized ModelInfo::registry_source from artifact_store.h, where it sat beside the cache layout
it has nothing to do with. It is now declared next to parse_remote_registry_source() and
remote_registry_source_name(), the two calls it composes, and defined in the same file as them. The row type
does not take on registry parsing to get this: the function takes a row, which keeps the dependency one-way.

Ten call sites dropped their models:: qualifier, since lemon::models sees lemon:: by lookup -- the
qualified spellings were only ever correct because the declaration happened to be in the models layer.

Resolves the question S7 left open about this function's home. ctest 117/117, facade budgets unchanged.

* review: a store snapshot lives as long as the loop that reads it

* review: an NPU cache already on disk is not fetched again by an auto-load

* review: a planned name cannot place bytes outside its own directory

* review: load_optional_json looks for the UTF-8 path it was given

* review: the POSIX safe_* answer instead of throwing

* review: the snapshot golden compares one separator, not the native one

* review: the re-exporter diff compares the lists it prints

* review: the reader threads run before the writer stops them

* review: a re-pull proves it wrote no bytes; the empty if goes

* docs: a Hugging Face snapshot directory is the commit SHA

* gate: the directory-settings needles move with discovery into ScanCatalog

* build: test_auto_tune links json, and the gate asks reachability not naming

* models: a row borrowed from a published set outlives it; find() aliases the set

* api: checkpoint_status[].path is opt-in with ?include_paths=true

* aliases: a save holds the lock from snapshot through rename

* paths: one grammar for a component, and no writing through a symlink

* models: a delegate's checkpoint answers with the row's own fact

* comments: cut the essays this branch wrote

* comments: drop a same-pattern pointer in the collection ingest

* docs: the include_paths link names the heading that exists

* pull: a snapshot id the layout refuses throws instead of planning nothing

* transfer: a file name passes the grammar, not only containment

* docs: the spec names the consumers that exist after the merge

The merge moved every caller into route classes, so the spec's file names and its claim that the model-object field list is hand-kept both went stale in the same change. Records the merge in the plan: what moved where, the three silent losses the port recovered, the ceilings re-struck to measurement, and which suites did not run here.

* store: a collection's state settles under the writer lock

Two components of one collection finishing at once each computed the dependent
collection states from the set they had read, so each saw the other still
absent and both published the collection as not here with everything
installed. The recompute is a scan over rows and touches no filesystem, so
moving it inside the Write scope costs nothing it could not pay under a lock,
and the draft it reads is the one this writer just patched. A component the
draft no longer holds counts as absent rather than as just landed, so a delete
landing between the read and the commit cannot complete a collection on a row
that is gone.

The test starts both writers at once and repeats the round, because the window
they must both be inside is filesystem work wide: it fails on the ordering this
replaces and passes on this one.

* allow deleting models with all checkpoints shared

* relax symlink rules when they are within the repo

* address review comments

* address review feedback

* reduce test footprint

* fix shared-repository deletion with HF symlinks

* restore resume validation

* fix resume via proxy

* fix regressions

* address more review comments

---------

Co-authored-by: fl0rianr <[email protected]>
2026-10-27 19:57:39 +00:00
Jeremy FowersandClaude Opus 5.5 c611876788 docs: transcribe the policy for adding a new backend (#3925)
* docs: add backend policy and make it the single source of truth

Add a Policy section to docs/dev/adding-a-backend.md covering the
differentiated user story, hardware test plan (DevLab Dispatch), and
support tiers. Replace the competing tier definitions in the API docs
and the container-backends spec with links to it, and point the RFC
guide, RFC template, dev README, and BackendTier comment at it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* edits

* Adrian’s suggested change

* Update backend submission policy details

Clarified requirements for backend submissions in policy section.

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-23 21:05:33 +00:00
Michele Balistreri 32bb85968b docs: add ModelManager spec (#3768)
* draft model manager refactoring

* draft model management spec

* address review comments

* remove eol

* remove some non-relevant comments
2026-10-22 15:34:19 +00:00
9a9d43abc6 Fully refactor the HTTP server: route classes, core components, generated API docs (#3771)
* docs: add the server architecture spec

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): unpack multipart forms before ModelRoute resolves the model

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): require model on ModelRoute unless the route defaults to the loaded model

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): drop the startup shadow check in favor of per-folder registration order

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): keep WebSocketServer out of ServerContext since config changes replace it

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): declare each route's responses and request format

- RouteSpec::responses lists every format a route returns, with an inline JSON Schema and a recorded example for each; streaming is part of the format
- RequestFormat replaces the json_body and form_body flags
- Model name resolution is left to ModelManager

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): rename the server architecture spec to HTTP Server

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): fix four gaps found while implementing the HTTP server spec

- Require model on every ModelRoute; drop model_defaults_to_loaded, since the
  Router has rejected a missing model since multi-model support landed.
- Keep images/upscale on ApiRoute, since it runs its upscaler as a one-shot CLI.
- Add RouteSpec::experimental and a Partial support level so the existing docs
  badges survive generation.
- Shorten long strings and arrays in recorded examples, and redact the
  harness cache directory and home directory.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec the generated docs in main's API reference layout

Routes render as Parameters, Example request and Response format, with
Field Descriptions built from ordered_json response schemas. Summary tables
gain Modality and Status columns and keep hand-written rows.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Trim the spec's docs changes to what the layout requires

Keeps the ordered_json types, the modality and summary rules, and the new
route layout. Drops the field description rules, the tab label table and
the key order rule, and restores the original Complete Example, shown in
the new layout.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Revert spec edits the docs layout does not require

Restores the approved text everywhere except where it described the old
Response subsections and Schema tabs.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: let a route record several examples per response format (#3843)

RouteResponse keeps only the format and schema. A new RouteExample carries
each example's name, format, args and setup, and a setup ExampleStep either
runs another route's named example or sends an unpublished request.

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

* Implement the HTTP server spec: route classes, core components, generated API docs

server.cpp becomes a composition root. Every endpoint is one route class under
routes/<page>/<section>/, registered by its folder's routes.cpp; HttpListener,
RequestMiddleware, RouteRegistry, ConfigEffects and WebUi own the shared
machinery, and ModelLoader, ModelJson, DownloadManager, JobOps and the gateway
and Omni services hold what several routes share. ModelRoute runs the common
resolve, validate, load and run pipeline.

docs/api is generated from the routes' RouteSpecs by gen_api_boilerplate.py,
with real request and response examples recorded in
docs/tools/api_examples_cache.json. Docs And Style runs --check, and the weekly
backend-bump workflows re-record the examples a new pin invalidates.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Ship the routing decision schema in the MSI and embeddable archive

Route registration reads resources/schemas/decision.schema.json, so every
package that lists its resources by hand must include it; the embeddable
smoke checks now require it. The registry search app test now finds the route
in its route file.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Drop model_defaults_to_loaded: every ModelRoute requires a model

The Router already rejects a request with no model, so the flag only kept
the four text routes' older error text. They now answer the same 400 as
every other model route.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Port main's image edit and backend label changes into the route classes

- images/edits accepts several image[] references, rejects mixing image and
  image[], and infers an omitted size from the first reference, capped by the
  model's image_defaults.soft_pixel_cap.
- ModelJson reports image_defaults.soft_pixel_cap.
- The system-info schema adds each backend's tier and format and each recipe's
  experimental flag; the Backend Tiers and Formats section moves over as a
  hand-written section, and the experimental model label row is dropped.
- Re-record the system-info example, which predates tier and format.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Keep main's API docs wording and layout in the generated pages

The generated docs now follow main's API reference layout: Parameters,
Example request, then Response format with a Field Descriptions list built
from the response schemas, which are ordered_json so fields keep their
written order. Route text, examples and hand-written sections use main's
wording, with small edits only where main's text no longer matches the code.

Summary tables keep main's columns and rows: a Modality column from the new
RouteSpec::modality, a Status column on pages with unsupported routes, and
hand-written rows the generator keeps for the WebSocket endpoints and the
llama.cpp slot actions.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Port main's per-GPU metrics into the route classes

- system-stats reports primary_gpu_id and a gpus list, and gpu_percent and
  vram_gb come from the primary GPU. The route and the job engine's
  system_stats op now build the reading in one place, services/system_stats.
- The Prometheus metrics route reads the primary GPU the same way.
- The system-stats schema documents the new fields, and main's GPU notes move
  over as a hand-written section.
- Re-record the system-stats example, and the examples whose llama.cpp ROCm and
  sd-cpp pins main bumped.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Trim comments to the ones that explain a why

Drop comments that restate the code, name their callers, or say what the
code does not do, and shorten the rest to their one non-obvious reason.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Re-record the stale /internal/config example and guard against recurrences

The internal.config example was recorded before #3775, when lemond still
merged /usr/share/lemonade/defaults.json from an older installed package,
so it carried openmoss.rocm_bin from before #3615. The cache key cannot see
lemond's own defaults, so the entry was never re-recorded and --check
passed.

- Re-record internal.config; it now matches internal.config_defaults.
- Compare the recorded internal.config and internal.config_defaults with
  the fresh lemond the generator already starts: --check fails on a
  mismatch, and a normal run re-records the entry.
- Strip LEMONADE_DEFAULTS_PATH and LEMONADE_ALLOWED_ORIGINS from the
  harness lemond's environment so the recording machine's settings
  cannot seed its config.
- Drop the OpenMOSS ROCm usage line from server_tts_openmoss.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UGEQsXh31AhYdQ8C8Cjup4

* Revert the generator and test changes from the stale-example fix

Keeps only the re-recorded internal.config example.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UGEQsXh31AhYdQ8C8Cjup4

* Make docs/api/internal.md the one reference for the internal endpoints

- getting-started.md drops its Internal Endpoints section. Its remote-access
  note and non-loopback warning move into internal.md's intro, and its
  simulate-vram-pressure behavior into that route's notes.
- runtime.md keeps a table of the settings and shutdown endpoints an
  embedding app uses, each linking to internal.md.
- internal.md states which apps may use these endpoints, and the hand-written
  lines that repeated the generated sections are gone; the alias delete 404
  moves into the route's notes.
- Guide mentions of internal endpoints link to internal.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Move hand-written API docs into the route specs

The hand-written text between generated regions either repeated the
generated sections or described a single route. Repeats are deleted, and
route facts (error statuses, behavior notes, examples that cannot be
recorded, and concept sections such as Backend Tiers and Server-side Tools)
move into each route's notes, keeping their anchors. What remains
hand-written is page intros, the WebSocket APIs, Model Labels, the routing
overview, MCP's shared tool behavior, and examples a single recorded
request cannot show.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Let a route record several examples per response format

RouteResponse keeps only a format and its schema. Each route lists its
examples in RouteSpec::examples, each with a name, the format its reply is
validated against, its args and its setup. A setup step runs another
route's named example, or sends an unpublished request. Cache keys hash a
named step the way they hashed the response it replaced, so every existing
recording stays valid, and example names reproduce the tab labels the
generator used to derive from formats.

The slots save and restore examples and the ACE-Step vocals example are now
recorded instead of hand-written. The docs harness runs lemond in its
temporary cache dir, so llama.cpp's relative --slot-save-path writes there.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Tighten every route's docs and keep main's page order

Route descriptions, notes, argument and field descriptions no longer repeat
the generated URL, alias and auth line, the page intro, the parameter
table or each other, and statements that disagreed now match the code.
lemonade.md and openai.md list their routes in main's order, and each
page's summary table follows its section order. A field list renders
once when a route's examples share a format, /v1/load's example is a plain
load, and the slots examples load with --slot-save-path and save a chat
capped by max_tokens, so save and restore report the same token count.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Fix what a final read of the rendered API pages turned up

- False claims: /health's --websocket-port flag (it is the websocket_port
  setting), /health's max_models missing classification, images/generations'
  n limited to 1, chat's max_tokens being exclusive with
  max_completion_tokens, route ids being docs anchors, and install
  registering only OpenAI-compatible providers.
- Repeats: Ollama's unload notes, MCP's shared tool behavior, the 501 in
  unsupported routes' summaries, the image options in Ollama generate's
  options row.
- Rendering: placeholders like <PROVIDER> and <recipe> are now in backticks,
  so Markdown no longer hides them.
- Wording: the routing decision description, sync status fields, summary
  styles, heading case, and em dashes in Model Labels and MCP tool text.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Fix the last issues from the final read of the API pages

Chat's logprobs is honored (a llama.cpp chat returns choices[].logprobs), so
its row is available again. Ollama pull's status values are in backticks so
<file> renders, MCP tool descriptions name their default model only in the
model row, and the cloud provider headings use title case.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Regenerate the API and MCP docs after syncing with main

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Keep decision.schema.json unchanged; describe x_lemonade_route at the field

decision.schema.json is under the frozen-major schema lock, so the
completion routes take their field description from
route_decision_field_schema() instead of editing the schema.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec a contract for route docs and lint it in the drift check

Each RouteSpec text field gets one job, URLs use only the /v1/ form, and
the drift check fails on the patterns that made the generated pages
repeat themselves. The generator documents a Quad route only at /v1/.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Apply the route docs contract to every route and lint it

gen_api_boilerplate.py --check now lints route text against the spec's
Route Documentation Contract: phrases the generator prints, prefixes other
than /v1/, em dashes, placeholders outside backticks, long summaries and
descriptions, and sentences repeated within a route's region. The
generator documents a Quad route only at /v1/, listing aliases in that
form, and every route's text was revised to the contract, correcting the
claims that disagreed with the code.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Fix the last contract issues a full read of the pages found

/health's update_check_done and the models page's cloud note now match
the code (registry-agnostic update check; anthropic-wire providers serve
only /v1/messages). Field descriptions no longer state types, values and
lemond are in backticks, headings use title case, and /internal/set's
rows say "Defaults to".

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Contract: who-uses only when not obvious; arguments may state conditional requirements

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Fix every route the per-route contract audit flagged

An evidence-backed checklist audit of all 85 routes found 71 rule failures
and 33 false claims; each fix was verified against the handler code and
re-audited until every route passed. Notable corrections: attach_if_running
was described backwards; Ollama chat's think and the Ollama/Anthropic
gateways' alias handling are documented as they actually behave; image
defaults come from each model before the server-wide fallback; system-info
no longer documents fields nothing sets. The generator now prefers a
described field when response shapes share a name.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Pin the sampling of the chat that the slots save example runs

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: close docs-generation gaps found reviewing the generated pages (#3848)

* Spec: close the docs-generation gaps found reviewing the generated pages

- Field Descriptions print a schema's own description, list each shape of a
  multi-shape format separately, and list shared schemas in full.
- The contract gains a row for schema-level descriptions.
- Each example runs against a freshly started lemond.
- Arrays of objects and data-keyed maps show their first 3 entries, and
  lemond's version is recorded as <version>.
- Examples built from lemond's own docs or route specs are recorded live.
- docs/api/README.md states how clients send the API keys.
- Drift Check fails on a shape with no example, an undescribed recorded
  field, a recorded JSON body over 100 lines, or a live example that loads
  a model.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Spec: drop live examples; recorded values may drift, only the shape must hold

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Spec: name RouteResponse::schema instead of an undefined 'schema'

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Spec: add a claim review step for route docs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

---------

Co-authored-by: Claude <[email protected]>

* Generate docs per the updated spec: shapes, top-level descriptions, shortened lists, new checks

- Field Descriptions print the top-level description of a RouteResponse::schema,
  list each oneOf shape under its own description, and list $id schemas in full.
- Arrays of objects and maps keyed by data show their first 3 entries in the page.
- Drift Check fails on a format or shape with no example, a recorded field with
  no description, and a recorded JSON body over 100 lines in the page.
- docs/api/README.md says how clients send the API keys.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Drop all src/app changes from this PR

Removes the Playwright test-results output committed by accident and
restores tauriShim.ts to the base branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RrqRFa7Zrr517fcQb3ePKX

* Regenerate API docs with shapes, top-level descriptions and shortened lists; treat a described top-level schema without properties as opaque

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Describe every recorded field of the OpenAI text and image responses

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Describe model, load, download and classify responses; add pull, load and download-control examples for every shape

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Describe every recorded field of the remaining routes; add install and uninstall examples for every shape

Config routes model config.json as a map of settings. Examples that a
renamed setup step names now point at their new names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Spec: drop validate_args, which no route needs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RrqRFa7Zrr517fcQb3ePKX

* Show the first entry of arrays of objects and data-keyed maps, so system-info fits the page limit

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Spec: show the first entry of arrays of objects and data-keyed maps

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Remove validate_args: no route set it

The validation path in ApiRoute::serve() never ran, so drop the field
from the spec and RouteSpec, its /internal/routes output and schema,
and the McpTool::validate() wrapper that only it called.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RrqRFa7Zrr517fcQb3ePKX

* Record the missing examples; list each response shape in the tab whose response returns it

Recorded lemonade.pull non-streaming, lemonade.load collection,
lemonade.downloads_control remove, lemonade.install local and job, and
lemonade.uninstall local. A route whose examples span several formats
listed every shape of a format in each of its tabs, so two examples of
one oneOf format repeated the whole list.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Fix every claim the per-route claim review found false or missing

Each route's text was read beside its handler and the code it calls, and
changed claims were checked against a running lemond. Notable fixes:
routed responses always carry x_lemonade_route (route_trace only adds its
trace); pull's update-check note; Anthropic warnings and 404/409; Ollama
404/409/500, options marked partial, generate's two done lines; load's
merge_args, option layers and saved-option keys; error statuses on the
text, image, options, jobs and internal routes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: a shape no recording machine can return names the reason in x-no-example

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Exempt install's manual-setup shape from the example requirement

No recording machine runs a Strix Halo kernel without the CWSR fix, so the
shape names that reason in x-no-example. Drift Check skips such a shape,
and the format's first tab still lists its fields.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Regenerate internal.md after validate_args removal

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Test that model-optional classify keeps a routing helper's residency

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: ModelRoute skips the load when validate() picked a loaded model

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: describe the routing decision inline instead of reading decision.schema.json

lemond never read decision.schema.json before; it is the routing engine's
frozen contract. Routes now describe the decision with a short inline
object that links to the router page, which links to the schema file.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Keep a routing helper's residency when classify fills in the model

ClassifyRoute::validate() picks the sole loaded classifier, and ModelRoute
then loaded it again with the default UserInference purpose, demoting a
routing helper to a standard model. validate() now marks the model as
already loaded and ModelRoute skips the load step.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Parse number form fields as double, as main did

std::stof rejected values outside float range that main's std::stod
accepted, such as a transcription temperature of 1e39. No test added.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Log models and system-info request lines again

quiet_log dropped these routes from the access log entirely. Main logged
their request line and left out only the response line, so they move back
to the is_quiet_get list.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Log global_timeout and download_rate_limit only when they change

Server::Server applied them through ConfigEffects, which logged them on
every startup. It now calls the HttpClient setters directly, as main did,
and the change log uses main's wording.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Restore which default model each MCP tool downloads

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Stop reading decision.schema.json at runtime

The file is the routing engine's frozen contract, and lemond never read
it before. x_lemonade_route and routing/validate's decision now use a
short inline schema that links to the router page, which links to the
schema file. This reverts the packaging added only for this file and
restores main's source lists for the two decision tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Regenerate MCP reference docs

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: leave the web app's window.api mock out of WebUi's responsibilities

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Keep injecting the web app's window.api mock from WebUi

Restores main's behavior: lemond inserts the mock into the web app's
index.html, and the web-app build is unchanged from main.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Keep main's MCP tool descriptions

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: drop the routing-context and CPU-state lines the implementation no longer follows

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Drop the WebSocket server mutex main never had

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Fill routing/validate's context directly, as main does

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Keep background syncs and CPU-usage state in Server, as main does

ModelManager and the platform metrics classes match main again.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Restore main's alias null checks, warmup guard and shutdown setter

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: give examples a description, and keep requests out of notes

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Record the chat and pull examples that notes hand-wrote

Examples get a description, printed at the top of their response tab, and a
fixture can follow a prefix such as a data URL. Chat's image and Omni
requests and pull's register and collection requests are now recorded
examples; their notes keep only the concepts.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: give each example its own subsection

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Give each API example its own subsection

Each example's request tabs, response and description now sit together
under its own heading, and each response format's Field Descriptions are
listed once after the examples.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: let an example's description cover a request shape only it uses

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Move chat's image input note into its example

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: put the recorded status on the Response label

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Show each recorded status on its Response label

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: link the API pages instead of naming their paths

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: declare each route's errors so handlers and docs share one source (#3869)

* Spec: declare each route's errors as RouteError values

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: reword the status-code compatibility note

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: declare route errors without changing the wire

Replace the fail()/ErrorFormat draft with RouteError values that the existing
writers take in place of a status. Move status changes to Appendix B.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: sync the errors example with the implementation

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: address review of the route errors section

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: list the missing-model 400 only for a required model

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: keep the route errors edit minimal

Drop the argument-validation proposal from Appendix B and the mid-stream
error event from the worked example, which the error design does not need.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: say plainly why each error declaration exists

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: drop the RouteError struct comment

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: drop comments that restate names

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: describe the error writers without reference to the old signatures

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: rewrite the Errors section in the spec's own style

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: routes list their base class's error responses explicitly

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: name the missing-model error instead of its step number

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: link the API reference instead of naming its path

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: validate request arguments in ApiRoute::serve()

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: serve() removes undeclared nulls; MCP may read its own body

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: Drift Check flags base-class errors a route can't get

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: serve() renames aliases, and the name wins

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: validate nested values; describe invalid_argument by what it checks

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: check Form args and range/length/pattern keywords; Anthropic errors carry code

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: head each response shape with its title; drop the Field Descriptions label

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Declare each route's errors as RouteError values (#3871)

* Spec: declare each route's errors as RouteError values

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: reword the status-code compatibility note

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Add RouteError and convert core error writers to it

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Generate each route's Errors table and lint error statuses

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Declare every route's errors as RouteError values

Each error status a route writes now comes from a RouteError listed in its
spec, and the generated docs list them in an Errors table. Nothing changes
on the wire.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: declare route errors without changing the wire

Replace the fail()/ErrorFormat draft with RouteError values that the existing
writers take in place of a status. Move status changes to Appendix B.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Fix route error declarations from review

Correct inaccurate when texts and codes, document the race 404s the llamacpp
routes pass through, drop a dead provider guard, keep error-shape facts the
removed notes carried, describe stream error events, and add errors to the
/internal/routes schema.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: sync the errors example with the implementation

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: address review of the route errors section

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Drop notes that restate the stream error event

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: list the missing-model 400 only for a required model

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* List the missing-model 400 only for routes that require a model

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: keep the route errors edit minimal

Drop the argument-validation proposal from Appendix B and the mid-stream
error event from the worked example, which the error design does not need.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: say plainly why each error declaration exists

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Say plainly why each error declaration exists

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: drop the RouteError struct comment

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Drop the RouteError struct comment

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: drop comments that restate names

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Drop comments that restate names; keep the base header's comments

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: describe the error writers without reference to the old signatures

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: rewrite the Errors section in the spec's own style

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: routes list their base class's error responses explicitly

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* List base-class error responses explicitly in each route

Replace the registry's inherited-error merge and the paired error-list overrides
with base-class constants that each route lists in spec(), and lint for them.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: name the missing-model error instead of its step number

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: link the API reference instead of naming its path

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: validate request arguments in ApiRoute::serve()

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Validate request arguments in ApiRoute::serve()

Each Json/OptionalJson route's JsonBody and Query args are checked against
their RouteArg before handle(), with aliases, forwarded args and a per-route
ErrorFormat. Self-parsing Raw routes move to Json/OptionalJson and drop their
hand-written checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: serve() removes undeclared nulls; MCP may read its own body

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Remove a null only when its argument's type excludes null

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: Drift Check flags base-class errors a route can't get

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Rename aliases in serve() so handlers read only the argument's name

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Check nested argument values; drop route checks their schemas now cover

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Consolidate redundant route errors

Shared checks now declare their errors once beside the function that writes them,
catch-all 500s share ApiRoute::kUnexpectedException, Form args and range, length
and pattern keywords are validated centrally, and Anthropic errors carry code.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Share kUnexpectedException for install, uninstall and unload catch-alls

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Share errors for malformed backend responses, unlisted fields and 3D failures

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Share one alias-store 500 across the alias routes

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Head each response shape with its title in the API docs

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: compatibility with v2026.42 and prior; Ollama argument reading (#3896)

Adds a Compatibility with v2026.42 and Prior subsection (public API, URL
prefixes, older names, empty bodies, Ollama clients), the RouteArg
drop_invalid flag, and the first-spelling-wins alias rule. Drops the
quad-prefix invariant from AGENTS.md, since the compatibility section now
covers which prefixes are served, and renumbers the disconnect invariant.


Claude-Session: https://claude.ai/code/session_014JszCEzPFtJywaaGgq7rFu

Co-authored-by: Claude <[email protected]>

* Spec: drop drop_invalid; Lemonade extensions on Ollama routes are checked like any other argument

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014JszCEzPFtJywaaGgq7rFu

* Spec: the alias rule only drops an empty spelling; trim the Ollama clients bullet

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014JszCEzPFtJywaaGgq7rFu

* Ollama client-compatibility tests (#3886)

* Spec: collect compatibility rules under "Compatibility with v2026.42 and Prior"

The spec's Scope gets a subsection that lists what lemond keeps for clients
built against v2026.42 and earlier: the public API, the /api/v0, /api/v1 and
/v0 prefixes (still served for pre-existing endpoints, no longer documented;
docs and examples use /v1 only), argument and path aliases, and OptionalJson's
null body. The Prefixes table and the backend guide point there.

AGENTS.md drops invariant 10 (quad-prefix registration); the disconnect
invariant becomes 10, and the references to it follow. Two comments that
cited invariant 11 for unrelated rules now cite the right one or none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Test the Ollama gateway with the requests Ollama's clients send

Ollama's Go client (and so the `ollama` CLI) always sends both "model" and
"name" on show, pull and delete, leaving one empty, and Ollama reads
cmp.Or(model, name). New tests send those exact bodies for `ollama run`,
`ollama show`, `ollama pull` and `ollama rm`, plus think levels, a malformed
ctx_size (a field Ollama does not define, so it ignores it), /api/embeddings'
prompt next to an input, and options that are not an object.

Tests that need no model use an unknown model name and expect its 404, so
they fail when a request is rejected before the model lookup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Move the spec and AGENTS.md edits to their own PR; drop invariant numbers from code

The compatibility section and the invariant renumbering now land with the
spec, so code comments no longer cite AGENTS.md invariants by number.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014JszCEzPFtJywaaGgq7rFu

* Expect 400 for a malformed ctx_size on the Ollama routes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014JszCEzPFtJywaaGgq7rFu

* Drop the ctx_size and embeddings prompt/input tests

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014JszCEzPFtJywaaGgq7rFu

* Keep only the tests that send the ollama CLI's requests to a loaded model

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014JszCEzPFtJywaaGgq7rFu

* Ollama gateway: read model/name like Ollama, accept think levels (#3887)

* Read an argument's spellings the way Ollama reads model and name

ApiRoute::check_args now reads an argument sent under several spellings
from the first one with a value, the name and then each alias, checks only
that value, and drops the rest unchecked. An empty string is no value when
another spelling has one. This is Ollama's cmp.Or(model, name): its Go
client always sends both and leaves one empty, which the old rule rejected
because every spelling was checked against minLength.

RouteArg::drop_invalid ignores a value that fails its schema instead of
answering 400, for fields a gateway's clients expect to be ignored.

The spec's Argument Validation and Compatibility sections state both rules,
and test_route_args covers them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Ollama routes: accept think levels and ignore malformed Lemonade extensions

/api/chat's think takes a boolean or one of low, medium, high and max, the
levels Ollama accepts for models without their own; other strings answer
400 as in Ollama. ctx_size on chat, generate, embed and embeddings, and
generate's top-level width, height, steps, cfg_scale and seed, are Lemonade
extensions that Ollama does not define, so a malformed value is ignored as
Ollama ignores unknown fields. options keeps its object check, as in Ollama.

/api/tags' size is documented as the measured size of the model's files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Drop the route-argument C++ unit test

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014JszCEzPFtJywaaGgq7rFu

* Drop drop_invalid: malformed Lemonade extensions on Ollama routes answer 400

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014JszCEzPFtJywaaGgq7rFu

* Narrow the alias change to dropping an empty spelling; drop the /api/tags doc change

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014JszCEzPFtJywaaGgq7rFu

---------

Co-authored-by: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>

* Spec: name each route argument by its RouteArg constant (#3888)

* Spec: collect compatibility rules under "Compatibility with v2026.42 and Prior"

The spec's Scope gets a subsection that lists what lemond keeps for clients
built against v2026.42 and earlier: the public API, the /api/v0, /api/v1 and
/v0 prefixes (still served for pre-existing endpoints, no longer documented;
docs and examples use /v1 only), argument and path aliases, and OptionalJson's
null body. The Prefixes table and the backend guide point there.

AGENTS.md drops invariant 10 (quad-prefix registration); the disconnect
invariant becomes 10, and the references to it follow. Two comments that
cited invariant 11 for unrelated rules now cite the right one or none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Test the Ollama gateway with the requests Ollama's clients send

Ollama's Go client (and so the `ollama` CLI) always sends both "model" and
"name" on show, pull and delete, leaving one empty, and Ollama reads
cmp.Or(model, name). New tests send those exact bodies for `ollama run`,
`ollama show`, `ollama pull` and `ollama rm`, plus think levels, a malformed
ctx_size (a field Ollama does not define, so it ignores it), /api/embeddings'
prompt next to an input, and options that are not an object.

Tests that need no model use an unknown model name and expect its 404, so
they fail when a request is rejected before the model lookup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Read an argument's spellings the way Ollama reads model and name

ApiRoute::check_args now reads an argument sent under several spellings
from the first one with a value, the name and then each alias, checks only
that value, and drops the rest unchecked. An empty string is no value when
another spelling has one. This is Ollama's cmp.Or(model, name): its Go
client always sends both and leaves one empty, which the old rule rejected
because every spelling was checked against minLength.

RouteArg::drop_invalid ignores a value that fails its schema instead of
answering 400, for fields a gateway's clients expect to be ignored.

The spec's Argument Validation and Compatibility sections state both rules,
and test_route_args covers them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Ollama routes: accept think levels and ignore malformed Lemonade extensions

/api/chat's think takes a boolean or one of low, medium, high and max, the
levels Ollama accepts for models without their own; other strings answer
400 as in Ollama. ctx_size on chat, generate, embed and embeddings, and
generate's top-level width, height, steps, cfg_scale and seed, are Lemonade
extensions that Ollama does not define, so a malformed value is ignored as
Ollama ignores unknown fields. options keeps its object check, as in Ollama.

/api/tags' size is documented as the measured size of the model's files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Spec: name each argument by its RouteArg constant

Each argument becomes a RouteArg constant beside its handler that spec()
lists, as RouteErrors are. After serve() resolves aliases, route code reads
and changes an argument only through its constant (req.has, req.value,
req.arg, req.body[k.name]); query and path values are converted to the
schema's type. ModelRoute reads the model through model_arg() and
canonical_model_name(), which takes a name rather than a request body.
The drift check fails a route file that names an argument by a string
literal or reads a RouteArg its spec does not list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Spec: write the RouteArg constant rules in the spec's style

Move Reading arguments after the other serve() bullets, keep the Aliases
sentence as it was, and give the argument example the same shape as the
RouteError example. Word the ModelRoute step, the helper row and the drift
check bullet like their neighbours.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Spec: state the shared-helper rule plainly

Drop the comparison to RouteError and say directly which helpers receive
values and which receive the body.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Spec: name another route's and shared arguments by constant

A route that builds another route's request, as the gateways do, names
that route's arguments through its constants, which openai_args.h
declares for the OpenAI routes. An argument several routes take alike is
one constant, such as ModelLoader::kCtxSize. The drift check flags a
literal key on a built request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Spec: keep arguments that several routes take alike in shared_args.h

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Spec: take the example's stream argument from common::kStream

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Spec: the drift check fails a RouteArg that duplicates another

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Spec: path parameter rules, distinct arguments, helper reads, tagged model names

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0181gVXYv16yiMWExUzzEmvN

* Name every route argument by its RouteArg constant (#3890)

* Name every route argument by its RouteArg constant

Each route's arguments become file-scope RouteArg constants that spec()
lists. Route code reads and changes an argument only through its constant,
with new RouteRequest accessors: has(), arg(), value() and file(), and
req.body[k.name] for a value the route forwards. serve() collects Query
and Path arguments into req.params, converted to their schema types, and
RouteRegistry rejects a route whose paths order their parameters
differently or whose path pattern has its own capture group.

ModelRoute reads the model through each route's model_arg(), and
canonical_model_name() takes a name instead of a request body, so /unload
strips :latest and follows model aliases whichever spelling the client
used. Shared helpers that read arguments now take values:
gateway_load_options(), respond_with_model_options() and the local
backend recipe check.

The drift check fails a route file that declares an argument inline,
names an argument or alias by a string literal, or uses a RouteArg its
args do not list. registry/search now declares `q` as an alias of
`query`, which the generated docs list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Name other routes' arguments and shared arguments by constant

The gateways write the OpenAI requests they build through the target
route's RouteArg constants, which openai_args.h declares and the OpenAI
route files define: openai_req[openai::chat::kMessages.name]. The
arguments chat/completions and completions take alike are one set of
constants both list. map_ollama_options() maps Ollama option names onto
those constants.

ctx_size, which ModelRoute reads for every model route, is one
ModelLoader::kCtxSize that the model routes list, and load_options()
takes its value. The speech and audio format helpers take
response_format, the image upload helper takes the route's image
constant, map_ollama_options() takes Ollama's options, and the Omni
helper reads stream through the chat constant.

chat/completions and completions forward tool_choice, response_format,
seed and frequency_penalty without declaring them; they are now declared
as forwarded arguments, so the docs list them. rerank's ctx_size gains
the sentence the other model routes carry. RouteArg moves to its own
header so model_loader.h and openai_args.h can use it.

The drift check flags a literal key on a request built for an OpenAI
route, and resolves constants that route files list but do not define.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Keep each argument that several routes take alike in shared_args

Arguments that several routes declared as separate, identical constants
(the text routes' sampling arguments, the Ollama model and ctx_size
arguments, the jobs and models path ids, the download stream arguments,
and so on) are now one constant each in lemon/server/shared_args.h, which
every route that takes the argument lists. Where the copies' descriptions
differed only in wording, the shared constant keeps one wording, which
the regenerated API docs show.

ModelLoader::kCtxSize becomes model_loading::kCtxSize, and the
openai::text constants and openai::chat::kTools move out of
openai_args.h. The drift check now tells shared constants apart by
namespace and flags a route that reads a shared constant it does not
list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Share stream, max_tokens and provider where routes take them alike

The server-sent-events stream argument of the text routes and the
download routes is one constant, common::kStream, and Ollama's /api/pull
lists ollama::kStream with /api/chat and /api/generate. chat/completions
and completions share openai::text::kMaxTokens; the precedence over
max_completion_tokens is stated on max_completion_tokens, and
map_ollama_options no longer takes the max_tokens argument. install and
uninstall share backend_routes::kProvider.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Share model, steps, ctx_size, keep_alive and backend across routes

Every route that loads its model on first use lists model_loading::kModel,
or model_loading::kFormModel for a multipart form, in place of a
per-route model argument whose description only named the kind of model.
Ollama's /api/embed and /api/embeddings take gateway::kModel. Audio and
image generation share inference::kSteps, /v1/load and
/v1/models/{id}/options share model_options::kCtxSize, and Ollama's
/api/chat and /api/generate share ollama::kKeepAlive. The install dry run
lists backend_routes::kBackend, whose cloud value is now stated on
provider.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Share model_name between /internal/pin and /v1/delete

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Share dry_run between /internal/models/sync and /v1/models/{id}/options

How the options route's response reads after a dry run is stated in that
route's notes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* Drift check: fail a RouteArg that duplicates another

Two RouteArg constants with the same spellings (name and aliases, under
any constant name), location, schema and flags fail the check, whatever
their descriptions say, so a copy of a shared argument has to use the
shared constant. A group whose routes treat the argument differently is
listed in DISTINCT_ARGUMENTS with how they differ, and an entry that no
longer matches fails too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

* State that max_tokens wins over max_completion_tokens

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0181gVXYv16yiMWExUzzEmvN

* Pass router_dispatch() the values it reads, and lint helpers that read arguments by name

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0181gVXYv16yiMWExUzzEmvN

* Give uninstall its own provider argument: the installed provider to remove

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0181gVXYv16yiMWExUzzEmvN

* Describe keep_alive's unload condition as an empty input

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0181gVXYv16yiMWExUzzEmvN

* Keep :latest on a registered model name that ends in it

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0181gVXYv16yiMWExUzzEmvN

---------

Co-authored-by: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>

* Fix the misleading docs and the null job name the #3771 audit flagged (#3897)

- POST /jobs reads `name` from the checked body, so `"name": null` counts as
  absent and creates the job instead of answering 500 with no body.
- max_completion_tokens: the backend picks when both limits are sent
  (llama.cpp uses max_tokens, vLLM max_completion_tokens).
- models/{id}/files: an alias's id is not accepted.
- install: name the cloud errors that carry an object; the rest carry a string.
- pull: top-level mmproj is a filename in the checkpoint repository, and
  checkpoints.mmproj takes repository:filename.
- simulate-vram-pressure: one evaluation unloads at most one model, the first
  past its idle timeout before any pressure candidate, and downsizes idle ones.
- internal.md: the admin key alone leaves every non-internal endpoint open.


Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

Co-authored-by: Claude <[email protected]>

* Fix the five misleading docs statements the second audit found (#3902)

- models/sync status: a sync other than a dry run that found no models to
  check finishes `idle`.
- models/sync/status `sync_id`: a finished sync's answer is the status
  recorded when it finished, completed_sync_id and already_in_progress
  included.
- chat/completions streaming `usage`: vLLM models always send the usage chunk.
- chat/completions `tool_choice`: llama.cpp models treat the object form as
  `auto`, so the argument is Partial.
- install: name every cloud check that answers an `error` object, including
  missing fields and an `http://` base URL without allow_insecure_http.


Claude-Session: https://claude.ai/code/session_018UUSj8ww81MPozDgCc1Puq

Co-authored-by: Claude <[email protected]>

* Apply suggestion from @jeremyfowers

* Apply batched suggestions from code review

Co-authored-by: Jeremy Fowers <[email protected]>

* Spec: name each route argument by its RouteArg constant

Brings the spec changes from #3888, which merged into
jfowers/http-server-refactor, onto the spec branch so that every
spec change lives in the spec PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QCduCZnp6zXsBoSfy79Y7z

* Spec: drift check fails an API page missing from the nav or the API reference table

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QCduCZnp6zXsBoSfy79Y7z

* gen_api_boilerplate: fail when an API page is missing from the nav or the API reference table

--check now fails when a page that has routes has no entry in the
mkdocs.yml nav or no row in the page table in docs/api/README.md, or
when either one lists a docs/api page that has no routes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QCduCZnp6zXsBoSfy79Y7z

* Regenerate API docs for pull registry_unavailable error

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KsnZfUqJ2z9bTH2g2UK64K

* Pull docs: only the SSE error event reports registry_unavailable

Background download jobs (subscribe: false) still report a rate-limited
registry as a generic error, as on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KsnZfUqJ2z9bTH2g2UK64K

* Trim the main-merge port to the minimum the refactor requires

Drop the pull note rewording and the download event schema additions;
keep the registry_unavailable RouteError, which the route lint requires
for the 503 the pull route now writes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KsnZfUqJ2z9bTH2g2UK64K

* Check query args on Raw routes; fix alias regex backtracking; narrow 405 docs

- Raw routes now validate their query arguments against the schema, and a
  boolean query value must be "true" or "false". show_all=invalid and
  sync_id=12abc now answer 400 invalid_argument.
- ROUTE_ARG_ALIASES no longer backtracks exponentially (CodeQL #84); it
  matches the same text on every RouteArg in src/cpp.
- The 405 row names the prefixes that actually answer it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Leave missing-argument errors on Raw routes to their handlers

pull/variants and registry/search report a missing required query argument
with their own message, which clients and test_030 match on.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(docs): removed markdown sections by #3834

* test: align missing-model error with HTTP refactor

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Florian Reinle <[email protected]>
2026-10-22 11:51:42 +00:00
+20 9cfd620508 GUI3 into Main (#3834)
* feat(gui): introduce GUI3

Replace the legacy desktop interface with GUI3 while preserving the cleaned
pre-main-sync application, Tauri, packaging, and test state.

Co-authored-by: Alan Pope <[email protected]>
Co-authored-by: Andi M <[email protected]>
Co-authored-by: Andi Milhomme <[email protected]>
Co-authored-by: Andrew Vavilchenko <[email protected]>
Co-authored-by: Arun Babu Neelicattu <[email protected]>
Co-authored-by: Chris Kuethe <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Dennis Huang <[email protected]>
Co-authored-by: falabellamichael <[email protected]>
Co-authored-by: Florian Reinle <[email protected]>
Co-authored-by: George Sofianos <[email protected]>
Co-authored-by: GiAnG <[email protected]>
Co-authored-by: hogeheer <[email protected]>
Co-authored-by: Jeremy Fowers <[email protected]>
Co-authored-by: Ken VanDine <[email protected]>
Co-authored-by: Mario Limonciello <[email protected]>
Co-authored-by: Michele Balistreri <[email protected]>
Co-authored-by: Piotr Wilkin (ilintar) <[email protected]>
Co-authored-by: Ramakrishnan Sivakumar <[email protected]>
Co-authored-by: Salah Eddine Bekhouche <[email protected]>
Co-authored-by: Satya Devineni <[email protected]>
Co-authored-by: siavashhub <[email protected]>
Co-authored-by: Slawomir Nowaczyk <[email protected]>
Co-authored-by: Yiğit ERDOĞAN <[email protected]>
Copilot-Session: d80e6682-6cd6-4aa4-bc14-17d94dbe2c78

* chore(gui3): synchronize current main (#3532)

* fix(gui): restore Effective Settings (#3534)

* fix(gui): restore effective settings

Read the active backend launch command from the health payload and restore the GUI3 modal with explicit unavailable states.

Co-authored-by: Copilot App <[email protected]>

* fix(gui): harden effective settings refresh

Co-authored-by: Copilot App <[email protected]>

* fix(gui): enable backend args in effective settings

Co-authored-by: Copilot App <[email protected]>

---------

Co-authored-by: Copilot App <[email protected]>

* docs(gui3): add beta end-user guidance (#3599)

* docs(gui3): add beta user guide

Co-authored-by: Copilot App <[email protected]>

* docs: refine GUI3 local build guidance

Co-authored-by: Copilot App <[email protected]>

* docs(gui3): address beta guide review feedback

Co-authored-by: Copilot App <[email protected]>

* docs(gui3): remove duplicate browser build command

Co-authored-by: Copilot App <[email protected]>

---------

Co-authored-by: Copilot App <[email protected]>

* Sync latest main backend into GUI3 (#3648)

* chore(gui3): synchronize backend with main

Co-authored-by: Copilot App <[email protected]>

* build: include version helper for backend sync

Co-authored-by: Copilot App <[email protected]>

* build: preserve GUI3 tool definition path

Co-authored-by: Copilot App <[email protected]>

* chore(gui3): sync latest backend from main

Co-authored-by: Copilot App <[email protected]>

* Align shared workflows and docs with main

Co-authored-by: Copilot App <[email protected]>

* Align shared conflict files with main

Co-authored-by: Copilot App <[email protected]>

* Document GUI3 beta desktop build

Co-authored-by: Copilot App <[email protected]>

* Fix GUI3 shared CI checks

Co-authored-by: Copilot App <[email protected]>

* Add GUI3 app regression coverage

Co-authored-by: Copilot App <[email protected]>

* Fix FAQ whitespace for CI

Co-authored-by: Copilot App <[email protected]>

* Refresh GUI3 synchronization checks

Co-authored-by: Copilot App <[email protected]>

---------

Co-authored-by: Copilot App <[email protected]>

* web-app: serve the favicon and fix the critical CSS logo path

Loading the GUI3 web app from lemond logs two 404s:

    Error 404: GET /favicon.ico
    Error 404: GET /assets/logo.svg

Nothing in the web-app build references assets/favicon.ico, so it
never reaches resources/web-app and the /favicon.ico route has
nothing to serve.

EmitAppCssPlugin rewrites '../../assets/logo.svg' to 'logo.svg' in
app.css, but critical.generated.css is inlined into index.html by
HtmlWebpackPlugin without that rewrite. From the page root the
relative URL resolves to /assets/logo.svg.

Emit favicon.ico next to logo.svg, and apply the same rewrite to the
critical CSS. With both, /favicon.ico returns 200 (126745 bytes,
identical to src/app/assets/favicon.ico), index.html no longer
contains assets/logo.svg, and a browser load of the web app logs no
404s.

Fixes #3392

* fix(gui): use valid Windows app icon

* fix(gui): expire stale performance slot telemetry (#3672)

* fix(gui): preserve backend argument editing caret (#3683)

* docs: point GUI3 beta build instructions to GUI3_squashed

* 3193: rename to backend launch command and verify the re-target to /health works (#3761)

* Addresses 3055: loading/ selecting a model will take you to the chat window focusing the input text field automatically (#3758)

* Saving the per-chat selected model and warning a user on losing chat windows up on refresh (#3757)

* Saving the per chat model, thinking:off label and warning during chat reload

* PR feedback: per-chat model stays persistent on refresh

* Pr feedback: The deleted conversation shouldn't affect the loaded model

* Saving the per-chat selected model and warning a user on losing chat windows up on refresh (#3757) (#3793)

* Saving the per chat model, thinking:off label and warning during chat reload

* PR feedback: per-chat model stays persistent on refresh

* Pr feedback: The deleted conversation shouldn't affect the loaded model

* fix(gui): reuse registered models for remote downloads (#3809)

* fix(gui): icon overlap with chat + audio mode (#3794)

* fix(gui): show FLM throughput in the monitor (#3792)

Tested with #3791

* Saving the per-chat selected model and warning a user on losing chat windows up on refresh (#3757) (#3812)

* feat(gui): add Simplified Chinese localization (#3602)

* main into GUI3 squashed (#3814)

* without baseURL set the Tauri app crashes to reach the server (#3816)

* chore: pre-commit fix (#3818)

* chore: remove outdated beta-build workflow (#3823)

* feat(backends): label each backend with a tier and a format (#3706) (#3830)

* feat(backends): label each backend with a tier and a format

Every backend now declares a tier (core, community or experimental) and a
format (native, python or container) in its descriptor's new labels map.
/system-info reports both for each backend and support row, lemonade
backends shows them as columns, and the generated support matrix lists
them.

Experimental backends are gated: lemonade backends install prints a
disclaimer before it installs one for the first time, and the models of a
recipe whose only backends on this system are experimental stay out of
the model list until one of those backends is installed. ds4:rocm is the
only experimental backend today.



* refactor(backends): share the installed-state check and pass system info to the experimental gate



* refactor(backends): put tier and format in support rows, rename tiers to core/experimental/guest

- Each BackendSupport row names its BackendTier and BackendFormat right
  after the backend name, replacing the descriptor's labels map and
  test_backend_labels. Rows for one backend on different OSes can carry
  different labels; /system-info reports this OS's row.
- Tiers are core, experimental (maintainer-provided, not for production)
  and guest (published outside Lemonade's maintainers). ds4:rocm is guest.
- Drop the descriptor's experimental flag and the "(experimental)" display
  name suffixes. /system-info derives each recipe's experimental field
  from its default_backend's tier.
- The README support matrix marks experimental backends with a dagger and
  guest backends with a double dagger.
- Drop the CLI install disclaimer for non-core backends.
- Define tiers and formats once, in the Backend Tiers and Formats section
  of docs/api/lemonade.md, and link to it from the other docs.



* fix(system-info): mark a recipe experimental when its selected backend is experimental or guest



* revert(app): leave recipeNames.ts unchanged



---------

Co-authored-by: Jeremy Fowers <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

* docs: remove obsolete GUI3 and PR screenshots (#3824)

* refactor(gui): goodbye beta and update docs (#3827)

* fix(gui3): markdown code highlight (#3841)

* fix(gui3): remove highlight stub (#3849)

* fix(gui3): stopping a chat during a tool call left the conversation stuck (#3856)

* fix(gui3): font display error (#3863)

* fix(gui3): restore microphone dictation in Chat (#3854)

* fix(gui3): respect manual scrolling during generation (#3847)

* Fix(gui3): chat vision response empty, no error on full context (#3851)

* fix(gui3): The newest attached image is ignored during a tool call (#3867)

* ci: restore GUI3 Playwright tests and isolate test renderer (#3842)

* fix(gui): diagnostics on mermaid fail (#3864)

* fix(gui): remove dompurify stub proper debian (#3831)

* fix(gui3): stabilize throughput telemetry and eliminate graph artifacts (#3855)

* fix(gui): mtp draft companion (#3367)

* fix(gui): replace Recharts deps with native SVG monitor charts (#3833)

* fix(gui3): telemetry replay, which re-sent the recorded answer (#3874)

* feat(gui3): The default-model indicator renders an empty span (#3876)

* default model indicators are displaying empty spans

* pr feedback: clean the empty spans and tests

* pr feedback: removed stale code and fixed a font issue

* test(gui3): enable GUI runtime regressions in CI and fix uncovered issues (#3878)

* refactor(gui3): fix and rework testsuite

* fix(gui): runtime test errors

* fix(test): un-number tests

* fix(gui3-tests): Fixes the assertion bugs raised (#3883)

* Fixes assertion level bugs

* pr feedback: tightened the assertion check

* removed duplicate mock handlers

* fix(gui3): keep navigation accessible while scrolling (#3885)

* fix(debian): correct GUI3 license attribution and remove CI workarounds (#3877)

* fix(debian): correct GUI3 license attribution and remove CI workarounds

* fix(ci): update icon contract and avoid redundant HF checks

* fix(ci): select packaging PPA by release channel

* fix(gui): prevent duplicate connections and stale async cleanup (#3879)

* fix(gui3): remove mermaid (#3910)

* fix(gui3): remove mermaid

* fix(gui3): finalize removal of mermaid

* fix(gui3): detect stalled tool loops without round limits (#3909)

* fix(gui3): detect stalled tool loops without round limits

* fix(gui3): corrected granular toolLoopDetector

* fix(app): optimize tool loop detector

* chore(app): address GUI merge review feedback (#3919)

* chore(app): address GUI merge review feedback

* chore(app): finalize naming cleanup, focus ACCESSIBILITY.md and remove unused inference tests

* docs(app): reorganize App guide and update documentation checks (#3922)

* fix(gui3): correct license data (#3918)

* fix(gui3): correct license data

* fix(app): add licence link for 2nd model-viewer.min.js

* fix(app): deduplicate vendored model-viewer

* docs: swap README images for GUI3 versions (#3917)

* GUI3: final fix round (#3914)

* fix(gui3): fix(gui3): avoid persisting inline tool media

* fix(gui3): keep browser API keys session-only

* fix(gui3): restart backend downloads from manager

* fix(gui3): preserve inspect capture on normal HTTP errors

* fix(gui3): use release version for Tauri builds

* fix(gui3): avoid retrying unsafe requests on network errors

* ci(app): reuse existing server artifact for smoke tests (#3923)

* ci(app): reuse existing server artifact for smoke tests

* ci(app): fix manual server-smoke-test trigger to automatic

* Fix the news assets (#3927)

* Revert news assets and fix them once GUI3 gets merged (#3929)

---------

Co-authored-by: Kyle Poineal <[email protected]>
Co-authored-by: Alan Pope <[email protected]>
Co-authored-by: Andi M <[email protected]>
Co-authored-by: Andi Milhomme <[email protected]>
Co-authored-by: Andrew Vavilchenko <[email protected]>
Co-authored-by: Arun Babu Neelicattu <[email protected]>
Co-authored-by: Chris Kuethe <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Dennis Huang <[email protected]>
Co-authored-by: falabellamichael <[email protected]>
Co-authored-by: Florian Reinle <[email protected]>
Co-authored-by: George Sofianos <[email protected]>
Co-authored-by: GiAnG <[email protected]>
Co-authored-by: hogeheer <[email protected]>
Co-authored-by: Jeremy Fowers <[email protected]>
Co-authored-by: Ken VanDine <[email protected]>
Co-authored-by: Mario Limonciello <[email protected]>
Co-authored-by: Michele Balistreri <[email protected]>
Co-authored-by: Piotr Wilkin (ilintar) <[email protected]>
Co-authored-by: Ramakrishnan Sivakumar <[email protected]>
Co-authored-by: Salah Eddine Bekhouche <[email protected]>
Co-authored-by: siavashhub <[email protected]>
Co-authored-by: Slawomir Nowaczyk <[email protected]>
Co-authored-by: Yiğit ERDOĞAN <[email protected]>
Co-authored-by: Kyle Poineal <[email protected]>
Co-authored-by: Abir Deol <[email protected]>
Co-authored-by: Daniel Holanda <[email protected]>
Copilot-Session: d80e6682-6cd6-4aa4-bc14-17d94dbe2c78
2026-10-21 23:35:04 +00:00
Jeremy FowersandClaude Opus 5.5 dfe79a7b33 docs: add the server architecture spec (#3762)
* docs: add the server architecture spec

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): unpack multipart forms before ModelRoute resolves the model

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): require model on ModelRoute unless the route defaults to the loaded model

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): drop the startup shadow check in favor of per-folder registration order

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): keep WebSocketServer out of ServerContext since config changes replace it

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): declare each route's responses and request format

- RouteSpec::responses lists every format a route returns, with an inline JSON Schema and a recorded example for each; streaming is part of the format
- RequestFormat replaces the json_body and form_body flags
- Model name resolution is left to ModelManager

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): rename the server architecture spec to HTTP Server

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): fix four gaps found while implementing the HTTP server spec

- Require model on every ModelRoute; drop model_defaults_to_loaded, since the
  Router has rejected a missing model since multi-model support landed.
- Keep images/upscale on ApiRoute, since it runs its upscaler as a one-shot CLI.
- Add RouteSpec::experimental and a Partial support level so the existing docs
  badges survive generation.
- Shorten long strings and arrays in recorded examples, and redact the
  harness cache directory and home directory.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec the generated docs in main's API reference layout

Routes render as Parameters, Example request and Response format, with
Field Descriptions built from ordered_json response schemas. Summary tables
gain Modality and Status columns and keep hand-written rows.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Trim the spec's docs changes to what the layout requires

Keeps the ordered_json types, the modality and summary rules, and the new
route layout. Drops the field description rules, the tab label table and
the key order rule, and restores the original Complete Example, shown in
the new layout.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Revert spec edits the docs layout does not require

Restores the approved text everywhere except where it described the old
Response subsections and Schema tabs.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: let a route record several examples per response format (#3843)

RouteResponse keeps only the format and schema. A new RouteExample carries
each example's name, format, args and setup, and a setup ExampleStep either
runs another route's named example or sends an unpublished request.

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

* Spec a contract for route docs and lint it in the drift check

Each RouteSpec text field gets one job, URLs use only the /v1/ form, and
the drift check fails on the patterns that made the generated pages
repeat themselves. The generator documents a Quad route only at /v1/.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Contract: who-uses only when not obvious; arguments may state conditional requirements

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: close docs-generation gaps found reviewing the generated pages (#3848)

* Spec: close the docs-generation gaps found reviewing the generated pages

- Field Descriptions print a schema's own description, list each shape of a
  multi-shape format separately, and list shared schemas in full.
- The contract gains a row for schema-level descriptions.
- Each example runs against a freshly started lemond.
- Arrays of objects and data-keyed maps show their first 3 entries, and
  lemond's version is recorded as <version>.
- Examples built from lemond's own docs or route specs are recorded live.
- docs/api/README.md states how clients send the API keys.
- Drift Check fails on a shape with no example, an undescribed recorded
  field, a recorded JSON body over 100 lines, or a live example that loads
  a model.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Spec: drop live examples; recorded values may drift, only the shape must hold

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Spec: name RouteResponse::schema instead of an undefined 'schema'

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Spec: add a claim review step for route docs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

---------

Co-authored-by: Claude <[email protected]>

* Spec: drop validate_args, which no route needs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RrqRFa7Zrr517fcQb3ePKX

* Spec: show the first entry of arrays of objects and data-keyed maps

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0155DTqmffuXR2U3rhsFnb28

* Spec: a shape no recording machine can return names the reason in x-no-example

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: ModelRoute skips the load when validate() picked a loaded model

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: describe the routing decision inline instead of reading decision.schema.json

lemond never read decision.schema.json before; it is the routing engine's
frozen contract. Routes now describe the decision with a short inline
object that links to the router page, which links to the schema file.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: leave the web app's window.api mock out of WebUi's responsibilities

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: drop the routing-context and CPU-state lines the implementation no longer follows

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: give examples a description, and keep requests out of notes

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: give each example its own subsection

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: let an example's description cover a request shape only it uses

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: put the recorded status on the Response label

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: link the API pages instead of naming their paths

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: declare each route's errors so handlers and docs share one source (#3869)

* Spec: declare each route's errors as RouteError values

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: reword the status-code compatibility note

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: declare route errors without changing the wire

Replace the fail()/ErrorFormat draft with RouteError values that the existing
writers take in place of a status. Move status changes to Appendix B.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: sync the errors example with the implementation

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: address review of the route errors section

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: list the missing-model 400 only for a required model

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: keep the route errors edit minimal

Drop the argument-validation proposal from Appendix B and the mid-stream
error event from the worked example, which the error design does not need.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: say plainly why each error declaration exists

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: drop the RouteError struct comment

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: drop comments that restate names

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: describe the error writers without reference to the old signatures

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: rewrite the Errors section in the spec's own style

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: routes list their base class's error responses explicitly

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: name the missing-model error instead of its step number

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: link the API reference instead of naming its path

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: validate request arguments in ApiRoute::serve()

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: serve() removes undeclared nulls; MCP may read its own body

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: Drift Check flags base-class errors a route can't get

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: serve() renames aliases, and the name wins

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: validate nested values; describe invalid_argument by what it checks

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: check Form args and range/length/pattern keywords; Anthropic errors carry code

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: head each response shape with its title; drop the Field Descriptions label

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Spec: compatibility with v2026.42 and prior; Ollama argument reading (#3896)

Adds a Compatibility with v2026.42 and Prior subsection (public API, URL
prefixes, older names, empty bodies, Ollama clients), the RouteArg
drop_invalid flag, and the first-spelling-wins alias rule. Drops the
quad-prefix invariant from AGENTS.md, since the compatibility section now
covers which prefixes are served, and renumbers the disconnect invariant.


Claude-Session: https://claude.ai/code/session_014JszCEzPFtJywaaGgq7rFu

Co-authored-by: Claude <[email protected]>

* Spec: drop drop_invalid; Lemonade extensions on Ollama routes are checked like any other argument

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014JszCEzPFtJywaaGgq7rFu

* Spec: the alias rule only drops an empty spelling; trim the Ollama clients bullet

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014JszCEzPFtJywaaGgq7rFu

* Apply suggestion from @jeremyfowers

* Apply batched suggestions from code review

Co-authored-by: Jeremy Fowers <[email protected]>

* Spec: name each route argument by its RouteArg constant

Brings the spec changes from #3888, which merged into
jfowers/http-server-refactor, onto the spec branch so that every
spec change lives in the spec PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QCduCZnp6zXsBoSfy79Y7z

* Spec: drift check fails an API page missing from the nav or the API reference table

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QCduCZnp6zXsBoSfy79Y7z

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-21 22:26:56 +00:00
Jeremy FowersandClaude Opus 5.5 f72b610b4b ci: publish news posts to the website as soon as they merge (#3884)
* ci: publish news posts to the website as soon as they merge

A new Publish News workflow runs when docs/news/ or docs/assets/news-data.js
changes on main. It copies onto the website branch every change from a commit
that touched only those files. Commits that also touched anything else, and
files that already carry such an unreleased change on main, wait for the
release as before.

The release publish now merges website before pushing if a news publish
landed during its run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KbvBqHTB6BqACNbNKMiArE

* Rewrite publish_news.py docstring in plain terms

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KbvBqHTB6BqACNbNKMiArE

* Explain the skipped-file rule in publish_news.py with an example

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KbvBqHTB6BqACNbNKMiArE

* Require news changes in their own PR and publish news by copying from main

Replaces the per-commit publish script: with mixed PRs rejected by CI, every
news change on main is safe to publish, so the workflow copies the news files
from main onto website.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KbvBqHTB6BqACNbNKMiArE

* Keep releases from rolling back news, fetch main explicitly

The release publish merges an older release branch into website with
-X theirs, which could revert news-data.js and drop posts that merged to
main after the cut. Re-sync news from main after that merge.

Also fetch main and website into explicit remote-tracking refs in
publish-news so origin/main is always populated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AARBRh8ah1voyghma7tM2t

* Document holding news posts until their feature is released

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AARBRh8ah1voyghma7tM2t

* Say why news waits for the release

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AARBRh8ah1voyghma7tM2t

* Reword the news timing rule

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AARBRh8ah1voyghma7tM2t

* Remove repeated news timing wording

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AARBRh8ah1voyghma7tM2t

---------

Co-authored-by: Claude <[email protected]>
2026-10-19 20:35:48 +00:00
Sreeram 1ba79d48ff Restore sdcpp rocm support on Windows (#3718)
* Restore sdcpp rocm support on Windows

* llamacpp GPU assertion checks from 3717

* Shared helper, sd-cpp device line updated, CPU fallback fails the job rather than a warn

* llamacpp clearer labels + a [WARN] matching sdcpp, run-page link + pointer

* Reformat sdcpp validation table

* Get internal linkage through static instead of namesspace

* Move CI cache dir to C:\ci-lem-cache to prevent failure

* CI + Product side fix

* Update the max allowed cache dir value to 67

* Calculation of max allowed cache dir length updated to be independent of ROCm install layout

* Stop CI from being stricter than product

* Addressing CodeRabbitAI's review

* Remove leftover therock-wheels folder

* Resolving Krishna's comments

* Fix ROCm path guard failing open and llama.cpp CI cache teardown order

* Harden GPU offload gate and ROCm HIP runtime staging

* Fix UNC long-path prefix and make the rocBLAS depth marker write atomic
2026-10-19 07:34:09 +00:00
QuTosh 6e27237439 Add conformance tests (phase 2: model-backed) (#2865)
* Added infra for semantics conformance tests

* Modifide conformance tests code

* Minor fix and comment in conformance tests engine

* Added l0a cases to conformance tests

* Added l2 corupus to conformabnce tests

* Added l3 corpus to conformance tests

* Added point band test to l3 corpus to conformance tests

* Added explicit rule to default model case to l1 corpus in conformance tests

* Immporved classfiers ids consistencey in conformance tests

* Removed trace reporting block from conformance tests runner

* Modified conformance tests runner -- now it compiles engine per case

* Updated conformance tests documentation

* Add case for locking regex dialect to ECMAScript in conformance tests

* Added implicit labels cases for l0a and l2 in conformance tests

* Reject conformance test rows with unknown keys

* Added request mapping and leaf order cases to conformance tests

* Merged duplicate l0a router policy dirs in conformance tests

* Fixed inaccurate claims in conformance tests documentation

* test(conformance): make a null embed fail explicitly instead of via an empty vector

* test(conformance): make a null embed fail explicitly instead of via an empty vector

* drop within-tolerance score deltas from mismatch report in conformance tests

* scope score tolerance to semantic_similarity scores only in conformance tests

* share one score-tolerance predicate between matcher and reporter in conformance tests

* Tidied conformance tests runner

* Modified FakeClassifierService to record unexpeced calls

* Removed stale comment in fake_classifier_serivices.h

* Updated policy json parsing and building in comformance tests

* Fail a structurally bad policy once up front in conformance tests

* Add self-test for row guards in conformance tests

* Consolided some policies in conformance tests

* Further consolidated conformance tests

* Removed redundant cases in conformance tests

* Further consoldation of conformance tests

* Added stray file detection and non-string guard in confrmance tests

* Merged polices within tiers

* Compact policies.json formatting in routing conformance tiers

* test(conformance): reject separators in corpus case names, label cases with ::

* Removed redundant paragrapsh for conformance corpus readme

* minor formatting cahnge in conformnce test harness

* test(conformance): compare decisions against an explicit field list

* test(conformance): explicit scores for dfferent fields

* test(conformance): apply the score tolerance to every trace score

* test(conformance): move the decision comparison to its own header

* docs(conformance): rewrote conformance tests readme

* Merged l1_conditions_total_char_bounds into l1 tier tests

* test(conformance): Comments fix in testing harness

* test(conformance): use the shared unknown-service check in the corpus runner

* test: continue past per-case policy build failures in conformance corpus

* test(conformance): fail a case that declares a stub it never calls

* test(conformance): reject a policy name declared twice in policies.json

* test(conformance): rename harness headers and self-test for clarity

* test(conformance): lock label precedence, max-only bands, raw equals, json fences and phrase embed failures

* test(conformance): call the tier directory a tier, not a band

* test(conformance): reject a duplicate object key anywhere in a corpus file

* Added check for only README.md file in conformance corupus check

* test(conformance): drop the schema-invalid metadata case from the corpus

* test(conformance): apply the score margin only to computed scores

* test(conformance): fail a row that mistypes a request field

* test(conformance): require the expected tier set for each schema version

* test(conformance): report a non-string trace condition as a mismatch

* test(conformance): make the fake classifier services thread-safe

* test(conformance): stop freezing key order inside multi-key leaves
2026-10-15 14:54:51 +00:00
Michele Balistreri e6c164ab65 mark TheNoise as Core (#3826) 2026-10-14 02:41:34 +00:00
Jeremy FowersandClaude Opus 5.5 65b0518a67 feat(backends): label each backend with a tier and a format (#3706)
* feat(backends): label each backend with a tier and a format

Every backend now declares a tier (core, community or experimental) and a
format (native, python or container) in its descriptor's new labels map.
/system-info reports both for each backend and support row, lemonade
backends shows them as columns, and the generated support matrix lists
them.

Experimental backends are gated: lemonade backends install prints a
disclaimer before it installs one for the first time, and the models of a
recipe whose only backends on this system are experimental stay out of
the model list until one of those backends is installed. ds4:rocm is the
only experimental backend today.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* refactor(backends): share the installed-state check and pass system info to the experimental gate

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* refactor(backends): put tier and format in support rows, rename tiers to core/experimental/guest

- Each BackendSupport row names its BackendTier and BackendFormat right
  after the backend name, replacing the descriptor's labels map and
  test_backend_labels. Rows for one backend on different OSes can carry
  different labels; /system-info reports this OS's row.
- Tiers are core, experimental (maintainer-provided, not for production)
  and guest (published outside Lemonade's maintainers). ds4:rocm is guest.
- Drop the descriptor's experimental flag and the "(experimental)" display
  name suffixes. /system-info derives each recipe's experimental field
  from its default_backend's tier.
- The README support matrix marks experimental backends with a dagger and
  guest backends with a double dagger.
- Drop the CLI install disclaimer for non-core backends.
- Define tiers and formats once, in the Backend Tiers and Formats section
  of docs/api/lemonade.md, and link to it from the other docs.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(system-info): mark a recipe experimental when its selected backend is experimental or guest

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* revert(app): leave recipeNames.ts unchanged

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-13 13:55:15 +00:00
Jeremy FowersandClaude Opus 5.5 0c8169f5bf refactor(server): run backend servers through ServerProcess and NativeProcess (#3705)
* refactor(server): run backend servers through ServerProcess and NativeProcess

WrappedServer now owns one ServerProcess while a model is loaded, in place
of a raw process handle and a separately recorded launch command. Each
backend describes what to run in a ServerCommand and hands it to
start_server(), which starts the process, polls its ready endpoint at the
address the process reports, and starts the watchdog. Unload, the
watchdog and a failed or cancelled load all end the server through
stop_server() or ServerProcess::stop().

NativeProcess is the only ServerProcess so far and starts the binary
through ProcessManager exactly as each backend did before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* refactor(server): tighten ServerProcess ownership and error paths

- ServerProcess stops its server on destruction; start_server stops a
  replaced process outside the lock
- OpenMOSS voice design runs through NativeProcess
- FLM and ORT skip troubleshooting output when a load was cancelled
- /metrics scrapes the backend at the host it reports

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* refactor(server): reuse URL helpers and trim leftovers from the ServerProcess move

- /metrics parses backend URLs with utils::parse_target_url; base URLs
  bracket IPv6 hosts
- OpenMOSS voice design connects to the host its process reports and calls
  stop_server() directly
- vLLM skips the CWSR hint when a load was cancelled
- Drop the redundant stop in start_server, unused process_manager.h
  includes, and comments that restate the code

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* refactor(server): give WrappedServer a default unload() and drop per-backend leftovers

unload() now defaults to stop_server(), and ~WrappedServer() stops the
server, so backends whose unload() and destructor only did that drop them.
The overrides that remain do real cleanup: vLLM's shim directory, OpenMoss's
request lock, Cloud's state and whisper.cpp's temp directory.

The ready log moves into wait_for_ready() with the server's base URL,
replacing the per-backend "Model loaded on port" and "Server is ready" lines.

RyzenAI reads its model path from model_info in load() instead of storing it
through set_model_path(), and drops is_loaded_ and a model_name_ that shadowed
the base member. Router destroys a server after unload(), so member resets in
unload() (Moonshine, TheNoise, vLLM, OpenMoss, FLM) are removed.

Comments in server_process.h, wrapped_server.cpp and test_launch_command.cpp
now state specific contracts instead of restating names.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: describe starting backends through start_server() and the default unload()

adding-a-backend.md gains a "Starting the server process" section with a
ServerCommand/start_server() example and the per-backend settings, and says
unload() is optional. The OpenMOSS notes in backends-reference.md now name
start_server(), the local NativeProcess designer and server_command() in place
of the removed stop_speech_process() and spawn(). AGENTS.md drops unload()
from the methods every backend implements.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: leave AGENTS.md unchanged

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-08 20:21:38 +00:00
Jeremy FowersandClaude Opus 5.5 b83cc1b55d docs: add the container backends spec (#3697)
* docs: add the container backends spec, covering the fundamentals and lemond started by the user

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: drop the fixed backend count from the container backends spec summary

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: drop the phase 1 framing from the container backends spec scope

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: drop the future work list from the container backends spec

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: link the container image source accounts

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: rename ContainerPolicy.repository to image

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: say Podman runs as the account that runs lemond, rootless or rootful

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: relabel model mounts with :z instead of disabling SELinux

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: drop memlock_unlimited from the container backends spec

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: render the ServerProcess step lists as HTML lists

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: drop ipc_host from the container backends spec

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: add an SELinux check for /dev/kfd mapping

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: replace the Halogen 7.0 kernel floor with the KFD SVM and CWSR checks

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: Halogen serves /health

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: note DS4 runs without AI Cockpit's --ipc=host

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: add PPA and .deb setup to the container backends spec

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: run rootless Podman in lemond.service instead of a separate socket service

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* docs: rename the Debian packages section and make podman a Recommends

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* docs: describe lemond.service's Podman config in the present tense

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* docs: fold .rpm into a system-service section and drop the Arch section

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* docs: title-case the system-service heading and fold .rpm into per-variant sub-bullets

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* docs: make the package-does steps a per-format table

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* docs: mount the model from its snapshots path, not a blob

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* docs: group the spec pages under a Specs nav section

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: allocate the lemonade sub-UID range in the install scripts, past existing ranges

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: mount a model directory one file at a time, resolved through symlinks

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: relax lemond-user.service for rootless Podman, and keep the system unit's other protections

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-06 20:01:06 +00:00
Ramakrishnan SivakumarandClaude Opus 5.5 886d0cd585 fix(tray): make --spawn-server a no-op on macOS (#3756)
* docs: document lemonade-tray CLI flags in the configuration guide

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(tray): make --spawn-server a no-op on macOS

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-10-06 16:38:51 +00:00
Jeremy Fowers 4ddca6d130 Change evaluation date for AI content policy (#3760)
Per a vote of the maintainers we will keep the existing policy for 30 more days, and then re-evaluate.
2026-10-05 13:45:33 +00:00
ff3b1ce13b docs(models): specify extra_models_dir behavior in the custom model guide (#3633)
* docs(models): specify extra_models_dir behavior in the custom model guide

The behavior was specified in src/cpp/Extra-Models-Dir-Spec.md, which was not
published, had drifted from the code, and documented a --extra-models-dir flag
that no longer exists. Its content becomes an "Imported models" section of the
custom model guide, and the file is deleted.

Naming is one subsection: a rules table, an examples table with one row per
interpretation, and a list of notes. Every example was run against a live
server. One inherited example row was wrong, pairing a one-file-per-folder
layout with the outcome of a two-file layout, and another documented an id that
kept its .gguf extension. This is the spec the C++ changes above it in the
stack are written against, so two of its rows describe behavior that lands
later in the stack.

The FAQ, configuration reference, and embeddable guide now point here. The
embeddable guide had restated six naming rules, which is worse than a pointer
because a partial copy reads complete. llama.cpp cache paths are dropped, since
llama.cpp downloads into the Hugging Face cache as of b8498.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs(models): split extra_models_dir naming rules by cache layout

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Apply batched suggestions from Florian

Co-authored-by: fl0rianr <[email protected]>

* Update docs/guide/configuration/custom-models.md

Co-authored-by: Andi Milhomme <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: fl0rianr <[email protected]>
Co-authored-by: Andi Milhomme <[email protected]>
2026-10-02 16:48:44 +00:00
Michele Balistreri 40827a33c9 Add Windows support for TheNoise (#3666)
* add windows support

* launch python.exe instead of thenoise.bat

* bump version

* add split zip support
2026-09-30 17:42:58 +00:00
Jeremy FowersandClaude Opus 5.5 6f8e87bbec docs: add a spec writing guide under docs/dev/specs (#3687)
* docs: add a spec writing guide under docs/dev/specs and link it from the RFC process

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Clarify specification requirements in RFC template

Updated the RFC template to clarify specification requirements.

* Revise spec writing guide for clarity and precision

Revised the spec writing guide to enhance clarity and precision in the documentation process. Updated rules for structure, precision, and content to better align with reviewer expectations.

* Fixes for Mario's feedback

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-29 22:26:05 +00:00
Arun Babu Neelicattu e9d0fc365a fix(server): abort non-streaming requests on client disconnect (#2898)
Client drops during non-streaming inference left the backend computing
the abandoned request to completion, holding the slot for other clients.
The connection-liveness checker now propagates through the request scope
so the upstream transfer aborts promptly.

The documented guarantee covers the OpenAI non-streaming endpoints only;
the Anthropic/Ollama/MCP gateways and streaming Omni are excluded and
remain future work. The C++ regression suite covers the abort via a
mock backend.
2026-09-28 19:01:36 +00:00
Jeremy FowersandClaude Opus 5.5 6a20ea9b9d docs: link website-only pages to the website, revert marketplace link rewriting (#3667)
* docs: link website-only pages (models, marketplace) to the website

The model browser and marketplace exist only on lemonade-server.ai; their
in-repo sources (server_models.json, the marketplace repo) aren't browsable.
Document the exception in the link policy.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: revert marketplace README link rewriting

The script only runs on the website branch, whose README is not published,
and apps.json already carries working guide URLs. The GAIA override and the
fallback also masked marketplace data instead of letting it be fixed there.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Update link text for model catalog in README

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-25 22:20:00 +00:00
Copilotandsuperm1 6deeb05f77 Default release.py to unsigned tags (#3660)
* Initial plan

* Default release tags to unsigned

Co-authored-by: superm1 <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: superm1 <[email protected]>
2026-09-24 19:04:10 +00:00
Ramakrishnan Sivakumar a1966988b8 Fix repository documentation links and published docs paths (#3665)
* docs: keep repository documentation links on GitHub

* docs: refresh stale integration links and stabilize GAIA destination

* docs: correct published documentation paths

* docs: restore documentation guide reference links

* docs: remove trailing whitespace from FAQ
2026-09-24 00:34:44 +00:00
Arun Babu Neelicattu 3b5ec50e55 feat(tray): add --spawn-server to natively supervise a local lemond (#3304)
* refactor(tray): return std::optional from fetch_server_state

* feat(tray): add --spawn-server to natively supervise a local lemond

Lets lemonade-tray spawn and supervise a local lemond when none is
running. POSIX uses posix_spawn (avoiding macOS fork() crashes from
inherited ggml-metal state) plus a pipe-EOF watchdog: the tray passes
--watchdog-fd <FD> to the child and keeps the pipe write end, so when
the tray exits for any reason the OS closes it and lemond shuts itself
down, leaving no orphan. The write end is closed in the child so its
blocking read sees EOF.

Supervised mode only fires when the server is unreachable; otherwise the
tray keeps its existing client-only behavior. On a dead server it runs a
POSIX refresh thread that recovers the menu and notifies when the server
comes back, and handles SIGINT/SIGTERM via an async-signal-safe flag
instead of std::exit. Adds --launch-app/--open and wires the watchdog
contract into test/ and CI.
2026-09-23 16:37:40 +00:00