(very WIP!) Fast LLM inference in Rust & CUDA doll.tngl.io/firecrest
firecrest docs operations.md
31 kB 661 lines
Markdown
at main

Operating Firecrest #

The runbook for running the firecrest server on one machine: how to build a release, configure, start, check, change and upgrade the server, and what to look at when it misbehaves. The examples use neutral locations (/usr/local/firecrest/releases/NAME, /etc/firecrest/firecrest.toml, /var/lib/firecrest); any others work.

Files #

Path What
RELEASES/NAME/ One immutable release; NAME is firecrest-VERSION-COMMIT
Launcher A small script whose release= line selects the release that runs (see Start and stop)
CONFIG Server and model configuration, for example /etc/firecrest/firecrest.toml
POLICY_DIR/ Policy scripts ([policy] dir), watched and reloaded on change
MODEL_DIR/ Weights (DeepSeek-V4.1-Flash-1017-MXFP4.gguf, optionally DeepSeek-V4.1-Flash-1017-Vision.gguf)
ADAPTER_DIR/ Adapter files ([model.options.adapters] dir)
STATE_DIR/ Engine state (state_dir, default /var/lib/firecrest): deepseek-v4.1-flash/context/ (context store disk tier), replay.bin (generation memory)

Building #

A release #

scripts/release.sh builds a release directory from a commit:

scripts/release.sh --commit origin/main --dry-run       # what it would do
scripts/release.sh --commit origin/main --prefix RELEASES
scripts/release.sh --allow-dirty --prefix /tmp/fc-test  # test build of the working tree

--commit exports exactly that commit with git archive, so uncommitted work in the checkout cannot reach a release. Without --commit the script builds HEAD and refuses a dirty working tree; --allow-dirty builds the working tree as it is and records the difference in SOURCE.diff. The prefix is --prefix or $FIRECREST_RELEASE_PREFIX. The script builds the console (npm ci, npm run build in ui/), builds firecrest-cli with every engine feature the CLI declares (gpu, vision; --features overrides), runs the tests that need neither a GPU nor model files (--no-tests skips them), and refuses to replace an existing release. It needs nvcc under $FIRECREST_CUDA_HOME or $CUDA_HOME (default /usr/local/cuda), Node and npm.

firecrest-0.1.0-abc1234/
  bin/firecrest      the server, with the console (ui/dist) and the CUDA kernels embedded
  SOURCE             repository, commit, branch, dirty flag (and SOURCE.diff for a dirty test build)
  BUILD              toolchain versions, features, profile, tests run, run-time libraries
  BUILD.log          the full build and test log
  README             how to verify, run and roll back
  SHA256SUMS         every other file
  share/doc/         this runbook, the server and engine READMEs, policies and adapters
  share/examples/    the engine's example configurations and the example policy scripts

A release is read-only once written. Verify one:

cd RELEASES/NAME && sha256sum -c --quiet SHA256SUMS && bin/firecrest version

firecrest version prints the version and the engine kinds the binary contains (mock, dsv41, smollm3, qwen3.6 and proxy in a default build).

A plain build #

(cd ui && npm ci && npm run build)        # optional: the console, embedded when ui/dist exists
cargo build --release -p firecrest-cli --features gpu,vision
target/release/firecrest version

gpu adds the CUDA backend of the DeepSeek V4.1 engine and vision the image encoder. The kernel build finds nvcc through NVCC, CUDA_HOME, CUDA_PATH, /usr/local/cuda* or PATH. FIRECREST_CUDA_ARCH selects the architecture of the embedded PTX (default sm_80) and FIRECREST_CUDA_SASS the SASS targets of the kernel image (default 80,86). FIRECREST_CONSOLE_DIST points the build at another console directory.

A build in the development container #

scripts/devrun.sh builds in a container made from scripts/dev/Containerfile: the CUDA toolkit image nvidia/cuda:13.4.3-devel-ubuntu24.04 plus a C toolchain and rustup. The host needs Podman or Docker, the NVIDIA driver and, for GPU access inside the container, the NVIDIA Container Toolkit (CDI for Podman). The host needs neither nvcc nor Rust.

scripts/devrun.sh build                    # cargo build --release -p firecrest-cli --features gpu,vision
target/dev-cuda13.4.3/release/firecrest version
scripts/devrun.sh run cargo test -p firecrest-cuda --test gpu
scripts/devrun.sh shell

The checkout is mounted at its own path. The Rust toolchain from rust-toolchain.toml and the Cargo registry are kept in $XDG_CACHE_HOME/firecrest-dev (FIRECREST_DEV_CACHE) and the build output in target/dev-cudaVERSION, both on the host, so rebuilds are incremental and the binaries run on the host. FIRECREST_CUDA_SASS defaults to the compute capabilities that nvidia-smi reports. The toolkit release must not be newer than the CUDA version the driver reports, or the driver cannot load the embedded PTX; FIRECREST_DEV_CUDA_IMAGE selects another base image.

To edit on one machine and build on another, set FIRECREST_DEV_REMOTE=HOST:DIR in the environment or in the untracked scripts/devrun.local. scripts/devrun.sh sync copies the working tree to DIR with rsync (without .git and the paths .gitignore lists, which are also kept on the remote side), and scripts/devrun.sh remote build syncs and then runs scripts/devrun.sh build there. scripts/devrun.sh --help lists the settings.

Run-time requirements #

The binary needs libc and the other libraries ldd lists (recorded in a release's BUILD), the NVIDIA driver's libcuda.so.1, and cuBLAS (libcublas.so.13) for the GPU backend; both are opened with dlopen. cuBLAS is looked up in $CUDA_HOME/lib64 and $CUDA_PATH/lib64 first, then in /usr/local/cuda/lib64, the versioned /usr/local/cuda-* directories and the loader path. Neither the source tree, Node nor nvcc is needed at run time.

The DeepSeek V4.1 engine keeps the routed experts (about 270 GiB) in host memory through the mapped model file, so the machine needs that much RAM for the page cache beyond the context store's host budget (store.host_ram_bytes). The reference machine has two RTX 3090 24 GB cards, a Xeon Gold 6152 and 6 × 64 GB of DDR4-2400 (the operating system sees 376 GiB).

Configuration #

The file format is in crates/firecrest-server/README.md (server keys, [policy], [[model]]) and engines/deepseek-v4.1/engine/README.md (the [model.options] of a dsv41 model; unknown keys are errors), and engines/smollm3/engine/README.md (those of a smollm3 model) and engines/qwen3.6/engine/README.md (those of a qwen3.6 model). A configuration for the GPU backend on two GPUs:

api_listen = "127.0.0.1:7080"
admin_listen = "127.0.0.1:7081"
state_dir = "/var/lib/firecrest"
default_model = "deepseek-v4.1-flash"

[policy]
dir = "/etc/firecrest/policies"

[[model]]
id = "deepseek-v4.1-flash"
engine = "dsv41"
autoload = true
gpus = [0, 1]

[model.options]
model = "MODEL_DIR/DeepSeek-V4.1-Flash-1017-MXFP4.gguf"
vision = "MODEL_DIR/DeepSeek-V4.1-Flash-1017-Vision.gguf"   # optional
backend = "gpu"                 # the default is the slow CPU reference
profile = "balanced"
slots = 4

[model.options.placement]
devices = [0, 1]

[model.options.cpu]
expert_cpus = "0-13"            # the CPU expert pool; adjust to the machine

engines/deepseek-v4.1/engine/examples/gpu.toml (in a release: share/examples/gpu.toml) is a fuller example. Check a file with the release that will run it:

RELEASE/bin/firecrest config check CONFIG

config check validates the server keys, the engine kinds and every model's [model.options] through its engine (a dsv41 block is parsed and checked as at load, without opening the model files) and exits 2 on an invalid file. The server runs the same check at start and on PUT /api/config. Files that are opened only at load (the GGUF, adapters) are checked when the model loads.

Changes through PUT /api/config (the console's Config view) are validated, written by rename and applied live where they can be: default_model, load_on_demand, capture_bodies, trusted_proxies, api_keys, fetch_remote_images, shutdown_grace_s and model settings other than engine and options. The answer lists the rest under needs_restart. Keeping the file under version control makes console edits reviewable.

Profiles: speed against accuracy #

A dsv41 model trades accuracy for speed through one setting, profile (design: architecture, "Profiles"). Each profile sets six knobs:

Knob accurate balanced (default) speed
decode routing exact: every expert the router picks is computed skip: a pick that is not in the device expert cache is dropped when its share of the token's routing weight is under 0.20, at most 3 per token and layer, the kept weights not renormalized skip at 0.30, at most 4, not renormalized
decode steering off off off (a knob: "steer": {"lambda": 0.4, "protect": 1} makes an expert in the device cache win against one that is not when its score is within 0.4, after the model's first pick; see the approximation ledger)
prefill routing exact exact exact
prompt-window steering off off (a knob: "prefill_steer": {"lambda": 0.2, "protect": 1, "min_rows": 4, "exempt_tail": 8, "favoured": "resident"}; it lost MMLU items against accurate, ledger row 12) a bonus of 0.4 over a prompt window's rows after the model's first pick, favouring the residents and the experts the window's own rows pick ({"lambda": 0.4, "protect": 1, "min_rows": 4, "exempt_tail": 8, "favoured": "resident"})
suffix-cache reuse off: an edited prompt reuses only its exact prefix on: the context after an edit is relocated and reused instead of recomputed on
approximate band off: rewinds rebuild state by exact replay off off (not measured yet)

What changes for clients: accurate is the model's own output; balanced uses the threshold and drop count of ds4's skip rule, without renormalization (faster decode when the expert cache misses, cheaper agent loops after edits); speed also steers prompt processing. Every approximation, what it buys, what it costs as measured and which profile it belongs to is in the approximation ledger; the benchmark suite in bench/ fills its numbers.

Contexts computed under different knobs never share cache: decode and prefill routing are part of a session's lineage. Switching profiles costs the next request a fresh prefill, nothing else.

Where to set it, most specific last:

  • Per model, in the model block: profile = "accurate" under [model.options]. Explicit knobs override the profile for that model: [model.options.routing] (decode), prefill_routing, steer, prefill_steer (a table, or false for off) and store.suffix_reuse.
  • Per request, in the request body's engine object: "engine": {"profile": "speed"}; "engine": {"routing": "exact"} or "engine": {"steer": null} overrides one knob on top of whichever profile applies (null turns steering off). A request profile replaces the model's; the request's own knobs apply on top of it.
  • The balanced rule before 2026-11-27 (skip renormalized, no steering) through knobs alone: per request "engine": {"routing": {"mode": "skip", "threshold": 0.2, "max": 3, "renorm": true}, "steer": null, "prefill_steer": null}; per model steer = false, prefill_steer = false and [model.options.routing] mode = "skip", threshold = 0.2, max = 3, renorm = true.
  • From a policy script: set_engine_option("profile", "accurate") in on_request (policies), for example by client, model alias or header.

The active profile and knobs are in /api/models/ID (info.details and status.extra: profile, knobs, profiles), in /v1/models (profile, profiles), on the console's model page (the profile chip lists the knobs) and in firecrest status. Every request-log row is tagged with the profile and the knobs it ran under (tags.profile, tags.knobs). The console's Chat playground has a profile selector.

Image encoding #

vision_device under [model.options] chooses where images are encoded:

Value Effect
auto (default) on a GPU when the model runs on CUDA devices (device 0 when it is in the placement, else the first placed device); on the CPU with the CPU-reference backend
gpu on a GPU; device 0 with the CPU-reference backend
cpu on the CPU encoder

A GPU encode takes 0.1 s for a small image to 1.2 s for full HD (the CPU encoder needs 3 to 34 s on 14 threads), and borrows 0.4 to 1.6 GiB of device memory for that time only. The GPU compute keeps vision_reserve_bytes (default 1.75 GiB, enough for the largest image the model accepts) outside its arena on every rank for this. With vision_device = "cpu" the reserve is 0 and that memory goes to the expert cache; vision_reserve_bytes sets another size. When a GPU encode fails for any reason (out of memory, a driver error), that image is encoded on the CPU instead and a vision.gpu_fallback warning is logged; status.extra.vision counts gpu_encodes and cpu_fallbacks.

GPU and CPU embeddings of the same image differ by rounding only, within the model's own run-to-run noise (measured in the firecrest-dsv41-vision-gpu README), so by default they share the image fingerprint (vision_shared_fingerprint = true) and cached context built with either is reused for the other. Encoded images are also cached by content, so a repeated image costs nothing. usage.timings.image_s reports the encode time of each request.

Start and stop #

A service manager runs the server through a launcher, a script whose release= line selects the release and which execs firecrest serve -c CONFIG:

#!/bin/sh
# /usr/local/firecrest/firecrest-launch
release=/usr/local/firecrest/releases/firecrest-0.1.0-abc1234
export CUDA_HOME=/usr/local/cuda          # searched first for libcublas.so.13
exec "$release/bin/firecrest" serve -c /etc/firecrest/firecrest.toml

A systemd unit for it:

# /etc/systemd/system/firecrest.service
[Unit]
Description=Firecrest model server
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
ExecStart=/usr/local/firecrest/firecrest-launch
User=firecrest
Group=firecrest
StateDirectory=firecrest
# shutdown_grace_s plus the time to save idle sessions to the disk tier
TimeoutStopSec=120
Restart=on-failure

[Install]
WantedBy=multi-user.target

The user needs read access to the model files, the policy directory and the GPU device nodes. systemctl start firecrest, systemctl stop firecrest and journalctl -u firecrest -f then start, stop and follow it.

The server sends READY=1 (sd_notify) once both listeners are bound; the autoload model then loads in the background, so the unit is active before the model is ready. On SIGTERM it sends STOPPING=1, stops taking requests, gives requests in flight shutdown_grace_s (default 30 s), saves idle sessions to the disk tier and frees the devices and pinned memory. A second signal exits at once. Exit codes: 0 after a clean stop, 2 for configuration or listen errors, 1 otherwise.

Without a service manager (the mock, or a test configuration on spare ports):

RELEASE/bin/firecrest serve --mock --api-port 17380 --admin-port 17381 --no-gpu-stats
RELEASE/bin/firecrest serve -c FILE [--api-listen ADDR] [--admin-listen ADDR] [--log-level debug]

Health and status #

Check Expect
curl -s 127.0.0.1:7080/health {"status":"ok"}; 503 loading while an autoload model loads, draining while stopping
curl -s 127.0.0.1:7080/v1/models deepseek-v4.1-flash with its context length
RELEASE/bin/firecrest status --config CONFIG models, GPUs, rates, recent requests
… status --watch the same, redrawn every second
curl -s 127.0.0.1:7081/api/state | jq the snapshot the console's overview shows

firecrest status reads admin_listen from the config (or --admin URL, or $FIRECREST_ADMIN). Colour on a terminal; plain when piped or with NO_COLOR.

The addresses above are the default listeners (api_listen 127.0.0.1:7080, admin_listen 127.0.0.1:7081). A real request:

curl -sN http://127.0.0.1:7080/v1/chat/completions -H 'content-type: application/json' \
  -d '{"model":"deepseek-v4.1-flash","stream":true,"max_tokens":32,
       "messages":[{"role":"user","content":"What is 12 + 5?"}]}'

Every usage object carries the engine's timings (queue_s, image_s, restore_s, prefill_s, decode_s, ttft_s, engine_ttft_s), prefill_tps and decode_tps.

Console #

The admin listener (127.0.0.1:7081) serves the console: overview, models (placement, slots, adapters), requests with timings, logs, stats (24 hours of history), policies (edit, test, enable), chat and config. It has no login of its own, so the admin listener belongs behind an authenticating reverse proxy, or on loopback only. /api/* is the management API (docs/design/01-management-api.md). The API listener can require keys (api_keys, sent as x-api-key or a Bearer token).

Changing the GPU set live #

Placement is the ordered list of tensor-parallel ranks: every rank holds every layer, so a change adds or drops a rank and copies the sessions to it. To move between both GPUs and one:

firecrest placement deepseek-v4.1-flash 0      # follows the operation, exit 0 when done
firecrest placement deepseek-v4.1-flash 0,1
curl -s -X POST 127.0.0.1:7081/api/models/deepseek-v4.1-flash/placement -d '{"devices":[0]}'

firecrest placement takes --admin URL or --config FILE like status, and --no-wait to return after the request. The API answers 202 with an operation id; progress is on the live feed and in GET /api/operations/ID. Requests in flight stall for the change (a few seconds; the engine keeps the sessions) and then continue. The console's model page has the same control (choose the GPU set, then confirm with a second click) with its progress, and both it and /api/models/ID show the last change (last_placement: from, to, seconds, error). [model.options.placement] in the file sets the placement at load; a live change lasts until the next start.

Model switching #

Several models can share the GPUs. Each model block can claim GPUs and say what to do when it is idle:

[[model]]
id = "big"
engine = "dsv41"
gpus = [0, 1]          # never hot at the same time as another model claiming GPU 0 or 1
priority = 10          # who may push whom off the GPUs
idle_warm_s = 900      # after 15 min without requests: release VRAM (residency warm)
idle_unload_s = 7200   # after 2 h: unload completely

Residency levels: hot (weights on the GPUs, serving), warm (VRAM released, host state kept, a quick promotion back) and cold (unloaded). A dsv41 model detaches its sessions to host memory when it goes warm and attaches them again when it is hot. An engine that cannot be warm is unloaded where warm is asked for.

A request for a model that is not hot loads it, or promotes it from warm, once its GPUs are free. A hot model that claims an overlapping GPU is first released (moved to warm, or unloaded) when it is idle and its priority is not higher than the requester's. A model that is serving requests is waited for until it is idle, and a higher-priority one until its own idle policy releases it; requests wait meanwhile (shown as waiting_requests and waiting_for on the model, and in the console's Lifecycle card) and fail with 503 after switch_wait_s (server setting, default 600). Switches happen one at a time. Models without a GPU claim (proxy models, CPU engines) are never switched out. last_switch records the last release (to warm or cold, why, how long it took).

Manual control: POST /api/models/ID/load ({"residency": "hot" | "warm"}) and /unload, the console's model page, and firecrest status to watch.

Fronting another engine or runtime #

Each [[model]] names its engine kind. Engine crates register their kinds in the firecrest binary (factories() in crates/firecrest-cli/src/main.rs, one line per kind behind a cargo feature). A runtime Firecrest does not implement is fronted with the built-in proxy kind:

[[model]]
id = "coder"
engine = "proxy"
gpus = [1]             # the GPUs the external runtime uses, if Firecrest should switch around it
[model.options]
base_url = "http://127.0.0.1:8300"
api = "openai"         # or "anthropic"
upstream_model = "qwen3-coder"

Requests to it go through the same front as local models (keys, request log, policies, metrics) and are forwarded with their streams intact. The external runtime keeps running on its own; Firecrest only routes, accounts and health-probes it (ready or degraded). Unloading a proxy model stops the routing, not the runtime.

Adapters #

Adapters load at start from [model.options.adapters] (dir scanned for *.safetensors, then the preload list). A request without adapters or steering gets the model's default set (the adapters with a nonzero default scale); "adapters": [], "adapters": null or "steering": [] gets none; "adapters": [{"name": "steer-v1", "scale": 1.5}] picks an adapter and a scale. The formats, the math and a worked example are in adapters.

curl -s 127.0.0.1:7081/api/models/deepseek-v4.1-flash/adapters | jq
curl -s -X PATCH 127.0.0.1:7081/api/models/deepseek-v4.1-flash/adapters/steer-v1 -d '{"default_scale": 0}'   # out of the default set, live
curl -s -X POST 127.0.0.1:7081/api/models/deepseek-v4.1-flash/adapters \
  -d '{"name": "NAME", "path": "ADAPTER_DIR/NAME.safetensors", "default_scale": 0}'

Live changes last until the process restarts; the file decides what loads at start. Sessions record the adapter set's content fingerprint, so a changed adapter never reuses old cached state.

Policies #

Scripts in POLICY_DIR/ run around every request in file-name order (policies); a release carries the examples in share/examples/policies/. The directory is watched and a changed file is reloaded within two seconds; a file that fails to compile keeps its previous version running. NAME.py.disabled turns a script off. GET /api/policies lists scripts with their errors, call counts and mean time.

State and cache #

STATE_DIR/ holds:

  • deepseek-v4.1-flash/context/: the context store's disk tier (tier 3), checkpoints of idle sessions, bounded by store.disk_bytes (default 80 GiB). The store evicts least recently used checkpoints itself.
  • replay.bin: the generation memory (exact turn replay), written on shutdown, bounded by replay_memory_bytes (default 512 MiB).
  • deepseek-v4.1-flash/context/expert-popularity.bin: how often each expert was used, saved by the engine and read at start to warm the GPU expert caches. Without it the next start begins with a cold expert cache.

Everything there is rebuildable: losing it costs prefill time, not correctness. To drop cached contexts while running:

curl -s -X POST 127.0.0.1:7081/api/models/deepseek-v4.1-flash/control -d '{"op":"cache.clear"}'

To empty the disk tier, stop the service first, then remove STATE_DIR/deepseek-v4.1-flash/context. Sessions computed under another routing mode, adapter set or weights never match (they are part of the lineage), so configurations that differ only in those can share the directory.

Measuring speed #

firecrest bench measures an engine's prefill and decode speed from the same model block firecrest serve reads. It loads the engine in-process, without the HTTP server, and drives it through the engine interface, so every engine is timed the same way.

firecrest bench -c CONFIG [-m MODEL] -p 512,2048 -n 128 [--pg 512,128] [-d 0,8192] [-r 5] \
    [-o profile=balanced -o profile=accurate] [--jsonl results.jsonl]
firecrest bench compare A.jsonl B.jsonl
firecrest bench --mock -p 512 -n 16 -r 3        # the mock engine, to try the tool

The tests follow llama-bench's names:

Test Request tok/s
ppN N prompt positions, one generated token positions prefilled / time to first token
tgN a 16-position prompt (or the depth), N generated tokens (tokens - 1) / time from first to last token
ppN+tgM (--pg N,M) N prompt positions, M generated tokens (N + M) / time from submission to the last token

With -d D, each test runs at a depth of D positions. For pp and pg tests, an untimed first request prefills the D positions. The timed request extends that prompt by N positions, so the engine prefills only those N. A test fails, and the bench exits non-zero, when the engine does not reuse the D positions from its cache. A tg test at depth D decodes after a D-position prompt.

Every value of -p, -n, --pg and -d is combined with every option set given by -o. Each -o is one set, KEY=VALUE[,KEY=VALUE...], merged into the block's [model.options]. Dotted keys nest (scheduler.prefill_batch=4), and each value is read as JSON, or as a string when it is not JSON. The engine is loaded again for each set. Each test runs --warmup times (default 1) unmeasured, then -r times (default 5). The table gives the mean, standard deviation and median of tokens/s and the time to first token (TTFT) over the measured runs.

Requests reset the cache and sample greedily with a fixed seed, and they set ignore_eos, so repeated runs do the same work. A run that ends early prints a warning with the token count. Prompts are token ids drawn from the vocabulary with --seed (default 42), special tokens excluded. A routed-expert engine routes such tokens differently from real text, which changes its expert-cache hit rate. --text FILE uses the file's tokens instead, repeated to length.

The table goes to stdout. --jsonl FILE appends one JSON line per test, which records:

  • the build's commit and whether the tree had uncommitted changes (FIRECREST_COMMIT from scripts/release.sh, otherwise git at build time);
  • the engine, the model id, the options and the load time;
  • the model file's path, size and BLAKE3 digest (of the size and the first and last 64 MiB; --full-digest hashes the whole file);
  • the GPUs and driver from nvidia-smi, the CPU model, the CPUs the process may use and the host RAM;
  • every measured value and the engine's own timings for each run.

firecrest bench compare A.jsonl B.jsonl prints the change of the mean tokens/s for each row the two files share, with the noise, sqrt(sd_A^2/n_A + sd_B^2/n_B) / mean_A. A change no larger than twice the noise is marked ~: at these repeat counts it cannot be told apart from run-to-run variation.

On a shared machine the bench follows the tests' conventions. With FIRECREST_GPU set to GPU indices, it exits with an error when the model block's gpus include another GPU. Under FIRECREST_FUNC=1 it runs each test once without warm-up and labels the output as a functional run, and the DeepSeek engine applies its small functional profile. It runs one sequence at a time and does not measure concurrent decode across slots.

bench/ holds a different tool: it measures whole agentic workloads and quality gates through the HTTP API.

Logs and metrics #

  • Logs: stderr (--log-level debug|info|warn|error), captured by the service manager (journalctl -u firecrest). The same events are in the console's Logs view and GET /api/events.
  • Request log: the last request_log_size (default 1000) requests with timings, adapters and tags, in the console and GET /api/requests. Bodies only with capture_bodies = true.
  • Prometheus text at /metrics on both listeners.
  • History: the console's Stats view shows 24 hours of samples the server takes once a second (GET /api/history); engines add series through gauges named series_<name>.

Upgrade and roll back #

  1. Build a release from a pushed commit: scripts/release.sh --commit origin/main --prefix RELEASES. Check SOURCE, BUILD (tests passed, kernels and console embedded) and sha256sum -c SHA256SUMS.
  2. RELEASE/bin/firecrest config check CONFIG with the new release. If the release changes configuration keys, prepare the new file beside the old one and switch both together.
  3. Point the launcher's release= line at the new directory (write by rename). Nothing reads it until the next start.
  4. Wait until no requests are in flight (firecrest status), then restart the service.
  5. Verify: /health, GET /api/state shows the new server.commit, a real streaming chat, and the console.

Roll back by pointing release= at the previous directory and restarting. Keep at least the previous release in place; remove older ones by hand (chmod -R u+w DIR && rm -rf DIR, since releases are read-only).

Troubleshooting #

Model fails to load #

firecrest status and the model's error in /api/models/ID give the reason. Missing or unreadable files (the GGUF, the vision GGUF, an adapter) are reported at load, not by config check. A dsv41 model with backend = "gpu" needs a binary built with the gpu feature (and vision for a vision file); firecrest version and a release's BUILD list the features. The machine needs host memory for the mapped experts and the context store's host budget (see Run-time requirements): check free -h, and lower store.host_ram_bytes when it does not fit. host_registration = false keeps the engine from page-locking the host experts.

GPU busy #

The engine fails with an out-of-memory error on a device, or the model waits for its GPUs. nvidia-smi shows which process holds a GPU. Another model of the same server that claims the GPU is released only when it is idle and its priority allows it (see Model switching); a process outside the server has to stop, or the model moves to the free GPU (firecrest placement deepseek-v4.1-flash 1).

Slow first request #

The first requests after a start read experts from host RAM until the per-GPU expert caches fill (they start warm from expert-popularity.bin when a previous run saved it), and an empty context store means a full prefill. Until the background expert registration is done (see status.extra.backend.compute.registration), uploads of unregistered experts are pageable copies at 6 to 9 GB/s instead of 12.3 GB/s. The first long prompt is therefore slower than the same prompt later.

Health stays loading #

firecrest status shows the load progress and message. The model reports ready after the dense upload, the executor and cache build and the cache warm start; reading about 270 GiB of experts into a cold page cache takes minutes. Page-locking the expert pages happens afterwards, in idle time, and does not hold /health. A health check in front of the server needs a start-up allowance of that order.