Cited llama.cpp + systemd · not a measured service card
Run llama.cpp as an always-on local AI server on Linux
Shoppers want a 24/7 llama-server the way local desktop serves Hermes, Open WebUI, coding tools, and phones — without leaving a terminal open. This AMDai page is the Linux systemd unit for one house 35B on loopback. llama.cpp Vulkan first. Dual-card systemd pins stay on /setup/multi-gpu — this page extends those notes, it does not copy them. Overnight decode lives on /gpus/r9700 and /benchmarks (llama-bench, not a service tok/s).
- Ubuntu setup (measured)
- Multi-GPU llama.cpp
- Docker / Podman
- Open WebUI
- Coding assistant
- Ollama
- LM Studio
- Fedora setup
- Arch setup
- Windows setup
- Serve Qwen
- Harnesses
- Parallel slots
- Flash Attention
- Prompt cache
- R9700
- Benchmarks
- Getting started
House unit
One GPU, Vulkan llama-server, house 35B. Replace the binary, GGUF, and
User= login. systemd.service documents Type,
ExecStart, Restart, and User.
# Example only — not a measured local desktop service.
# /etc/systemd/system/llama-server.service
# Copy house flags from /tutorials/serve-qwen. Replace the binary and GGUF paths.
[Unit]
Description=llama-server house 35B on loopback
After=network-online.target
[Service]
Type=simple
User=YOUR_LOGIN
ExecStart=/path/to/llama.cpp/build-vk/bin/llama-server -m /path/to/nvme/Qwen3.6-35B-A3B-UD-Q5_K_XL.gguf -ngl 99 -c 262144 --cache-type-k f16 --cache-type-v f16 --jinja -np 1 --host 127.0.0.1 --port 8080
Restart=on-failure
[Install]
WantedBy=multi-user.target
sudo install -m 0644 llama-server.service /etc/systemd/system/llama-server.service
sudo systemctl daemon-reload
sudo systemctl enable --now llama-server
systemctl status llama-server
journalctl -u llama-server -f
curl -s http://127.0.0.1:8080/health
curl -s http://127.0.0.1:8080/v1/models
Zero to always-on
-
1 · Cited llama.cpp + systemd · not a measured service card
Get tokens on loopback before you write a unit
Ubuntu 24.04+ bare metal is the measured AMDai path. Build llama.cpp Vulkan, load Qwen3.6-35B-A3B-UD-Q5_K_XL.gguf on one R9700, and confirm curl http://127.0.0.1:8080/v1/models from /tutorials/serve-qwen. systemd does not fix a binary that never generated. House flags: -ngl 99 -c 262144 --cache-type-k f16 --cache-type-v f16 --jinja --host 127.0.0.1 --port 8080. llama.cpp first. Q6/Q5/Q4 recommended; Q3 is a labeled estimate. Q1/Q2 stay off.
-
2 · Cited llama.cpp + systemd · not a measured service card
Write one systemd unit for the house 35B
Drop a Type=simple unit under /etc/systemd/system/llama-server.service. systemd.service documents Type, ExecStart, Restart, and User. Run as the login that already reaches /dev/dri — not root. Restart=on-failure. The ExecStart line is the serve-qwen command plus -np 1 for a single-user lane (default llama-server auto-slots copy idle KV on each new task). This is an example, not a measured local desktop service. Two-card split or combo units stay on /setup/multi-gpu.
-
3 · Cited llama.cpp + systemd · not a measured service card
daemon-reload, enable --now, then status
systemctl daemon-reload after you install the file. systemctl enable --now llama-server starts it and keeps it across reboot. systemctl status llama-server is the first check. Those verbs are from the systemctl man page. Not a measured local desktop service.
-
4 · Cited llama.cpp + systemd · not a measured service card
journalctl and GET /health
journalctl -u llama-server -f is the unit log (journalctl man page). llama-server README: GET /health is a public health check — no API key. /v1/health also works. Then curl /v1/models on 127.0.0.1:8080. Overnight 35B numbers are llama-bench cards, not this service.
-
5 · Cited llama.cpp + systemd · not a measured service card
Both RAM lines for the house 35B
Where context and offload appear, AMDai prints Minimum system RAM needed and RAM needed at full context. Overnight UD-Q5 one-GPU peaks are 37.32 GB at 4K and 42.9 GB at 256K — measured llama-bench on the local desktop, Linux GB. Round Minimum system RAM needed to a 64 GB kit for this file on one R9700. Q3 stays a labeled estimate. Do not invent a systemd RAM number.
-
6 · Cited llama.cpp + systemd · not a measured service card
Keep 127.0.0.1; LAN needs --api-key
llama-server README: --host defaults to 127.0.0.1. That is the house bind. Phones and LAN clients are opt-in: --host 0.0.0.0 plus --api-key KEY (or LLAMA_API_KEY / --api-key-file). GET /health stays public even with a key. Do not publish 0.0.0.0 without a key. Open WebUI, Aider, and Hermes on the same box use http://127.0.0.1:8080/v1.
-
7 · Cited llama.cpp + systemd · not a measured service card
ufw and an SSH tunnel — unofficial extras
If the unit stays on 127.0.0.1, ufw is not what exposes /v1. A LAN bind can use Ubuntu ufw to allow one subnet to port 8080 — unofficial for llama.cpp, cited from the noble ufw man-page. Prefer an OpenSSH local forward (ssh -L) so the GPU box never leaves loopback. ssh(1) documents -L. Unofficial for llama.cpp.
-
8 · Cited llama.cpp + systemd · not a measured service card
Swap the GGUF with a restart
Edit ExecStart (or systemctl edit for a drop-in), daemon-reload, then systemctl restart llama-server. journalctl -u llama-server -e confirms the new file. Do not run a second llama-server on :8080. A second model on a second card is /setup/multi-gpu (:8081), not a second copy of this unit.
-
9 · Cited llama.cpp + systemd · not a measured service card
Attach a harness after /health is ok
Point Hermes, Open WebUI, Aider, Cline, or Continue at http://127.0.0.1:8080/v1 only after /health and /v1/models work. Decode numbers on this site are Ubuntu llama-bench, not a harness tok/s. Stack Lab remains the Ubuntu companion — packages are not published yet.
-
10 · Cited llama.cpp + systemd · not a measured service card
When it breaks
status=1/FAILURE: ExecStart path, missing GGUF, or the login cannot open /dev/dri. Empty /v1/models: still loading, or you curled the wrong port. GPU idle: you are on CPU — confirm the Vulkan binary, not systemd. Permission denied: groups, not a new unit flag. Start from /troubleshoot. Cited ROCm rows live on /rocm-problems.
LAN, ufw, and SSH
Opt-in only. --api-key is from the llama-server README. ufw and
ssh -L are unofficial for llama.cpp.
# Opt-in LAN — not the house default.
# llama-server README: --host default is 127.0.0.1; --api-key KEY (or LLAMA_API_KEY).
# GET /health is public (no API key check). /v1/health also works.
ExecStart=... --host 0.0.0.0 --port 8080 --api-key YOUR_KEY
# Unofficial for llama.cpp — Ubuntu ufw. Only if you bound a LAN address.
sudo ufw status
# sudo ufw allow from 192.168.0.0/16 to any port 8080 proto tcp
# Copy the subnet you actually use. Do not open 0.0.0.0/0.
# Unofficial for llama.cpp — OpenSSH local forward.
# Keeps llama-server on 127.0.0.1 on the GPU box.
ssh -L 8080:127.0.0.1:8080 user@gpu-box
sudo systemctl edit llama-server
# or edit ExecStart, then:
sudo systemctl daemon-reload
sudo systemctl restart llama-server
journalctl -u llama-server -e
RAM lines (Ubuntu-measured)
Minimum system RAM needed and RAM needed at full context for the house 35B. Those peaks are llama-bench on the local desktop, not this unit.
Daily driver · 35B llama.cpp · 262K
Minimum system RAM needed
42.9 GB
Measured · 42.9 GiB raw · 256K context
local-desktop-20261012-2314-35b-udq5kxl-1gpu-256k-llamacpp-f16
RAM needed at full context
42.9 GB
Measured · 42.9 GiB raw · 256K full context
local-desktop-20261012-2314-35b-udq5kxl-1gpu-256k-llamacpp-f16
Measured peak system RAM on the local desktop: 42.9 GB (Linux GiB labeled GB). Measured, pending re-verify after RAM fix.
Breakdown
- Offloaded weights ·
- 0 GiB
- Separable embed in RAM ·
- 0 GiB
- KV in RAM at selected ·
- 0 GiB
- KV in RAM at full context ·
- 0 GiB
- Runtime / backend ·
- 0.85 GiB
- OS / desktop baseline ·
- 8.00 GiB
- Headroom ·
- 16.0 GiB
Open in Stack Lab
Stack Lab remains Ubuntu-first. Packages are not published yet and there is no public download.
If the app is not installed, packages are not published yet. There is no public download URL. Read the Stack Lab install notes . If Stack Lab is already running on this machine, open the local app .
Sources
- llama.cpp — llama-server README (--host, --api-key, GET /health)
- llama.cpp repository
- systemd.service — Type, ExecStart, Restart, User
- systemctl — daemon-reload, enable, start, restart, status
- journalctl — unit logs
- Ubuntu man-pages — ufw (unofficial for llama.cpp) — unofficial for llama.cpp
- OpenSSH ssh(1) — -L local forward (unofficial for llama.cpp) — unofficial for llama.cpp
How we test — Measured cells cite official amdai-bench/run@1 cards. Estimates stay labeled. Q3 is estimate-only. Q1/Q2 stay off.