---
name: exlr8-quant
description: Subscribe a GPU machine to volunteer exlr8 quantization work from campfire.kindlingai.dev. Check which encode jobs have open work, fetch the model weights they need, and keep the exlr8enc encoder image running so it takes work as it opens.
---

# exlr8 quant: subscribe a machine to encode work

campfire.kindlingai.dev hands out exlr8 encode work in (job, layer, expert) slots (one at a time, or in batches of
compatible slots for multi-expert GPU runs). A subscribed machine runs the exlr8enc image in watch mode: it claims a
batch of slots, encodes them on the GPU, uploads the pieces, and waits while nothing is open. One slot takes minutes; a
job has thousands.

## What the user must provide

- An API key. A human logs in with GitHub at https://campfire.kindlingai.dev, waits for an admin to approve the account,
  and makes a key under "API keys" on a project's page. You cannot make one. Keep it in a file with mode 600. Send it
  only to https://campfire.kindlingai.dev, as the header "Authorization: Bearer KEY". Never print it.
- A machine with an NVIDIA GPU, Docker and the NVIDIA container toolkit. The published image is linux/arm64, built
  for GB10 (DGX Spark).
- Disk for each model's checkpoint. They are large: check the size and ask the user before a download.

## 1. See what work exists

~~~bash
curl -s https://campfire.kindlingai.dev/api/jobs
~~~

A JSON array with one entry per active job. The fields that matter:

- job, title: the job's name.
- open: slots that can be claimed now. Work is available when open is above 0.
- closed, not_ready: slots that will open later.
- weights: {hf, revision, id}, the checkpoint the job encodes. hf and revision name it on the Hugging Face Hub. id
  is the sha256 of its config.json followed by its model.safetensors.index.json.

The reply is public and cached for 20 seconds. Poll it every 5 to 15 minutes, not faster.

## 2. Fetch the weights of the jobs to work on

~~~bash
hf download WEIGHTS_HF --revision WEIGHTS_REVISION --local-dir /models/NAME
cat /models/NAME/config.json /models/NAME/model.safetensors.index.json | sha256sum
~~~

The hash must equal the job's weights.id. If it does not, the checkpoint is another revision and its pieces are
refused.

## 3. Subscribe

~~~bash
docker pull ghcr.io/kindlingai/exlr8enc:latest
docker run -d --name exlr8enc --restart unless-stopped --gpus all \
  -v /path/to/key.txt:/key:ro -v /models:/models:ro \
  ghcr.io/kindlingai/exlr8enc:latest \
  site --watch --key-file /key --bf16 /models/NAME
~~~

Give one --bf16 for each checkpoint on disk. The encoder takes slots from every active job that encodes one of those
checkpoints, including jobs added later, and polls every 5 minutes while none is open. Add --job JOB to work on one
job only.

Without --watch the encoder exits with status 0 once nothing is open. A harness that prefers its own scheduler runs
that form (docker run --rm, no --restart) whenever step 1 shows open above 0.

If the pull is denied, the image is private to the kindlingai GitHub organisation: the user runs docker login
ghcr.io with a token that has read:packages.

Without Docker, run the npm release instead, under the harness's own service manager. It needs Node 18 or newer,
Linux on arm64 (GB10) or x64 (RTX 50-series), the NVIDIA driver and glibc 2.39 or newer:

~~~bash
npx -y @kindlingai/exlr8-quant@latest site --watch --key-file /path/to/key.txt --bf16 /models/NAME
~~~

@latest makes npx check for a newer release on every start, so restarting it is how to take one, including after a
426.

Without Node, the exlr8-quant script does the same with the newest build of kindlingai/exlr8enc main (it needs curl
and sha256sum). It downloads a build only when main has moved:

~~~bash
curl -fsSL -o exlr8-quant https://campfire.kindlingai.dev/exlr8-quant.sh && chmod +x exlr8-quant
./exlr8-quant site --watch --key-file /path/to/key.txt --bf16 /models/NAME
~~~

## 4. Keep it healthy

Read the container's log with docker logs exlr8enc. It prints one line per uploaded piece, and "waiting 300 s: ..."
while idle.

- "claim refused (426)": the site no longer accepts this encoder build; the message names the lowest encoding version
  it takes. Pull the image again and recreate the container, or restart the npx or exlr8-quant run.
- "you hold N claim(s), the limit": a stopped run keeps its claims for 12 hours. List them with GET /api/claims and
  give one back with DELETE /api/claims/JOB/LAYER/EXPERT (or all at once with DELETE /api/claims), both with the key.
  The user can do the same under "Your claims" on the site.
- A job appears in step 1 whose weights.id is not on disk: do step 2, then recreate the container with one more
  --bf16.
- Any other exit: the log's last line is the site's reason. Report it to the user rather than retrying blindly.

## Unsubscribe

~~~bash
docker rm -f exlr8enc
~~~

Then give back the claims it held, as above.

## As a scheduled check

Every 15 minutes: fetch step 1's list. Start the container if it is not running. Tell the user when a job has work
(open, closed or not_ready above 0) for weights that are not on disk, with the download's size, before fetching.
