Commit Graph
45 Commits
Author SHA1 Message Date
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
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
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
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
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
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
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
d5f154a7ce Remove sd-cpp ROCm support on Windows (#3616)
* Remove sd-cpp ROCm support on Windows

On Windows the sd-cpp ROCm build delivers no GPU acceleration at all: it
runs at CPU speed, and on one test it is twice as slow as CPU. Measured on
release-v2026.39 CI (run 35124275540), per test, cpu / rocm / vulkan
seconds, all three passes on one runner in a single job:

  test_004_image_generation_with_steps      2.9 / 3.0  / 0.4
  test_005_image_generation_with_cfg_scale  4.0 / 4.1  / 0.6
  test_006_image_generation_with_seed       2.9 / 3.0  / 0.5
  test_020_upscale_basic                   39.8 / 39.9 / 0.7
  test_015_image_edit_basic                 5.7 / 11.7 / 0.9

Linux is unaffected and keeps ROCm: the same tests there show ROCm running
5-6x faster than CPU (test_004 2.3 -> 0.4, test_020 32.3 -> 6.2).

The failure is silent, which is why it survived. The Windows ROCm pass
reports "ROCm (TheRock) runtime ready for sd-cpp:rocm", passes all 22
tests and exits OK, so nothing in CI flags it and a Windows user selecting
ROCm for image generation gets CPU-speed inference with no indication.

Narrow the rocm support row to Linux in the descriptor, which is the
single source of truth for the generated support matrices and docs. Drop
the now-unreachable Windows ROCm asset filename, and the rocm pass from
the Windows stable-diffusion CI job.

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

* ci: remove ROCm validation leg after Windows ROCm support removal

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Mario Limonciello (AMD) <[email protected]>
2026-09-20 17:31:19 +00:00
Jeremy FowersandClaude e5d0eecb1f Remove OpenMOSS ROCm support on all operating systems (#3615)
The OpenMOSS ROCm build generates audio roughly 40x slower than its Vulkan
build on identical hardware. Measured on release-v2026.39 CI (run
35124275540) with server_audio_generation.py, which asks for a 3-second
clip at 4 diffusion steps:

  Windows  vulkan  9.6s   rocm  390.4s   (41x)
  Linux    vulkan  8.2s   rocm  360.6s   (44x)

The same test file, same payload and the same TheRock runtime on the same
runners give thinksound 1.6-2.6s and acestep 1.0-1.1s per generation on
ROCm, so the regression is specific to the OpenMOSS binary rather than the
harness, the runner or the ROCm runtime.

Drop the rocm support row from the descriptor, which is the single source
of truth: the generated support matrices, config defaults and docs follow
from it. Also drop the now-unreachable rocm install variant and TheRock
loader-path branch, the rocm version pin and asset checksums, and the rocm
pass from the openmoss CI jobs.

This removes ROCm for OpenMOSS TTS as well as audio generation, because
BackendDescriptor::support is a flat list with no per-mode granularity.
TTS on ROCm measured healthy in the same run (voice design 20.8s vs 43.8s
on Vulkan), so that coverage is lost with this change.


Claude-Session: https://claude.ai/code/session_01QY95EN9FjNYMyStH3idZZB

Co-authored-by: Claude <[email protected]>
2026-09-17 17:37:11 +00:00
Michele Balistreri 378622dcce implement /images/edit in TheNoise (#3494)
* add editing support for thenoise

* small fixes

* bump version

* list all supported targets

* update docs

* bump version
2026-09-14 20:13:29 +00:00
Satya Devineni 8b5a23b527 fix(server): stop erasing llama.cpp slots on soft-idle downsize #2961 (#3565)
* removing the llamacpp downsize override to retain the saved cache

* PR feedback: Removing the test script
2026-09-14 05:03:30 +00:00
Aaron St George 7953d7f62c feat(backends): hrx backend [experimental] (#3374)
* feat(backends): hrx backend [experimental]

* Gen docs

* Ensure runtime arguments contain `--parallel 1`

* `hrx` -> `llamacpp-hrx`

* Remove exact gguf check

* Limit to only chat capabilities
2026-08-28 21:05:56 +00:00
e1b3168370 feat(backends): ds4 (DwarfStar) backend for DeepSeek V4 Flash [experimental] (#3047)
* feat(backends): ds4 (DwarfStar) backend prototype — DeepSeek V4 via antirez/ds4

Wraps ds4-server as a subprocess backend (recipe "ds4"). System-binary
variant only: the locally built ds4-server is discovered on PATH; no
managed install or version pin. Forwards chat/completions/responses to
ds4's OpenAI-compatible API; readiness and watchdog probe /v1/models
(ds4 binds its port only after the model is fully loaded).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WN5Fu4iqUq123fFSubw34x

* docs(ds4): regenerate backend boilerplate for the ds4 recipe

Adds ds4 to defaults.json, the README support matrix (rendered as
'ds4 (experimental)'), the backends reference, and the recipe-values lists.
Generated with docs/tools/gen_backend_boilerplate.py against a lemond built
from this branch.

* feat(ds4): managed ROCm install from lemonade-sdk/ds4-rocm

Users no longer have to build ds4 themselves. get_install_params() now resolves
the release asset for the detected GPU arch, and load() installs and runs it;
the 'system' variant remains for a locally built ds4-server on PATH.

Upstream ds4 publishes no binaries, releases or tags, so the artifacts come from
lemonade-sdk/ds4-rocm, which builds a pinned upstream commit and bundles the
ROCm runtime. Release identity is that repo's own bNNNN build number.

Verified on Strix Halo with ds4-server removed from PATH, so the system fallback
could not be used: lemonade downloaded b0001, ran it from the managed location,
and matched a hand-built binary (decode 16.0-16.6 t/s, prompt processing
218 t/s). Chat, tool calling and unload all clean.

* fix(ds4): mark DeepSeek-V4-Flash-DS4 as suggested

It is the only model for the ds4 recipe, so suggested=false left the
'DS4 DwarfStar (experimental)' group in the Model Manager expanding to nothing
and the model absent from search results — users had no way to find it in the
UI. Other experimental backends (thenoise, vllm) mark their models suggested.

* test(ds4): cover install-param resolution and arch gating

get_install_params builds the release asset name from the pinned tag plus the
detected ISA, so a wrong arch or a family collapse would resolve an asset that
does not exist. Pins the filename format, the system/unsupported throw paths,
and that rocm stays gated to gfx1151.

* refactor(ds4): drop the system backend variant

The system variant ran whatever ds4-server happened to be on PATH: no version,
no install action, and an entry that appeared or vanished with the environment.
Now that rocm binaries are published and pinned, it only added an unversioned
way to run an unknown build.

rocm is the sole variant, so load() always installs and runs the pinned binary.

* fix(ds4): use the bundled ROCm runtime, and reserve managed args

Two issues from review:

The managed bundle ships its ROCm runtime next to ds4-server, which has no
RPATH, but the wrapper started it without pointing the loader at that
directory. Verified: the child resolved libamdhip64/libhipblaslt from
/usr/lib, so it only worked because this host has ROCm installed, and would
have failed on the clean hosts the bundle exists for. It now prepends the
binary's directory to LD_LIBRARY_PATH, matching kokoro/thinksound/trellis. The
child now maps liborigami.so.1 from the bundle — a library system ROCm does not
ship, so it proves the bundled runtime is in use.

ds4 parses arguments left-to-right, so ds4_args appended after Lemonade's own
flags could override them: --port breaks readiness and proxying, --host exposes
the backend, -m desynchronises the router's model state. Now validated against
reserved flags via the existing validate_custom_args() helper, as llama.cpp
does.

Also drops a descriptor comment that still described the removed PATH lookup.

* fix(ds4): reserve backend-selection args, drop selectable_backend

ds4-server accepts --backend/--cpu/--metal/--rocm, so ds4_args could run the
child on a different device than the one Lemonade tracks as loaded — the same
state mismatch the model/host/port reservations prevent. Those flags are now
reserved too, and the set lives in the descriptor header so it is testable.

selectable_backend was creating a 'backend' config key while no CLI option was
declared for it. rocm is the only published variant, so the flag is now false
and load() uses rocm directly; the key disappears from defaults.json.

Extends the unit test to cover both review fixes: every managed and
backend-selection argument is rejected, unmanaged ones still pass through.

* fix(ds4): refuse to resolve an asset for an unpublished architecture

get_install_params() built the release filename straight from
SystemInfo::get_rocm_arch(), so a gfx1150 host would compose
ds4-<tag>-linux-rocm-gfx1150-x64.tar.gz and proceed toward an asset that does
not exist. Model filtering normally keeps unsupported hosts away, but the
install path cannot assume it ran — and dropping validate_backend_choice() with
selectable_backend removed the other guard.

Now checks the detected architecture against the descriptor's support matrix
via SystemInfo::backend_supports_arch, and fails with the architecture named.

* Update src/cpp/resources/server_models.json

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

* Update docs/assets/models.js

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

* fix(system-info): count the iGPU carveout as physical memory on Linux

/proc/meminfo MemTotal excludes the firmware-reserved iGPU carveout, which
on a unified-memory APU is ordinary system DRAM. A 128 GB Strix Halo with a
64 GB carveout reported ~61 GB, capping model filtering at 64 GB and hiding
models that fit. Windows already reports installed capacity for this reason.

Discrete VRAM is separate silicon and is deliberately not counted.

* fix(ds4): reject unsupported OSes before resolving an asset

backend_supports_arch() validates device constraints and arch gates but not the
support row's supported_os, and the direct backend-install endpoint does not go
through model filtering. A Windows gfx1151 host would therefore pass the arch
check and resolve the Linux-only asset.

Checks the current OS against the descriptor's support row, via a
publishes_for_os() helper so the rule stays testable without faking the OS.

* fix(ds4): default to SSD streaming so DeepSeek V4 Flash loads

ds4-server defaults to full residency, mapping the entire 81 GB MoE into
the ROCm arena. On the only supported device (gfx1151, <=64 GB carveout)
the usable arena tops out around 48 GiB, so the load OOMs mid-map at
tensor-span 108. Pass --ssd-streaming so experts stream from disk; a
user-supplied ds4_args flag still wins since ds4-server parses
left-to-right.

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

* ds4: adopt working-set memory filter, drop carveout hack

Now that the streaming-backend working-set filter is on main (#3328), ds4
uses it instead of the reverted physical-memory carveout change:

- remove get_igpu_carveout_gb / the get_physical_memory change (system_info
  back to main's version) — superm1's ROCm accounting objection
- set streams_model_from_storage on the ds4 descriptor
- declare min_resident_gb: 16 on the ds4 model (streaming working-set floor)
- add the explicit "chat" deployment-mode label the merged registry now
  requires (feat(models) #3099)

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

* fix(test): gate ds4 install-param assertions on the host OS

get_install_params() rejects the host OS before it inspects the
architecture, so the asset-resolution assertions aborted the test on
macOS. Assert the refusal there instead, reading the host OS from the
same get_current_os() the backend uses.

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

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Jeremy Fowers <[email protected]>
Co-authored-by: github-actions[bot] <gh@actions>
Co-authored-by: jeremyfowers <[email protected]>
2026-08-26 14:04:00 +00:00
Piotr Wilkin (ilintar)andFlorian Reinle 2a650c7fef Feat/openmoss 0.3.0 backport/server side (#2863)
* feat(openmoss): bump the engine to 0.2.0, fold voice design into the speech model

MOSS-VoiceGen stops being a standalone registry entry. The voice generator ships
as a component of the speech model, and the backend now drives the cascade the
GUI used to drive by hand: it takes the speech model down, brings the voice
generator up to render one reference sample, tears it down, and brings the
speech model back. Only one model is resident at a time, so any card that can
run the speech model can also design a voice for it, and the sample is cached
per description. Design polls the child process rather than only /health, so a
subprocess that dies during load reports its exit status instead of hanging.

Voice design is opt-in through the `voice_design_description` extension only.
`voice` keeps its OpenAI-compatible meaning and is forwarded as an instruction,
so a client sending "voice": "default" gets speech instead of an invented voice
by that name.

Also adds MOSS-TTS-Local and MOSS-SoundEffect, the latter an audio-generation
model on the openmoss recipe, declares the .extras.gguf sidecars as checkpoint
roles, surfaces model-declared `speech_defaults`/`audio_defaults` through
/v1/models, and answers 400 rather than 500 on wrong-typed audio request fields.

* fix(gui2): drive OpenMOSS voice design from the backend cascade

The speech panel no longer switches to MOSS-VoiceGen and back to synthesize a
reference: it sends the description as `voice_design_description` and lets the
backend sequence the two stages. The panels seed their controls from the model's
declared `speech_defaults` / `audio_defaults` instead of generic numbers, and
the sound-effect path draws a real seed, since OpenMOSS SFX seeds are unsigned
and have no random sentinel.

* feat(backends): declare per-request generation parameters in the descriptor

Backends already declare their load-time options, and clients render model
configuration from that declaration instead of a per-recipe table. Request-time
generation parameters had no equivalent, so a client wanting to offer sigma
shift or a sampling temperature had to recognise the backend by recipe name and
carry a hard-coded parameter list.

`generation_params` closes that gap, one entry per (mode, request field), keyed
by deployment mode in `/v1/system-info`. An entry carries what a control needs
to exist -- label, type, bounds, default, help -- plus two hints that a plain
scalar cannot express: `exclusive_group` for alternatives a client offers a
choice between, and a nullable `random_sentinel` for seeds, so a backend whose
seed is unsigned says so instead of the client knowing.

Declared for openmoss, acestep, thinksound and kokoro. Model-level
speech_defaults / audio_defaults keep overriding the recipe-level defaults.
BackendModeContractTest checks the declarations, and the backends reference
grows a generated section so a new parameter cannot reach clients undocumented.

* fix(kokoro): declare the OpenAI-compatible fallback voice

The composer fell back to an OpenAI voice name for every TTS recipe except one
it recognised by name. Declaring the same name as kokoro's `voice` default
keeps that behaviour and lets clients drop the exception: a recipe that wants a
default voice now says so, and one whose `voice` is an optional instruction
simply declares none.

* fix(openmoss): address concurrency and generation metadata review

* bump to v0.3 and make some fixes

* fix round 2 accoding self review

* audio panel fixes

* refactor again and rework last commit

* final review adaptions

* fix some remaining issues

* reduce the scope

* adress review comments

---------

Co-authored-by: Florian Reinle <[email protected]>
2026-08-26 08:29:42 +00:00
Michele Balistreri 5b41beee89 Add TheNoise-based upscalers (#3327)
* update thenoise version

* add support for thenoise in the upscaler endpoint

* bump version and better model names

* update documentation

* remove upscale_factor

* notice about backend selection
2026-08-25 17:54:11 +00:00
Michele Balistreri 677da98a53 update TheNoise v0.2.1 (#3171)
* update thenoise

* address review comments
2026-08-16 16:56:58 +00:00
Jeremy FowersandClaude Opus 5 0f7bd30799 docs(backends): drop the model catalog tables from the backend reference (#3103)
The `## Models` section duplicated `server_models.json` as ~285 lines of
markdown tables (58% of the file) that nothing links to. The user-facing
catalog at lemonade-server.ai/models.html fetches `server_models.json` live
from GitHub raw at the release tag, so it never read these tables.

Every model-catalog PR had to rebuild lemond in the `backend-docs-drift` job
and regenerate the doc, or fail CI — #2495 was a PR whose entire content was
three table rows added to fix that failure.

Removes the section, `render_models`, the now-unused `SERVER_MODELS` constant,
and the `backend-models` marker region from the template. The descriptor-backed
regions (overview, support matrix, recipe options) are unchanged; those are
derived from C++ and genuinely need the drift check.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-13 03:34:55 +00:00
Ramakrishnan SivakumarandClaude Opus 5 4f67eb5fc3 feat(models): add Muse Glimmer 30B to the model catalog (#3090)
* feat(models): add Muse Glimmer 30B to the model catalog

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

* feat(models): enable DFlash draft decoding for Muse Glimmer

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

* fix(models): correct Muse Glimmer size to GiB

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

* docs: regenerate backends reference for Muse Glimmer

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

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-12 21:08:33 +00:00
f8423451c3 feat(rocm): enable AMD Instinct MI100 (gfx908) and MI200 (gfx90a) in llama.cpp ROCm (#2092)
* feat(rocm): add gfx908 (MI100) and gfx90a (MI210) GPU support

Adds AMD Instinct MI100 (CDNA1/gfx908) and MI200/MI210 (CDNA2/gfx90a)
to the lemonade backend, following the llamacpp-rocm nightly build
support added in lemonade-sdk/llamacpp-rocm#103.

- Add gfx908 and gfx90a to ROCM_ARCH_MAPPING with both the direct arch
  string (used via HSA/WSL path) and the KFD-computed variants (gfx9008,
  gfx9010) produced by the native Linux digit-only parsing path
- Extend the gfx arch regex from \d{4} to [0-9a-f]{3,4} to match
  3-char and alphanumeric arch strings like gfx908 and gfx90a
- Add MI100/MI200/MI210/Arcturus/Aldebaran marketing name recognition
  as a fallback in identify_rocm_arch_from_name
- Register gfx908 and gfx90a as supported families for llamacpp rocm
  and sd-cpp rocm backends
- Add human-readable device family names for both new architectures

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

* fix(rocm): address Copilot review feedback for gfx908/gfx90a detection

- Move CDNA1/CDNA2 name checks before the early radeon/amd guard so bare
  device names like "MI100", "Arcturus", or "MI250" are detected correctly
- Add mi250/mi250x to CDNA2 detection (also gfx90a)
- Fix double-space formatting in DEVICE_FAMILY_NAMES entries
- Update gfx90a human-readable name to include MI250

https://claude.ai/code/session_01Uy8Wa9tf9vXKXY1jnSqZH1

* test(rocm): add CPU-runnable unit tests for ROCm arch mapping

Follows the same pattern as test/test_cuda_arch_mapping.py. Covers:
- KFD decimal gfx_target_version -> gfx arch (90008->gfx908, 90010->gfx90a)
- Direct gfx token extraction from device name strings
- CDNA1/CDNA2 marketing name fallback incl. bare names (MI100, MI250X)
- RDNA2/3/4 and iGPU name fallback
- Non-AMD names returning empty string

https://claude.ai/code/session_01Uy8Wa9tf9vXKXY1jnSqZH1

* test(rocm): rename ROCM_SUPPORTED_ARCHS to ROCM_SUPPORTED_FAMILIES

The set mixes concrete arch strings (gfx908, gfx90a) and wildcard family
tokens (gfx103X etc.), so "ARCHS" was misleading. Add a comment explaining
that RDNA family tokens are only reachable via name-based detection, not
the KFD path which produces exact arch strings like gfx1030.

https://claude.ai/code/session_01Uy8Wa9tf9vXKXY1jnSqZH1

* feat(rocm): enable AMD Instinct MI100 (gfx908) and MI200 (gfx90a) in llama.cpp ROCm

The Linux ROCm build already carries gfx908/gfx90a kernels (GPU_TARGETS in
lemonade-sdk/llama.cpp release.yml) and the nightly repo publishes per-arch
assets; only the descriptor support list gated them out. The Windows ROCm
build omits CDNA from its GPU_TARGETS, so both arches carry a Linux-only
install gate.

Addresses review feedback on #2092: drops the name-based CDNA fallback
(Linux detection goes through KFD gfx_target_version, which already yields
gfx908/gfx90a directly) and the Python test that only exercised a replica of
the C++ logic.

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

* fix(rocm): address review comments on llamacpp descriptor

- Simplify ROCm description to 'AMD GPUs supported by ROCm'
- Sort gfx arch list alphabetically
- Add Linux-only gate for gfx942 (MI300X lacks Windows binaries)
- Condense comments

* fix(rocm): group DEVICE_FAMILY_NAMES gfx9* entries together

Align source order with alphabetical grouping: gfx9* first (as gfx09 < gfx10),
then gfx10*, gfx11*, gfx12*.

* docs: regenerate backend docs for ROCm description change

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
2026-08-10 20:14:31 +00:00
Jeremy FowersandClaude Opus 5 ae61f162ca ci: cut the longest test jobs via parameter tuning (#2953)
* ci: cut the longest test jobs via parameter tuning

Trellis 3D generation (the worst offender at ~29 self-hosted minutes per
run) now launches trellis-server with classifier-free guidance disabled
via a new trellis_args recipe option, dropping a mesh from 98.5s to 31.8s
locally while still exercising every pipeline stage. Hosted-runner jobs
stop pulling Phi-4-mini (residency test now uses Llama-3.2-1B) and the
5.2 GB SD-Turbo safetensors (ollama steps use the 2 GB GGUF).

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

* test: restore trellis args after the 3D suite

/internal/set writes through to config.json, so the guidance-disabling
args the 3D suite applies would otherwise persist for every later
generation on that server -- silently degrading meshes on a developer
machine and pinning the self-hosted CI cache dirs to the fast path even
after the test stops asking for it. Save and restore around the suite,
and tolerate a server that predates the trellis_args option.

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

* test: pass the 3D fast-generation args per load

Setting trellis.args through /internal/set wrote through to config.json,
so the guidance-disabling args outlived the suite: a developer's server
kept serving degraded meshes, and an interrupted job left the persistent
self-hosted cache dir pinned to the fast path. POST /load carries recipe
options for one load without save_options, so nothing is persisted and
the generation reuses that process; unload afterwards so no guidance-free
backend is left resident.

Also validate custom args before the backend install can download an
archive, and reserve --res alongside the other Lemonade-managed flags.

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

* test: drop the unused server config getter

The per-load approach reads no config, so this helper has no callers.

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

* test: give the 3D load its own timeout and unload only its model

The explicit /load can install the trellis backend, which downloads and
extracts an archive; it was inheriting the 500s model-operation budget
where the lazy path had 1800s, so a cold runner would report an
environment stall as a product failure. Unload by name too, so a suite
run against a developer's own server leaves their other models resident.

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

* test: unload the 3D model through an auth-aware helper

The hand-rolled unload skipped the Authorization header every other
helper sends and ignored the response, so against a key-protected server
it would 401 in silence and leave the guidance-free backend resident.

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

* fix(trellis): reserve the -m alias for --models

trellis-server documents -m as the short form of --models, and custom
args are appended after the managed ones, so trellis_args of "-m <dir>"
would win and silently point the backend at a different model directory
while lemond reported the requested model as loaded. Peer backends
reserve both spellings.

Load through an auth-aware helper too, matching the unload beside it.

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

* test: assert the 3D speed-up args reached the backend

An option the server does not recognize is dropped during recipe-option
resolution, so a rename or a typo would still return 200 from /load and
quietly restore the slow full-guidance path -- the whole point of this
suite's tuning -- with nothing failing. Read the applied options back
from /health and compare.

Also reject an empty name in unload_model(), which the server reads as
"unload everything".

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

* test: compare trellis arg tokens instead of the raw string

A server that already carries trellis args merges them with the ones the
request supplies and rebuilds the value alphabetically, so an exact-string
comparison reports "never reached the backend" for a value that did in
fact arrive. Compare tokens instead.

Give load_model the standard model-operation timeout as well; 30s is
shorter than a cold load can legitimately take.

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

* test: isolate the 3D load from host trellis args

Pass merge_args=False on the preload so trellis args already configured on
the machine cannot alter the timing the suite is tuned for. With no merge
the applied value is the request string verbatim, so assert it exactly.

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

---------

Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-08 23:44:26 +00:00
Michele Balistreri 245b50caa0 [backends] Add support for image generation through TheNoise (#2927)
* implement thenoise backend

* add documentation

* add tests

* clean parameters

* address review comments

* regenerate doc

* add lora_dir validation

* remove redundant check and align defaults

* align doc

* fix typo
2026-08-08 12:59:47 +00:00
Jeremy FowersandClaude Opus 5 415b4fc04d Apply a canonical backend preference order to all descriptors (#2835)
Order every backend descriptor's `support` rows as system, metal, cuda, vulkan,
rocm, cpu (skipping backends a recipe doesn't offer), so "auto" resolves
consistently across recipes. `llamacpp` already followed this order; the other
descriptors did not.

Notably this makes vulkan preferred over rocm everywhere, and metal preferred
over cpu on macOS for kokoro and sd-cpp. `npu` is not part of the order and
keeps its existing leading position in whispercpp.

Generated docs regenerated via docs/tools/gen_backend_boilerplate.py.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-07-29 13:30:49 +00:00
Dennis Huang 9dbf9aed7b Add MiniCPM GGUF models to catalog (#2825) 2026-07-28 17:58:31 +00:00
Slawomir Nowaczyk d2b9508eff Support gfx950, using the same path as gfx942 (#2687)
* Support gfx950, using the same path as gfx942

* Gated architectures

* Documentation update
2026-07-20 14:10:29 +00:00
Ramakrishnan SivakumarandClaude Opus 4.8 0068511ecf feat(router): onnxruntime classification backend + /v1/classify (capability for #2592; policy wiring in #2384) (#2626)
* feat(router): onnxruntime classifier backend + /v1/classify (#2592)

Adds the onnxruntime backend so the router's classifier condition type can run.
New IClassificationServer capability + ModelType::CLASSIFICATION + Router::classify
+ quad-registered /v1/classify. The onnxruntime backend runs encoder text
classifiers via the lemonade-sdk/ort-server subprocess (pinned 0.2.0). Includes
tools/classifier_catalog export/parity-validation/benchmark harness.

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

* Add classifier catalog publish + standalone export scripts

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

* Register apache-2.0 ONNX classifiers + directory-resolve ops

- server_models.json: Bert-Phishing-ONNX + Phishing-Email-Detection-ONNX
  (recipe onnxruntime, label classification) pointing at the published
  lemonade-sdk repos.
- OnnxRuntimeOps resolves the checkpoint to the directory holding model.onnx
  (mirrors RyzenAI's genai_config.json dir resolution) so ort-server gets
  --model-path <dir>.

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

* Add missing Server::handle_classify definition (fixes link error)

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

* Regenerate backend docs for onnxruntime backend (gen_backend_boilerplate)

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

* Add /classify integration test + wire into CI

test/server_classify.py drives the full path (client -> lemond -> /v1/classify
-> onnxruntime backend -> ort-server): pulls Phishing-Email-Detection-ONNX,
asserts label scores in [0,1], and checks the missing-model/invalid-model/
missing-input failure paths. Registers the classification modality in
capabilities.py and adds a classify-onnxruntime row to the Test .exe matrix.

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

* handle_classify: propagate error HTTP status instead of 200

router_->classify() returns an error object (not a throw) for a non-classifier
model or backend 4xx/5xx; set res.status from the error's status_code/code so
clients don't see HTTP 200 with an error body. (Self-review finding.)

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

* Telemetry: never capture raw classifier inputs or label scores

CLASSIFIER spans record only input length + salted hash; classification
payloads (PII, phishing, prompt-injection text) are exactly what must not
reach OTLP export.

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

* onnxruntime backend: route classify through forward_request lifecycle

- forward_request + watchdog: active-request tracking, crash recovery,
  normalized backend errors, explicit 120s timeout
- transport failures are backend errors, not 400 invalid_request_error
- deterministic model.onnx resolution (manifest dir > shallowest > lexicographic)
- fail fast on Windows-on-ARM64 instead of downloading the x64 bundle
- drop PYTHONNOUSERSITE (native binary, not Python)

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

* handle_classify: validate request up front, add response envelope

Reject malformed JSON / missing input / bad top_k with 400 before any
model loads. Success responses are now {object, model, labels} so the
public API shape is pinned by lemond, not by ort-server's raw output.
Docs example now uses a shipped model.

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

* publish.py: fail-closed license allowlist + parity gate

Only allowlisted models with a verified source license publish; excluded
models (piiranha ND, roberta / prompt-injection no license) are documented
and no longer in the list. Exports must also pass parity thresholds.
Llama entries refuse to publish without LICENSE + USE_POLICY.

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

* Bump ort-server pin to 0.3.0

Manifest contract enforced (normalization/aggregation/dim-validation/
truncation), Apache-2.0 + third-party notices in the archives, and the
release CI now smoke-tests the extracted packaged archive on all four
platforms.

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

* Regenerate backend docs after main merge (gen_backend_boilerplate)

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

* Address round-2 review: exporter contract semantics + strict resolution

- exporters honor HF problem_type (multi-label -> sigmoid, regression
  rejected) and persist the model's real max_length; parity is validated
  through the deployed normalization; token_aggregation emits 'max'
- publish.py cleans staging dirs and requires exactly one .onnx
- onnxruntime backend resolves only a complete, unambiguous model dir
  (model.onnx + tokenizer.json + manifest/config); load() reports a
  precise error listing candidates otherwise
- classify tests: top_k passthrough, wrong-type 400s
- docs: capability framing (router wiring is #2384); manifest optional

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

* Self-review fixes: error mapping, validation hardening, catalog move

- classify errors carry only {message, type} from LemonException; map type
  to HTTP status (invalid_request/unsupported -> 400, model_not_loaded ->
  404) instead of collapsing everything to 500
- reject empty/whitespace input and out-of-int-range top_k up front;
  structured error object on the no-model-loaded path; honor per-request
  load options like the embeddings/reranking siblings
- model-dir scan uses error_code iteration so an unreadable subdir can't
  break bulk model resolution
- Windows CI cleanup also kills orphaned ort-server/moonshine-server
  (root cause of the classify job flake on self-hosted runners)
- move tools/classifier_catalog to lemonade-sdk/ort-server so the manifest
  contract's producer and consumer version together
- docs: model conditionally required, id2label source, top_k bounds

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

* Bump ort-server pin to 0.3.1

Special-token tokenization fix, manifest-optional config.json inference,
strict manifest typing, /health version reporting, complete third-party
license texts in archives, SHA-pinned dependencies, 27-check packaged-
archive contract suite in release CI.

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

* Fix model-optional classify, ambiguity arbitration; pin ort-server 0.3.3

- /classify with 'model' omitted now works: the request never carried a model
  into the router (execute_inference requires one), so the documented path was
  dead code returning 400. Resolve the sole loaded classification model and put
  it in the request; refuse when zero or several are loaded. Regression test
  reproduces the exact reported scenario.
- load() is the sole ambiguity arbiter: resolve_checkpoint_path falls back to
  the cache root, so a complete root that ALSO contains a nested complete model
  was silently served. Scan unconditionally; refuse unless exactly one.
- server_classify.py asserts served scores match the ORIGINAL PyTorch model on a
  deliberately non-saturated probe. This is the oracle that was missing:
  structural checks pass on wrong scores, and it caught ort-server serving
  LABEL_0=0.0005 where HuggingFace gives 0.7474 (padded tokenizer ids reached
  the model). Fixed in ort-server 0.3.3.
- docs narrowed to the architectures the runtime actually supports.

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

* Surface backend startup failures; pin ort-server 0.3.4

When a backend subprocess dies at startup its stderr goes nowhere (lemond runs
windowless under the tray and in CI), so the only signal was 'failed to start or
become ready'. That hid the actual cause of the classify CI failure: ort-server
was aborting instantly because the Rust tokenizer panics across the FFI on a
corrupt tokenizer.json (a truncated download in the runner's HF cache).

- capture the child's output on a failed start and include it in the error
- ort-server 0.3.4 parses tokenizer.json before handing it to the Rust
  tokenizer, so a corrupt file is a clean, actionable error instead of a panic

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

* Report how a backend subprocess died when it says nothing

A process that dies without output cannot be diagnosed from its output. Report
the exit code (naming STATUS_DLL_NOT_FOUND) and list what is actually installed
next to the binary — which is what distinguishes 'the model was rejected' from
'the backend install is incomplete'.

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

* Pin ort-server 0.3.5 (self-contained Windows binary)

Every release since 0.2.0 imported libssl-3-x64.dll / libcrypto-3-x64.dll:
cpp-httplib auto-links OpenSSL when the build machine has it. The binary ran on
hosts that happen to have OpenSSL and died with STATUS_DLL_NOT_FOUND on hosts
that do not — the classify job's failure on the self-hosted runner. 0.3.5 drops
the linkage and its release CI verifies the packaged binary against a dependency
allowlist on all four platforms.

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

* Resolve HF caches inside the active snapshot; pin ort-server 0.3.6

A Hugging Face cache normally holds an old snapshot beside the current one, and
refs/main names the active revision — but resolution scanned the whole cache and
rejected that ordinary layout as ambiguous, so any model the user had ever
updated failed to load. Use hf_cache::active_snapshot_path() (as the other
backends already do) and scope the search to it; keep exactly-one resolution for
local imports, where it is the right rule.

ort-server 0.3.6 completes the tokenizer contract: token-classification no
longer aggregates the special-token positions HuggingFace filters out, and a
manifest can no longer bypass the architecture check.

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

* Require config.json for a servable onnxruntime model dir

ort-server 0.3.6 always requires a valid config.json — the manifest
describes the output contract only and cannot excuse the missing
architecture declaration. lemond still treated manifest.json as an
alternative to config.json, so it could select (or count as an ambiguity
candidate) a layout the backend would immediately reject.

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

* Pin ort-server 0.3.7 (RobertaProcessing special-token filtering)

0.3.7 filters special tokens inserted by RobertaProcessing/BertProcessing
post-processors (stock RoBERTa's <s>/</s> live in cls/sep fields, not the
TemplateProcessing map), so token-classification on the allowlisted RoBERTa
families no longer aggregates positions the HuggingFace pipeline drops.

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-15 19:45:44 +00:00
fl0rianr b72a844df3 feat(flm): restore validated backend arguments (#2677)
Add typed allow-list validation for FLM serve tuning arguments and expose them through load, run, and bench.
2026-07-14 00:14:00 +00:00
e1740901a2 feat(vllm): stage AMD Instinct MI300X (gfx942) support (pending release asset) (#2588)
Extends the experimental vLLM ROCm backend from RDNA to AMD Instinct CDNA
(gfx942 / MI300X). gfx942 is held OUT of the installable support matrix
until its per-arch release asset is published in lemonade-sdk/vllm-rocm;
the resolver, pinning, launch policy and recipes below are in place and
have been validated by hand on real MI300X hardware.

- Per-arch release pinning: CDNA-dcgpu rides a different vLLM/ROCm wheel
  cadence than RDNA, so no single tag covers both. backend_versions.json
  gains vllm.rocm_arch_overrides, applied only over the builtin default so
  an explicit vllm.rocm_bin pin is never clobbered. A cross-arch pin is
  rejected rather than installed against the wrong architecture line.
- Device-class launch policy: discrete-HBM parts get vLLM's native memory
  budgeting and CUDA-graph capture; APUs and consumer GPUs keep the
  conservative defaults. --enforce-eager is managed rather than passed
  through, so a user can still force eager on a discrete GPU.
- Discrete-GPU preference: the amd_gpu device list is iGPU-first, so a
  hybrid host (Strix Halo APU + MI300X) must not resolve to the iGPU.
- Structured speculative_config (e.g. MTP), since inline JSON cannot
  survive the vllm_args tokenizer.
- Qwen3.6 FP8 + MTP recipes, docs, and unit tests for the gating,
  resolver, launch policy and release-tag construction.

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: GLM-5.2 <[email protected]>
2026-07-13 04:55:59 +00:00
Piotr Wilkin (ilintar)andClaude Fable 5 1a6def6fa0 fix(acestep): music without lyrics isn't the greatest (#2629)
* fix(acestep): sing lyrics via LM pipeline; prefer installed backend, gate ROCm families (#2623)

- Route requests with lyrics through ace-server's two-stage vocal pipeline
  (/lm then /synth); instrumental keeps the DiT-only path. New audio/generations
  fields: lyrics, vocal_language.
- Split the audio panel into a style-description field and a lyrics textarea
  with a syntax-guide modal.
- Backend auto-selection prefers an installed variant over downloading the
  preference-order winner (#2623).
- Gate acestep/thinksound/trellis ROCm rows to the GPU families the engine
  releases are built for (#2623).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(acestep): address review — vocal language field in UI, 400 on non-string lyrics/vocal_language

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

---------

Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-10 11:43:16 +00:00
Ken VanDineandClaude Sonnet 5 63b7d16e32 fix(backends): enable sd-cpp CUDA support on Windows (#2601)
The sd-cpp descriptor restricted its cuda variant to Linux only, even
though the Windows CUDA download/runtime path in sdcpp_server.cpp was
already implemented and the upstream release still publishes a
windows-cuda asset (validated by validate_sdcpp.yml). Add "windows" back
to the cuda support row and add cuda to arg/bin variants so config.json
gets cuda_args/cuda_bin defaults, matching llama.cpp's pattern.

Regenerated defaults.json and docs via gen_backend_boilerplate.py.

Co-authored-by: Claude Sonnet 5 <[email protected]>
2026-07-08 17:35:30 +00:00
dd3f7532ab Asset generation: Trellis (#2581)
* feat(backends): Trellis image-to-3D

Add the trellis recipe — a standalone WrappedServer backend wrapping
trellis-server, plus the 3D-generation surface it serves: the IModel3DServer
capability, the MESH model type, and the POST /3d/generations endpoint
(image -> textured GLB mesh, quad-prefix). Model: TRELLIS-3D.

* feat(backends): Trellis 3D — review-feedback hardening + 3D UI

Mirror the fixes from the audio-generation PR: full build pins
(vulkan/rocm/cuda, Linux+Windows) with CUDA env handling, backend
error payloads from /3d/generations surfaced as HTTP 500 JSON,
response_format restricted to what the backend natively produces
(supported_model_formats, glb), tests + CI matrix entries, and the
3D generator UI (image/text source toggle, embedded glTF viewer).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(trellis): find libomp140.x86_64.dll on Windows ROCm

Same gap as the audio-generation and openmoss backends: TheRock's
lib/llvm/bin (where libomp140.x86_64.dll lives, imported by both
ggml-cpu.dll and ggml-base.dll) is a sibling of the main bin/ dir on
Windows, not a subdirectory of it, so the existing PATH construction
missed it and trellis-server exited immediately on Windows ROCm.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* chore(3d-generation): bump trellis pin to v0.1.1

Windows ROCm no longer depends on libomp140.x86_64.dll: deform_conv_cpu.cpp
now uses std::thread instead of OpenMP, and the build sets
GGML_OPENMP=OFF for ggml's own internal default (TheRock's Windows dist
never shipped that DLL in the first place).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* chore: remove comments

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(server): propagate non-200 byte-stream backend responses as JSON errors

The byte-stream proxy forwarded the backend body into the sink before
checking the HTTP status, so text/plain backend errors (bad reference WAV,
out-of-range speed) were served as 200 audio. Divert non-200 bodies into an
error payload and preserve the backend status code at the endpoint.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(3d): fail-fast request validation, image MIME sniffing, review hardening

- Validate model/image/response_format/resolution/bg_removal/seed with 400
  before auto-loading the model, so malformed requests can't trigger a
  15 GB model load
- Sniff the uploaded image's magic bytes and forward the real MIME type and
  extension instead of always input.png; reject formats stb_image can't
  decode (e.g. WebP) up front
- Launch trellis-server with --res 512 instead of the TRELLIS_512 env var
- Mark /v1/3d/generations experimental in the API docs to match the
  backend descriptor
- Narrow the pre-commit large-file exception to the exact vendored bundle
  and document its provenance (model-viewer 4.3.0, Apache-2.0)
- Negative tests no longer pull the model and pin the invalid-model
  response to 404

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* chore(3d-generation): bump trellis pin to v0.1.2

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix: static constexpr for lambda-referenced error-body cap (MSVC C3493)

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(3d): sniff image magic bytes before model autoload; restrict picker MIME types

Valid-base64-but-not-an-image payloads previously passed the cheap checks
and triggered the model load before the backend rejected them.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* chore(3d-generation): bump trellis pin to v0.1.3

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* chore(trellis): capture trellis-server output into the lemond log

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(test): pull models via the SSE streaming endpoint

The synchronous /pull blocks with no traffic until the download finishes,
so 10+ GB models exceed any fixed read timeout on cold-cache runners. The
streaming mode emits progress events continuously, making the read timeout
apply between events instead of across the entire download.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* chore(3d-generation): bump trellis pin to v0.1.4

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* refactor(trellis): explicit rocm/cuda env split, unsupported-system error

Mirrors the review feedback on the OpenMOSS backend: separate ROCm and
CUDA loader-path branches, UnsupportedOperationException instead of a
blind vulkan fallback, unnamed unused parameter.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* chore(3d-generation): bump trellis pin to v0.1.5

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: fl0rianr <[email protected]>
2026-07-08 17:16:18 +00:00
16daf08e83 Asset generation: OpenMOSS (#2580)
* feat(backends): OpenMOSS TTS (voice design + cloning)

Add the openmoss recipe — a standalone WrappedServer backend wrapping
moss-tts-server (MOSS-TTS-Delay: Qwen3 backbone + MOSS-Audio codec). Serves the
existing /audio/speech endpoint with two models: OpenMOSS-TTS (voice cloning
from a reference WAV) and MOSS-VoiceGen (voice design from a text description).

* feat(backends): OpenMOSS TTS — review-feedback hardening + TTS UI

Mirror the fixes from the audio-generation PR: full build pins
(vulkan/rocm/cuda, Linux+Windows) with CUDA env handling, backend
error payloads surfaced as HTTP errors on the non-streaming
/audio/speech path, response_format restricted to what the backend
natively produces (supported_audio_formats, wav for OpenMOSS; Kokoro
unrestricted), tests + CI matrix entries, and the OpenMOSS TTS UI
(voice-design cascade, clone upload, per-role voice samples).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(openmoss): find libomp140.x86_64.dll on Windows ROCm

TheRock keeps its LLVM support DLLs (including libomp140.x86_64.dll,
which the ggml-cpu/ggml-base DLLs both import) under lib/llvm/bin on
Windows -- a sibling of the main bin/ dir that get_therock_lib_path()
returns, not a subdirectory of it. The Windows PATH construction only
added the main bin/ dir, so moss-tts-server exited immediately on
Windows ROCm CI runners with a missing-DLL failure. Add the llvm/bin
sibling dir to PATH, mirroring the existing Linux lib/llvm/lib fix.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* chore(openmoss): bump pin to v0.1.1

Windows ROCm no longer depends on libomp140.x86_64.dll (build now sets
GGML_OPENMP=OFF; TheRock's Windows dist never shipped that DLL in the
first place).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* chore: remove comments

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(server): propagate non-200 byte-stream backend responses as JSON errors

The byte-stream proxy forwarded the backend body into the sink before
checking the HTTP status, so text/plain backend errors (bad reference WAV,
out-of-range speed) were served as 200 audio. Divert non-200 bodies into an
error payload and preserve the backend status code at the endpoint.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(ui): TTS panel only uses TTS-labeled models; validate voice samples as WAV

The panel derived its model from the global selector even when a non-TTS
model was selected. Voice-sample uploads now require RIFF/WAVE files and can
be cleared from settings.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* chore(openmoss): bump pin to v0.1.2

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix: static constexpr for lambda-referenced error-body cap (MSVC C3493)

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* feat(ui): TTS follow-ups — filtered model selector, Plain mode, sample size cap

- ModelSelector gains optional filterLabel/effectiveModel props; the TTS
  panel lists only TTS-capable models and displays the model actually used
- Third 'Plain' mode synthesizes directly with the selected OpenMOSS model
  (optional style instruction), no reference voice needed
- Voice samples capped at 10 MB with a local-storage note in settings

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(test): pull models via the SSE streaming endpoint

The synchronous /pull blocks with no traffic until the download finishes,
so 10+ GB models exceed any fixed read timeout on cold-cache runners. The
streaming mode emits progress events continuously, making the read timeout
apply between events instead of across the entire download.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* refactor(openmoss): address review — explicit rocm/cuda env split, unsupported-system error

- Split the ROCm and CUDA loader-path setup into separate branches
- Raise UnsupportedOperationException instead of silently defaulting to
  vulkan when no supported GPU backend is detected
- Drop the (void) cast in favor of an unnamed parameter

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: fl0rianr <[email protected]>
2026-07-08 14:09:17 +00:00
Ian B MacDonaldandClaude Opus 4.8 fde30b132e feat(rocm): enable AMD Instinct MI300X (gfx942) in the llama.cpp ROCm backend (#2587)
* feat(rocm): enable AMD Instinct MI300X (gfx942) in the llama.cpp ROCm backend

The shipped multi-arch llama.cpp ROCm build already carries gfx942 kernels
(verified in libggml-hip.so); the backend only gated it out via the descriptor
support list. Add gfx942 to the llamacpp rocm arch list + a DEVICE_FAMILY_NAMES
display name, and a gating test mirroring the vLLM one. Validated on a real
MI300X: llama-server -ngl 99 loads a GGUF and generates at ~400 tok/s.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
(cherry picked from commit bcabf4e99142653676d17007ac1af92802a11d7d)

* test(llamacpp): fold GLM review — add gfx908 negative assertion + drop WHAT-comment

GLM-5.2 review of the gfx942 allow-list (0 blockers): (1) removed the CMake
comment that restated WHAT per AGENTS.md; (2) added a gfx908 (CDNA1) negative
assertion — it's in the shipped build's targets but intentionally not in the
allow-list, the more interesting regression case. Skipped the optional
BUILD_TESTING guard nit: the adjacent test_rocm_root_resolution uses the same
if(EXISTS) form, so matching the neighbor is the local convention.

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

* test(llamacpp): assert rocm-stable/nightly channel normalization for gfx942

backend_supports_arch() strips the channel suffix from rocm-stable/rocm-nightly
to rocm before the support-matrix lookup — the path install/dry-run resolution
takes. The gating test only fed the pre-normalized "rocm", leaving that branch
uncovered. Adds two assertions exercising it (fl0rianr review on #2587).

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

* test(llamacpp): remove redundant gfx942 gating test (superm1 review)

The topology 404-test already covers asset resolution for every supported arch
end-to-end, and the support list is additive — the gating assertions were redundant.

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-08 07:42:04 +00:00
Piotr Wilkin (ilintar)andClaude Fable 5 b1fd12e177 feat(backends): audio generation — ThinkSound (SFX) + ACE-Step (music) (#2530)
* feat(backends): audio generation — ThinkSound (SFX) + ACE-Step (music)

Add the thinksound and acestep recipes — standalone WrappedServer backends —
plus the audio-generation surface they share: the IAudioGenerationServer
capability, the AUDIO_GENERATION model type, and the POST /audio/generations
endpoint (text -> audio clip, quad-prefix). ThinkSound wraps ts-server for sound
effects; ACE-Step wraps ace-server's async job API for music. Models:
ThinkSound-SFX, ACE-Step-Music.

* fix(audio-generation): address review feedback

- pin rocm-stable + cuda builds for thinksound/acestep (Linux + Windows)
  and add CUDA loader-path/env handling mirroring sd-cpp
- surface backend error payloads from /audio/generations as HTTP 500
  JSON instead of a 200 audio body; ACE-Step reports failure reasons
- restrict response_format to what the backend natively produces
  (supported_audio_formats(), wav for now) with 400 otherwise;
  transcoding left as TODO
- add test/server_audio_generation.py and CI matrix entries
  (thinksound/acestep x vulkan/rocm on Windows + Linux)
- port the audio-generation panel + mode switch from feat/mm-ui so
  selecting an ACE-Step/ThinkSound model leaves LLM Chat

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(audio-generation): declare backend options, prewarm TheRock in CI, document endpoint

- declare thinksound_backend/acestep_backend descriptor options and select
  the backend from RecipeOptions in load() (sd-cpp pattern) so per-model
  options and option-change reloads carry it
- add thinksound/acestep to the test harness TheRock prewarm allow-list
- document POST /v1/audio/generations in docs/api/lemonade.md

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(audio-generation): resolve libomp from TheRock's llvm/lib on ROCm

The slim ROCm engine binaries link LLVM OpenMP, which TheRock ships
under lib/llvm/lib rather than lib/, so ace-server exited with 127
(libomp.so not found) on CI runners. Prepend that dir to the loader
path alongside the main TheRock lib dir.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(audio-generation): UI backend selector, honest model sizes, spinner CSS

- register thinksound/acestep in the frontend recipe-options config so the
  Model Options modal offers the backend selector (Auto/ROCm/CUDA/Vulkan)
- prefer rocm/cuda over vulkan as the auto default (sd-cpp order)
- ThinkSound: only download the six GGUFs ts-server loads by default,
  dropping the redundant q8 variants (11.4 -> 6.4 GiB; also keeps the CI
  model pull inside the harness timeout)
- correct registry sizes (GiB) and refresh a downloaded model's size from
  its aggregate on-disk payload at cache build, so the UI reports what is
  actually installed
- hide the native number-input spinner on the audio Duration field

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(audio-ui): widen Duration field and keep the native spinner

The earlier fix hid the number-input spinner entirely; restore it and
widen the field (64px -> 96px) so the control no longer looks cramped.

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

* fix(audio-generation): ThinkSound full-repo download + dark-mode spinner

- select_checkpoint_files() was only consulted when a GGUF variant was
  present, so bare-repo checkpoints (ThinkSound-SFX has none) fell through
  to "download every file in the repo" instead of the intended 6-file
  subset, re-adding the redundant q8 variants and the CI timeouts they
  caused. Check the backend's selection regardless of variant.
- add `color-scheme: dark` (this app has no light theme): without it,
  native form controls like the audio Duration spinner render with
  browser-default light chrome no matter what our CSS says, which is what
  the fixed -webkit-appearance hack was still showing on some platforms.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix(audio-generation): find libomp140.x86_64.dll on Windows ROCm

Confirmed via objdump on the actual release DLLs: ggml-cpu.dll and
ggml-base.dll both import libomp140.x86_64.dll, and TheRock's Windows
distribution keeps it under lib/llvm/bin -- a sibling of the main bin/
dir that get_therock_lib_path() returns, not a subdirectory of it
(mirrors the existing Linux lib/llvm/lib fix, verified against
TheRock's actual archive layout). The Windows PATH construction only
added the main bin/ dir, so ace-server/ts-server exited within ~1s of
starting on Windows ROCm CI runners -- exactly the failure seen in the
Test .exe - audio-gen-acestep job (acestep-server failed to start).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* chore(audio-generation): bump thinksound/acestep pins to v0.1.1

Windows ROCm builds no longer depend on libomp140.x86_64.dll (both now
build with GGML_OPENMP=OFF; TheRock's Windows dist never shipped that
DLL in the first place).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* fix: remove inline styles, add proper CSS with no theme forcing

* feat: proper width for input

* chore(thinksound): bump pin to v0.1.2

Fixes a 32-bit fseek truncation on Windows that broke loading of the
2.4-2.6GB bf16 checkpoints (dit-bf16.gguf, t5-bf16.gguf) on any backend
-- surfaced in CI as "t5 load failed" on the Windows Vulkan test.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

* Enhance audio duration input with color-scheme

Add color-scheme styling for audio duration input.

* fix: serialize concurrent downloads of the same checkpoint repo

Two /pull requests for the same model (e.g. a client that timed out and
retried while the first download was still running) wrote the same
.partial files concurrently, corrupting them so hash verification
failed with a different digest on every retry-from-scratch cycle.
Take a per-checkpoint-repo lock around download_registered_model so
the second request waits and then validates the finished files.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbpKMPt3rkoxTRJMaDwWXv

---------

Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-07 00:27:34 +00:00
Jeremy FowersandClaude Opus 4.8 a1e870a8a2 feat(models): add RPG-HaloTales-V1 omni collection (#2509)
* feat(models): add RPG-HaloTales-V1 omni collection

Register lemonade-sdk/RPG-HaloTales-V1, a turn-based illustrated and
voiced RPG storyteller packaged as a Lemonade Omni collection.

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

* Update doc

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-01 09:12:50 -04:00
fl0rianr ec5f58bc43 fix(backends): fallback to installed backend when offline (#2393)
* fix(backends): fallback to installed backend when offline

* adress review comment

* fix: approach corrected for update when online

* adapat for new docs and style
2026-06-30 05:28:10 +00:00
Jeremy FowersandClaude Opus 4.8 05ce2ed622 refactor(backends): self-describing WrappedServer backends (#2287) (#2320)
* refactor(backends): self-describing WrappedServer backends (#2287)

Make each inference backend describe itself with a plain-data descriptor plus
a server class, and rewrite the scattered `if (recipe == "...")` sites to read
a registry built from those descriptors. Adding a backend becomes one
LEMON_BACKENDS line plus a descriptor + factory file — no router, CLI, docs, or
support-matrix edits.

- Descriptor types (BackendDescriptor/BackendOption/SlotPolicy) + a CLI-safe
  data registry and a server-only factory registry, generated from the
  LEMON_BACKENDS list at CMake configure time.
- All 9 backends carry a descriptor (device, slot policy, options, support
  matrix, labels, binary) and a create().
- Descriptor-driven: router creation, NPU/slot eviction, device type, recipe
  options/CLI flags, config-section identity, support matrix, recipe labels,
  cloud availability.
- /system-info recipes enriched with display_name/selectable_backend/options/
  support; the app reads recipe display names from it instead of hardcoded TS.
- docs/tools/gen_backend_docs.py generates docs/dev/backends-reference.md from
  /system-info; a CI step fails on drift. Authoring guide in
  docs/dev/adding-a-backend.md.

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

* refactor(backends): move each backend into its own folder (per spec)

Restructure the self-describing backends to the layout the issue #2287 plan
specified — one folder per backend — instead of the flat file layout I used
before. This also folds the earlier _descriptor/_factory split into the spec's
cleaner shape: the descriptor is a header-only `inline const` and create() lives
with the server class.

Each backend now lives in its own folder, in namespace lemon::backends::<stem>:
  include/lemon/backends/<stem>/<stem>.h         inline const descriptor (CLI-safe data)
  include/lemon/backends/<stem>/<stem>_server.h  WrappedServer subclass + create() decl
  server/backends/<stem>/<stem>_server.cpp       implementation + create() def

Shared registry/util files stay at the top of backends/. The CMake foreach over
LEMON_BACKENDS compiles each <stem>/<stem>_server.cpp and generates the registry
headers from the folder paths. Removes the per-backend *_descriptor.{h,cpp} and
*_factory.{h,cpp} files. Behavior is unchanged (same descriptors, same create()).

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

* docs(backends): mechanize the README support matrix from descriptors

Make the existing curated docs generate from the backend descriptors instead of
just shipping a separate reference file — closing appendix rows 14 and 22.

- Expand the descriptor with the editorial fields the curated docs need:
  `modality`, `experimental`, `web_display_name`, and a per-support-row
  `device_summary` (RecipeBackendDef). These keep the descriptor the single
  source of truth.
- /system-info exposes them plus a registry `order` index and `slot_policy`.
- gen_backend_docs.py now targets multiple docs and renders:
    * README.md "Supported Configurations" HTML matrix (grouped by modality,
      merged rows, rowspans, experimental tag) — wrapped in GENERATED markers;
    * docs/guide/configuration/multi-model.md NPU-exclusivity list.
  The backend-docs-drift CI job's --check now covers all three docs.

The generated README matrix is also more complete than the hand-written one
(it now includes whispercpp rocm/metal, kokoro metal, sd-cpp metal). Footnotes
and prose outside the markers are preserved.

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

* docs(cli): mechanize the per-recipe load-options tables from descriptors

Wrap cli.md's "Recipe-Specific Options" tables in GENERATED markers and render
them from the descriptor options. This also fixes pre-existing drift: the section
documented `--steps`/`--cfg-scale`/`--width`/`--height` flags that the CLI no
longer registers, and omitted the moonshine and vllm recipes. Now covered by the
backend-docs-drift CI check.

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

* docs(custom-models): mechanize the --recipe value list from descriptors

Add inline-marker support to the generator and wrap the `--recipe` "Common
values" list in custom-models.md so it renders from the descriptor recipe set
(plus collection.omni). Now covered by the backend-docs-drift CI check.

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

* docs: mechanize config.json example and models.js recipe metadata

Close the last two cleanly-derivable doc touchpoints (appendix rows 16 and 21).

- configuration/README.md "Example config.json": generated from a fresh lemond's
  GET /internal/config (the real canonical config). This also fixes pre-existing
  drift — the hand-written block had `config_version: 1` (now 2), `prefer_system:
  false` (now true), a stray `device` key, and an invalid trailing comma. `port`
  is normalized to the documented default 13305.
- docs/assets/models.js RECIPE_PRIORITY + RECIPE_DISPLAY_NAMES: generated from
  descriptors. A new `web_priority` editorial field preserves the curated website
  ordering (so the order is descriptor-sourced, not a silent reorder); legacy
  `oga-*` recipes are dropped as agreed. Adds the correct `vllm` display name.

The generator now drives 7 docs and supports both `<!-- -->` (Markdown) and
`/* */` (JS) GENERATED markers. backend-docs-drift --check covers all of them.

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

* refactor(backends): finish agreed touchpoints rows 4 & 5 (registry-drive spec; drop device map)

Two agreed plan touchpoints were left incomplete; this finishes them.

Row 4 — try_get_spec_for_recipe was still a hand-written 8-branch if-ladder in
backend_utils.cpp, which also forced it to #include all 8 server headers. Each
backend now exposes a uniform `spec()` accessor (alongside create()); the
generated factory registry binds it, and `backends::spec_for(recipe)` /
try_get_spec_for_recipe iterate the registry. backend_utils.cpp now includes
ZERO server headers. Also reroute the two leaking `Server::SPEC` references
(model_manager find_flm_binary) through the registry.

Row 5 — get_device_type_from_recipe still carried the full recipe->device map,
redundant with BackendDescriptor::default_device. Reduced to a DEVICE_NONE
fallback for non-descriptor recipes (collections/unknown); the descriptor is the
single source via ModelManager::device_type_for_recipe.

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

* refactor(backends): add BackendOps infrastructure (Tier-2 foundation)

Introduce a stateless per-backend behavior interface for model management that
happens WITHOUT a running subprocess (checkpoint-path resolution, download,
dynamic discovery, per-model metadata, version detection, availability) — the
home for the recipe switchboards currently scattered through model_manager and
system_info.

- BackendOps base class (lemon/backends/backend_ops.h): shared default behavior;
  backends override only the policy points they need (inherit shared logic, don't
  copy it). Methods are added incrementally as switchboards migrate; each has a
  default so adding one never forces edits to backends that don't override it.
- Each backend folder exposes a uniform ops() singleton (alongside create()/spec()),
  bound into BackendRegistration; backends::ops_for(recipe) returns it.
- Purely additive: every backend uses the default base ops for now, so there is
  no behavior change yet. Migrations follow in subsequent commits.

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

* refactor(backends): migrate per-model metadata to ops; move GGUF/FLM readers into folders

Replace the populate_model_metadata recipe switchboard with
ops_for(recipe)->populate_metadata(). The backend-specific readers move into
their folders:

- GGUF metadata reader (read_gguf_metadata + byte parsers) -> backends/llamacpp/
  llamacpp_gguf.{h,cpp}; LlamaCppOps::populate_metadata reads arch + capability
  labels there.
- FLM model-file helpers (config.json ctx window, model-dir discovery) ->
  backends/fastflowlm/fastflowlm_models.{h,cpp}; FlmOps::populate_metadata uses it.

model_manager no longer knows how either backend stores or introspects models.
CMake now globs each backend folder's *.cpp (CONFIGURE_DEPENDS) so backend-private
helper files need no CMake edit; the backend LIST stays explicit.

Verified: GGUF context windows still populate (131072/128000/32768 for sample
models) and test_gguf_capabilities passes.

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

* refactor(backends): descriptor-drive ROCm channels (kill duplicated (llamacpp||sd-cpp)&&rocm)

Add a `rocm_channels` descriptor field (llamacpp {"stable","nightly"}, sd-cpp
{"stable"}) and a recipe_has_rocm_channels() registry helper. Replace the
hardcoded `(recipe=="llamacpp"||recipe=="sd-cpp") && rocm` predicate — copied
across backend_utils.cpp (3×), backend_manager.cpp (2×), and system_info.cpp —
with the descriptor check. rocm_channel_for_recipe() now clamps a requested
channel to one the backend publishes (so sd-cpp's missing "nightly" -> "stable"
falls out of the data instead of a per-recipe special case).

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

* refactor(backends): migrate resolve_model_path switchboard to ops (worst leak)

Replace the ~290-line recipe switchboard in ModelManager::resolve_model_path
with ops_for(recipe)->resolve_checkpoint_path(). The model manager now only does
the generic prefix (collections, local_path/local_upload, HF cache-dir
computation) and hands off to the backend.

- New BackendOps::resolve_checkpoint_path; base = the shared HF behavior
  (active-snapshot variant/aux resolution, main-repo fallback, directory
  fallback). Backends override only their artifact layout:
    * llamacpp -> GGUF resolver (sharding/folder/quant-token), moved into
      backends/llamacpp/llamacpp_gguf (resolve_gguf_path).
    * ryzenai -> genai_config.json directory; kokoro -> index.json;
      whispercpp -> first .bin; cloud -> ""; flm -> checkpoint passthrough.
- New shared backends/hf_cache_util (exists/dir_options/active_snapshot_path/
  repo_id_to_cache_dir_name) so ops reuse the same HF-cache mechanics.

model_manager.cpp -362 lines; resolve_model_path 365 -> 34. Verified all recipes
still resolve as downloaded (llamacpp variants, whisper .bin, kokoro index,
sd-cpp, ryzenai, flm) via /models.

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

* refactor(backends): migrate download/discovery/is_downloaded to ops; FLM cluster → folder

Dynamic discovery, download status, and downloading now flow through BackendOps
instead of recipe switchboards in model_manager:

- discover_models: build_cache loops descriptors with dynamic_models=true and
  merges ops->discover_models(). FLM (`flm list`) and cloud (per-provider) both
  implement it — the two bespoke discovery blocks collapse to one generic loop.
- is_downloaded: base = shared HF completeness (ModelManager::checkpoints_complete);
  CloudOps → true; FlmOps → installed-set membership. Replaces the flm_set/cloud/
  else branches in build_cache and add_model_to_cache.
- validate_checkpoint_file: LlamaCppOps does the GGUF-magic check (was an inline
  llamacpp branch in are_required_checkpoints_complete).
- download_model: base = shared HF engine (download_from_huggingface_engine);
  FlmOps → flm pull; CloudOps → no-op. download_registered_model just dispatches.
  invalidates_cache_after_download() replaces the recipe=="flm" cache-reset.

The whole FLM cluster (find_flm_binary, flm_installed_checkpoints, flm_discover_models,
flm_download) moves into backends/fastflowlm/fastflowlm_models. model_manager keeps
only the generic HF engine.

Verified: server_endpoints 69 pass; download status correct for every recipe.

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

* refactor(backends): migrate version detection to a resolve_version ops hook

get_recipe_version now reads version.txt generically and lets the backend ops
override, instead of branching on recipe. The per-backend version commands move
into their folders:

- system llama-server version (`llama-server --version` + regex) -> backends/
  llamacpp; LlamaCppOps::resolve_version returns it for the "system" backend.
- flm version (`flm version --json`) -> backends/fastflowlm (flm_version());
  FlmOps::resolve_version returns it when no version.txt is present.

Removes SystemInfo::get_system_llamacpp_version / get_flm_version and the
llamacpp-system / flm branches from system_info.

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

* polish(backends): drop redundant config_section (defaults to recipe)

config_section duplicated the recipe string in 8 descriptors; it defaults to the
recipe via effective_config_section(), so set those to "". Only sd-cpp ("sdcpp")
and ryzenai-llm ("ryzenai") keep an explicit section because theirs genuinely
differ from the recipe.

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

* refactor(backends): gate Prometheus scraping on an exposes_prometheus_metrics descriptor flag

prometheus_metrics.cpp hardcoded `recipe == "llamacpp"` to decide whether to
scrape a backend subprocess's /metrics. Replace with a descriptor flag
(exposes_prometheus_metrics; llamacpp = true) so a new backend that exposes
Prometheus metrics opts in via its descriptor, not by editing the metrics code.

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

* refactor(backends): move hf_load and moonshine_arch to ModelInfo::extras

These backend-specific per-model fields no longer sit on the shared ModelInfo
struct: llamacpp reads info.extra<bool>("hf_load", false) and moonshine reads
info.extra<int>("moonshine_arch", -1). Removed the typed fields, their explicit
parse sites, and their kKnownKeys entries; added parse_extras() to the two
ModelInfo-building paths that lacked it (add_model_to_cache, get_model_info_
unfiltered) so extras populate everywhere a model is built from JSON.

Verified: llamacpp models still resolve/download (hf_load path intact).

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

* refactor(backends): descriptor-drive the gfx1151 CWSR availability check

Replace the hardcoded (sd-cpp||llamacpp||vllm)&&rocm recipe-list in
is_recipe_installed and build_recipes_info with a rocm_requires_cwsr_fix
descriptor flag (set on those three backends). The kernel CWSR detection
(needs_gfx1151_cwsr_fix) stays in system_info as generic hardware detection;
only "which backends' rocm build needs it" is now descriptor data.

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

* refactor(backends): migrate install availability to a check_install ops hook

is_recipe_installed now finds the managed binary generically and asks the
backend's ops whether it's actually installed, instead of hardcoding the
llamacpp-system HIP check and the flm PATH fallback:

- check_install(backend, binary_found) ops hook; base = installed iff binary
  found. LlamaCppOps adds the ggml HIP-plugin requirement for the "system"
  build on AMD GPUs; FlmOps treats a PATH-installed flm as present.
- is_ggml_hip_plugin_available moves into backends/llamacpp; find_flm_executable
  and run_flm_validate move into backends/fastflowlm. Removed from path_utils
  (+ their orphaned decls/comments).

system_info no longer carries llamacpp/flm-specific availability knowledge.

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

* refactor(backends): descriptor-drive version comparison policy (Exact vs AtLeast)

The update-required check special-cased recipe=="flm" to allow an installed
version newer than the pin. Replace with a version_policy descriptor field
(Exact default; flm = AtLeast for its system-managed package). system_info no
longer names flm in the version-comparison logic.

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

* refactor(backends): move FLM model deletion into the fastflowlm folder

The `flm remove` subprocess orchestration moves out of ModelManager::delete_model
into backends/fastflowlm (flm_remove). model_manager keeps only the generic
HF-cache deletion path; the flm branch is now a thin call into the backend.

Verified: server_endpoints 69 pass.

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

* refactor(config): drive recipe_options() from descriptors, not per-recipe blocks

RuntimeConfig::recipe_options() had a hardcoded nested→flat translation block per
recipe (llamacpp/whispercpp/moonshine/sdcpp/vllm). Replace with a single loop
over the descriptors: each option's config.json key is derived from its name
role (*_backend → "backend", *_args → variant "<backend>_args"/"args",
*_device → "device", else the option name verbatim for sd-cpp's steps/cfg_scale/
width/height). Adding a backend no longer requires editing this function.

Verified: server_endpoints 69 pass (config/params translation unchanged).

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

* polish(backends): build BackendSpec from the descriptor (dedup binary across descriptor↔server.h)

The backend binary name (and recipe) were duplicated between the descriptor
(<stem>.h) and the BackendSpec literal (<stem>_server.h) — the cross-file
redundancy. Remove the static SPEC member; each backend's spec() now builds the
BackendSpec lazily from descriptor.binary (+ descriptor.recipe, or the explicit
"ryzenai-server" install id where it differs) plus the class's get_install_params
and split flag. In-class binary lookups go through spec(); server.cpp's sd upscale
uses try_get_spec_for_recipe.

Net: the binary name now lives in exactly one place (the descriptor). Lazy
function-local statics also avoid any static-init-order coupling between the
descriptor and the spec.

Verified: builds green; system-info install detection unchanged.

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

* polish(backends): drop redundant recipe from descriptor support rows

The recipe was repeated on every support row (6x in llamacpp.h). Introduce
a recipe-free BackendSupport struct; the owning descriptor's recipe is filled
in by recipe_defs() when flattening to RecipeBackendDef.

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

* polish(backends): remove dead llamacpp-special branch in version lookup

The preceding generic block already handles backend_versions[recipe] for any
recipe, so the recipe=="llamacpp" branch was unreachable duplicate code.
Removing it also drops a hardcoded backend name from shared code.

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

* polish(router): replace flm/cloud recipe-string checks with slot policy

find_flm_server_by_type -> find_coexisting_server_by_type matches on
SlotPolicy::CoexistByType; count_pinned_servers_by_type skips
SlotPolicy::Unmetered instead of recipe=="cloud". router.cpp now holds
zero backend-name string literals; both behaviors are unchanged (flm is the
only CoexistByType backend, cloud the only Unmetered one).

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

* polish(backends): descriptor flag for self-managed downloads, not recipe==flm

Add BackendDescriptor::self_manages_downloads (true only for flm) and
ModelManager::backend_self_manages_downloads(). The two load-time
auto-download guards in server.cpp/ollama_api.cpp now consult it instead of
hardcoding recipe != "flm". flm is the only backend with the flag set, so
behavior is identical.

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

* polish(backends): move local-import checkpoint scan into BackendOps

resolve_and_register_local_model() had a recipe if/else scanning the imported
directory for each backend's primary artifact (.gguf / .bin / genai_config.json
dir). Replace with BackendOps::find_imported_checkpoint(dir): default ""
registers the directory (sd-cpp/kokoro/moonshine); llamacpp reuses
resolve_gguf_path, whisper finds the .bin, ryzenai finds genai_config.json's
dir (and its resolve_checkpoint_path now reuses the same scan). server.cpp
holds no per-recipe import logic. Verified via local_import smoke tests for
llamacpp (ignores mmproj), whisper, and a default backend.

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

* fix(llamacpp): parenthesize numeric_limits::max() for MSVC

On Windows the merged include chain pulls in the windows.h max() macro into
this TU, turning std::numeric_limits<T>::max() into a syntax error (C2589).
Wrap the calls as (std::numeric_limits<T>::max)() so the macro cannot expand.

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

* fix(flm): mark backend dynamic_models so its models register

flm models come from flm's model_list.json at runtime (0 entries in
server_models.json), but the descriptor had dynamic_models=false, so
build_cache skipped flm's ops->discover_models() and flm models (e.g.
llama3.2-1b-FLM) never registered -> 404. The build_cache comment already
documents flm as a dynamic-discovery backend alongside cloud; align the
descriptor with that intent.

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

* polish(backends): move moonshine download file-selection into ops

model_manager's download path hardcoded recipe == "moonshine" to fetch a
variant directory of files. Add BackendOps::select_checkpoint_files (default
nullopt = the GGUF/direct-file defaults) and override it in MoonshineOps. The
download path no longer names a backend.

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

* polish(backends): move FLM unavailable-state machine into flm ops

system_info hardcoded a recipe == "flm" block to classify FLM's
supported-but-unavailable state (.deb/driver manual setup) and emit
troubleshoot links. Add BackendOps::classify_unavailable (default nullopt =
the generic installable/no-fetch path) and implement it in FlmOps. system_info
no longer names a backend in its install-state machine.

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

* polish(cli): drive bench backend override from descriptor, not recipe==llamacpp

bench hardcoded recipe == "llamacpp" to send the llamacpp_backend override.
Use the CLI-safe descriptor registry: any recipe with selectable_backend gets
its <config_section>_backend override (llamacpp and vllm today).

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

* polish(backends): move GGUF :variant registration check into llamacpp ops

model_manager hardcoded actual_recipe == "llamacpp" to require a :variant on
GGUF checkpoints at registration. Add BackendOps::validate_registration_checkpoint
(default accept) and implement the GGUF rule in LlamaCppOps. Verified: a GGUF
checkpoint without :variant is still rejected; other recipes are unaffected.

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

* polish(backends): make_server<T> helper + collapse redundant namespaces

DRY pass across the backend folders:
- Add backends::make_server<T>(ctx) for the standard (log_level, model_manager,
  backend_manager) construction; the 6 plain create() bodies now call it instead
  of repeating the three context fields. cloud/ryzenai keep bespoke create().
- Each *_server.h closed and re-opened namespace lemon::backends just to nest the
  per-backend namespace; nest it inline instead (8 headers). ryzenai is left as-is
  (its legacy RyzenAIServer lives in namespace lemon, not lemon::backends).

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

* polish(backends): make_spec<T>/single_ops<T> helpers shrink spec()/ops()

The per-backend spec()/ops() are the name-based adapter the CMake codegen binds
(<stem>::spec/ops), so the functions must exist — but their bodies were
repetitive. Add make_spec<T>(descriptor[, split]) (backend_utils.h, where
BackendSpec is complete) and single_ops<T>() (backend_registry.h, next to
make_server) so the 7 standard spec() and 7 custom ops() collapse to one line
each. ryzenai (install key != recipe) and cloud (no spec) keep bespoke spec();
sd-cpp/vllm keep default_backend_ops(). Pure refactor — registry binding,
71/71 endpoints, and all-backends-registered smoke unchanged.

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

* docs(nav): add Adding a Backend + Backends Reference to mkdocs nav

The two backend dev docs added by this work (dev/adding-a-backend.md and the
generated dev/backends-reference.md) were not wired into the Development nav.

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

* feat(config): generate defaults.json from descriptors via /internal/config/defaults

Per-recipe config defaults are now declared in each backend descriptor
(takes_args / arg_variants / bin_variants / config_extra -> config_defaults())
instead of hand-maintained blocks in defaults.json. The committed
resources/defaults.json stays fully populated (so it remains the discoverable
reference for factory defaults) but is now generated:

- New GET /internal/config/defaults emits the canonical default config
  (ConfigFile::base_defaults(): global keys + descriptor-derived per-recipe
  sections, host/deployment-independent). Documented alongside /internal/config.
- gen_backend_docs.py -> gen_backend_boilerplate.py, which mirrors that endpoint
  verbatim into resources/defaults.json (whole-file) in addition to the doc
  regions. The existing CI --check now also fails if defaults.json drifts.

config_file keeps reading defaults.json at runtime; base_defaults() re-seeds the
descriptor blocks so the descriptor stays authoritative even if the file lags.
Verified: a fresh config.json reproduces every prior default; endpoints 71/71;
generator --check clean; black clean.

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

* polish(cli): branch hf pull on repo_kind, not recipe==llamacpp

The single-installable-unit path keyed off recipe != "llamacpp"; switch it to
repo_kind != "gguf", the same server-provided classification the function
already uses for the collection branch. Behavior-equivalent (collections are
handled earlier, so by here repo_kind is gguf or onnx-ryzenai), and it drops the
last backend-name literal from hf_pull.

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

* refactor(backends): functional-only comments; complete, alphabetical website model list (#2320 review)

Address Geramy's review on #2320:

- Comments: sweep every backend file to functional-only, removing commentary
  that narrates self-explanatory code or references backends/flows it can't
  know about (net ~330 comment lines cut). Short purpose comments on
  declarations and genuine WHY/invariant notes are kept.
- Website model list: drop the per-backend `web_priority` descriptor field
  (a 0-default that silently dropped backends like moonshine and vllm) and
  instead list every descriptor-backed recipe, ordered alphabetically by
  display name — a new backend can no longer be accidentally excluded.
- CMakeLists: move the authoritative LEMON_BACKENDS list near the top; the
  codegen foreach stays where it was.

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

* docs: document descriptor generator; add defaults.json generated-marker

Add a Key Files entry for gen_backend_boilerplate.py listing the artifact
classes it regenerates, and a top-level "_generated" sentinel in
defaults.json so anyone opening the file sees it is generated.

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

* Small moonshine fix

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-29 19:35:20 +00:00