wall-e and the voice-command service on the Mac mini
Host castismac1 (
Sources: measurements on this machine on 2026-11-09, the install guide ~/callbot/doc/INSTALL_wall-e_v11_macmini_q3.md (dated 2026-11-01, written in Korean), the scripts and logs on the machine. Anything inferred is marked "inferred". Anything not found is listed in section 8 to fill in.
0. Summary¶
- wall-e is the voice call bot. It runs a LiveKit call pipeline: speech recognition, a Gemma 4 26B-A4B language model with a tuned LoRA adapter, a knowledge base for answers, and text-to-speech. The install guide describes browser calls through LiveKit; phone (SIP) connection was not part of that install, and how callers reach it today was not checked.
- The voice-command service on
is a separate program (it sends requests with Go-http-client). It does not run inside wall-e. It uses the same language model through a gateway on port 8001. - One model, one GPU, shared. wall-e's calls use slots 0 to 2 directly on port 8095. The
.15service uses slot 3 through the gateway on port 8001. Live calls come first, and the gateway has a priority rule so.15queues instead of being rejected. - Running now: the QAT 4-bit build of the model, set to come back after a power cut.
1. Architecture¶
Caller (browser through LiveKit; see section 0)
-> LiveKit (7880) -> wall-e agent (8090)
-> STT (8097, whisper.cpp 8098)
-> RAG (knowledge.db, embedding bge-m3 on 8096)
-> LLM 127.0.0.1:8095 slots 0, 1, 2 (agent talks to it directly)
-> TTS (8002, Korean voice)
Voice-command service <VOICE_COMMAND_HOST_IP> (Go client)
-> Gateway <MAC_MINI_IP>:8001 -> LLM 127.0.0.1:8095 slot 3 only
Both paths share the same LLM process and the same GPU.
- The gateway protects calls: it forces outside requests into slot 3, hides management paths, and caps concurrency. Calls never go through it.
- The UTM Linux VM on the same Mac (6 CPUs, 8 GB configured, about 3.5 GB resident) is production and cannot be shrunk. It competes for memory.
2. Part A: how wall-e is implemented¶
2.1 What is downloaded and what is delivered (from the install guide)¶
| Item | How it arrives |
|---|---|
| Base model Gemma 4 26B-A4B, Q3_K_M (13.0 GB) | Downloaded from Hugging Face bartowski/google_gemma-4-26B-A4B-it-GGUF |
Tuned LoRA lora_gemma4_v11.gguf (37 MB) |
Delivered by hand, not in git. Goes to ~/callbot/models/v11/ and ~/wall/out/ |
Korean voice ko_KR-kss-medium.onnx (63 MB) |
Delivered by hand, not in git. Goes to ~/callbot/voices/ |
Code, knowledge base (kb/), settings docs |
Git repository |
| Speech recognition, embedding (bge-m3), English/Thai/Vietnamese voices, LiveKit, browser JS | Downloaded during install (about 5 GB) |
Checksums from the guide (check with shasum -a 256 <file>):
| File | sha256 |
|---|---|
google_gemma-4-26B-A4B-it-Q3_K_M.gguf (13,019,981,440 bytes) |
4826221b7a285284b65222537f58ebfc6880290ff5441e13bfb1a7ca4d65df21 |
lora_gemma4_v11.gguf |
34f02d9a94653978f437bb8d3b1cba1fe505b16bc33480850a409f7142c3eb66 |
ko_KR-kss-medium.onnx |
624fd774e26895f24bebae1bd9a3379e3394baeade4b584924f83e414096e2c9 |
The other two model builds (Q4 and QAT) came later: the Unsloth UD-Q4_K_M and Google's q4_0 QAT, both in ~/local-llm-llamacpp/. Their checksums are not recorded.
2.2 Requirements and install order¶
Needs an Apple Silicon Mac with 32 GB, macOS 14 or newer, at least 40 GB of disk, and internet. $W is ~/wall (work folder) and $APP is ~/callbot (code). Full commands are in the install guide. In short:
- Tools:
xcode-select --install,brew install cmake git python@3.12 curl livekit. The LiveKit server comes from Homebrew because GitHub has no macOS build. - Code:
git clone <repo> ~/callbot, then place the LoRA and voice files and check their hashes. - llama.cpp: clone
ggml-org/llama.cppinto$W/llama.cpp, check out commit58367713a6935c0810103378144008df32e3d5db, thencmake -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -j --target llama-server. Metal is used automatically. The running server reports version0.4.1-devand that commit. - Python:
python3.12 -m venv $W/venv_wall, then installlivekit-agents,faster-whisper,piper-tts,python-mecab-ko,fastapi,uvicornand the rest of the list in the guide. - Models:
hf downloadthe Q3_K_M file,bge-m3-FP16.gguf, the whisper model and the English, Thai and Vietnamese voices. - Settings:
python3 finetune/cloud27b/wall_make_settings.py $APP/settings.json, then the guide's recommended switch values. - Start:
bash finetune/cloud27b/wall_mac_up.sh start(the first start can take several minutes to load the model). Stop and status use the same script. - Knowledge base: copy
kb/*.mdto$W/kb_alland runwall_kb_build.py. The embedding server (8096) must be running first.
2.3 Verify¶
- Simulated call:
python eval/sim_caller.py g0and check thatgrep -c Traceback $W/out/wall/agent.logis 0. - Browser call from the same Mac:
http://localhost:8080, allow the microphone, press "start call". Other computers need a tunnel, because browsers only allow the microphone onlocalhostor HTTPS.
2.4 Differences between the install guide and production today¶
The guide is dated 2026-11-01. Production has moved on:
| Item | Guide | Production now |
|---|---|---|
| Slots | --parallel 2 |
--parallel 4, with the gateway on |
| LLM address | 127.0.0.1:8095 | 127.0.0.1:8095 for wall-e, plus a gateway on |
| Speech recognition | faster-whisper on CPU | whisper.cpp (Metal) by default, model ggml-large-v3-turbo-q5_0 |
| Model build | Q3_K_M | QAT q4_0 (Q3_K_M and UD-Q4_K_M are switchable) |
| Open item in the guide | The language guard (eval/lang_guard.py) was not connected to the service code. |
Not checked whether that was fixed. |
3. Part B: the voice-command service on ¶
3.1 What we know (from the gateway log, Nov 6 to Nov 9)¶
- It is a Go program (
Go-http-client/1.1), about 99% of all outside traffic (6,312 of 6,404 requests). - It calls
POST /v1/chat/completionswith the model namex. A fewGET /v1/modelsand some browser loads of/. - Bodies are about 5.4 to 7.1 KB.
- It runs around the clock: a steady base of about 135 requests an hour, with bursts up to about 600 an hour.
- Median reply time through the gateway was about 466 ms, 95th percentile about 12.4 s. A median that short suggests short, non-thinking replies (inferred).
- First 20 minutes after the priority rule: 22 requests, all 200, none waited.
3.2 How it connects to the LLM (the contract)¶
POST http://<MAC_MINI_IP>:8001/v1/chat/completions
Content-Type: application/json
{ "model": "x",
"messages": [ ... ],
"max_tokens": 200,
"chat_template_kwargs": { "enable_thinking": false } }
- Use the gateway on port 8001, never port 8095. Port 8095 only listens on localhost.
- Allowed:
GET /health,/v1/models,/props;POST /v1/chat/completions,/v1/completions,/v1/embeddings,/tokenize,/detokenize,/apply-template. Everything else is 404 or 403. - Always send
enable_thinking: false. The server does not turn thinking off by itself. Without it, replies are slow, and a smallmax_tokenscan come back empty. - The gateway forces the request into slot 3 and removes
nandn_cmpl. A client cannot choose its slot. - Client timeouts: the gateway waits up to 60 s in the priority queue, and up to 180 s for a reply. Set the client timeout above the wait you want to allow.
- On a 503, wait the
Retry-Afterseconds and retry.
3.3 Priority rule for (deployed 2026-11-09 16:40)¶
| Situation | What happens |
|---|---|
| No call active | Up to 2 requests at once go upstream. Extra requests wait up to 60 s. |
| A call is active | 1 request at a time goes upstream. The rest queue instead of getting a 503. After 60 s a waiting request gets 503. |
| Client leaves while waiting | The request is dropped, not sent to the model. |
| Any other address | Unchanged: during a call a large generation request (body over 4,096 bytes) gets 503. |
- Settings (environment variables, defaults in the gateway code):
LLM_GATE_PRIORITY_IPS(default<VOICE_COMMAND_HOST_IP>, empty turns it off),LLM_GATE_PRIORITY_IN_CALL(1),LLM_GATE_PRIORITY_IDLE(2),LLM_GATE_PRIORITY_WAIT(60). - Log marks in
~/wall/out/wall/llm_gate.log:"prio": trueand"prio_wait_ms". - Before the rule, 967 of 6,404 requests were rejected, 488 of them because a call was active.
4. Part C: how wall-e and the voice-command service run together¶
4.1 Slot map¶
| Slot | Used by |
|---|---|
| 0 | wall-e: main conversation of a call. The agent locks it per call, which is how the gateway knows a call is active. |
| 1 | wall-e: short helper judgments. |
| 2 | wall-e: context judgments (pinned there), refuge for a second simultaneous call, long background generations. |
| 3 | The voice-command service, through the gateway. |
- Agent setting:
CALLBOT_LLM_SLOTS=main:0;aux:1,2. - A second call at the same time cannot get slot 0. It is marked "degraded" and shares slots 1 and 2. That happened 3 times at 15:55:38 today. The call history shows at most 2 calls overlapping.
- The 4 slots share one 16K-token cache pool.
4.2 What each side can expect¶
- Calls: their cache is protected, because the voice-command service cannot use slots 0 to 2.
- Calls and GPU: both sides share one GPU. A call may be a little slower while a
.15request is generating. This has not been measured. - Voice-command service: it is not rejected during calls any more. It waits its turn, one request at a time while a call is on.
- Held back: letting
.15also use slots 2 and 1 when no call is active (idle-only failover). Not built, because no waiting has been seen yet.
4.3 What to check after a busy hour¶
python3 -I - <<'PY'
import json, collections, os
rows = [json.loads(l) for l in open(os.path.expanduser("~/wall/out/wall/llm_gate.log"), errors="ignore") if l.strip().startswith("{")]
i = max(k for k, r in enumerate(rows) if r.get("note") == "gate start")
new = rows[i + 1:]
print("requests since the 16:40 restart:", len(new))
for k, v in collections.Counter((r.get("ip"), r.get("status"), (r.get("note") or "")[:28], bool(r.get("prio"))) for r in new).most_common(10): print(v, k)
w = [r.get("prio_wait_ms", 0) for r in new if r.get("prio")]
if w: print("priority requests:", len(w), "| max wait ms:", max(w), "| waited:", sum(1 for x in w if x > 0))
PY
- Look for:
.15requests with status 200, few or no "in call: large" 503s, smallprio_wait_ms, and no "priority wait timeout". - For call speed: compare the agent log's per-turn
LLM ... msduring calls with and without.15active. - If calls get slower:
bash /Users/<USER>/wall-q4/gate_rollback.sh.
5. Part D: LLM runtime (flags, models, switching)¶
Flags, identical for all builds: --ctx-size 16384 --n-gpu-layers 999 --jinja --parallel 4 -t 4 -tb 4 -fa on --kv-unified --cont-batching --cache-type-k q8_0 --cache-type-v q8_0 --cache-ram 1024 --metrics --no-cache-idle-slots.
| Tag | File | Size | Result on this machine |
|---|---|---|---|
q3 |
~/wall/models/google_gemma-4-26B-A4B-it-Q3_K_M.gguf |
12.1 GiB (13.0 GB) | Original. About 14.9 GB RSS, 38% free, no swapping. |
q4 |
~/local-llm-llamacpp/models-gemma4/gemma-4-26B-A4B-it-UD-Q4_K_M.gguf |
15.8 GiB (16.9 GB) | About 16.5 to 17.2 GB RSS. Swapped: swapouts 13,917,935 to about 14,117,000, swap file 2 to 4 GB, free memory 15 to 22%. |
qat |
~/local-llm-llamacpp/models-gemma4-qat/gemma-4-26B_q4_0-it.gguf |
13.4 GiB (14.4 GB) | Running now. About 14.1 to 14.9 GB RSS, 37 to 38% free. Swapouts flat at 14,164,963 while idle. About 28 to 33 tok/s (Q4 about 22). |
- The benchmark in
~/llm-bench/REPORT.mdhad already found Q4_K_M swapped next to the VM and QAT fit. - QAT is proven only on 7 sample prompts with this LoRA (fluent Korean, phone number read back correctly, no invented price, valid JSON). No fair Q3 vs QAT quality comparison exists yet.
- The install guide's table (from an A100) says Q3_K_M needs a language guard to switch languages reliably. Whether QAT behaves like Q3 or Q4 on this was not tested.
Switch with one command:
bash /Users/<USER>/wall-q4/llm_model.sh status
bash /Users/<USER>/wall-q4/llm_model.sh q3 # or q4, or qat
bash /Users/<USER>/wall-q4/llm_model.sh qat --dry-run
- Options:
--yes,--force(drops a call in progress),--dry-run. - A switch refuses while a call is active, restarts only the LLM (about 20 to 22 s measured for Q3 to Q4 and Q4 to QAT), and goes back to the previous model if the new one fails to load.
6. Part E: operations¶
6.1 Survives a power cut or reboot¶
The Mac auto-restarts (pmset autorestart 1) and logs in as non; launchd then starts the enabled agents. Exactly one job is enabled and installed:
| Job | Model | State now |
|---|---|---|
com.local.wall-e |
q3 (original script) | unloaded, disabled, plist kept |
com.local.wall-e-q4 |
q4 | disabled, plist removed |
com.local.wall-e-qat |
qat | enabled and loaded |
com.local.locals-server |
old MLX server | disabled, plist kept |
com.local.llama-server |
old Typhoon server | disabled |
llm_model.sh statusprints "survives reboot: YES/NO".- Do not move or delete
/Users/<USER>/wall-q4. The qat job runswall_mac_up_q4.shfrom there. - Setting
LLM_GGUFin a shell does not stick. Usellm_model.sh.
6.2 Daily checks¶
memory_pressure | grep 'free percentage'
vm_stat | grep Swapouts # 14164963 after the QAT switch; a climbing number means it does not fit
sysctl vm.swapusage
launchctl list | grep com.local.wall-e
tail -50 ~/wall/out/wall/llm.log
tail -50 ~/wall/out/wall/llm_gate.log
6.3 Files¶
Folder /Users/<USER>/wall-q4/: llm_model.sh (switch), wall_mac_up_q4.sh (copy of the production script with a different default model path), com.local.wall-e-q4.plist and com.local.wall-e-qat.plist (launchd masters), gate_rollback.sh (undo the gateway rule), check_llm.py and prompts.txt (test prompts), backup/llm_gate.py.orig-20261109 (original gateway), CLAUDE.md (handover notes), results/ (test outputs and swap.log).
Live gateway: ~/callbot/finetune/cloud27b/llm_gate.py (not in git; a copy of the original sits next to it as llm_gate.py.orig-20261109). Production script: ~/callbot/finetune/cloud27b/wall_mac_up.sh. Do not edit it.
7. What was done on 2026-11-09¶
- Inventory of LLM processes. Found the Gemma Q3 server, the embedding server, and an old MLX server on port 8001.
- The MLX server came back after the power cut because its launchd job had
RunAtLoadandKeepAlive. It was unloaded and disabled, and the plist was kept. - Built the switch tooling in
/Users/<USER>/wall-q4/. - Switched Q3 to Q4 at 14:00. It swapped.
- Switched Q4 to QAT at 15:28. All 10 services stayed up.
- Analysed the gateway log: 6,404 requests, 85% success, 863 rejected with 503 (488 during calls, 293 large-request cap, 67 connection cap, 15 small-request cap), 56 timeouts. About 99% came from
<VOICE_COMMAND_HOST_IP>. - Backed up the gateway, added the priority rule for
.15, tested it on spare ports (7 scenarios, Python 3.12 and 3.9, after one bug fix), and deployed it at 16:40. Only the gateway restarted. - Wrote
CLAUDE.mdand this page.
8. Open items and things to fill in¶
About the voice-command service (not found):
- What the program is called, who owns it, and what the voice command does with the LLM's reply.
- Whether it sends
enable_thinking: false, whether it streams, and whether it uses tool calls. - Its client timeout, and whether it retries on 503.
- Where its speech recognition and text-to-speech come from. wall-e's STT and TTS listen on 127.0.0.1 only, so
.15cannot use them from another machine. - Why it sends a fixed 5 to 7 KB prompt each time, and whether that prompt starts the same way every time (this matters for slot 3's cache).
Not yet tested or measured:
- The priority rule on real traffic over a busy hour, and its effect on call speed.
- QAT on real calls, not just the 7 sample prompts.
- The switch to q3, the automatic fallback after a failed load (the fix is only dry-run tested), and a reboot with the qat job.
- About 3.5 GB is still in swap from the Q4 period. It drains slowly, or a reboot at a quiet time clears it.
Unexplained: stt, agent and admin show start times of 15:32, four minutes after the QAT switch. The switch log says they were already running, and nothing here restarted them.
9. Decisions and why¶
- Keep 4 slots and 16K context. More slots or cache cost memory and do not make anything faster, because the GPU is shared.
- Keep the gateway. It is the only thing keeping outside traffic out of the call slots.
- QAT over Q4. Q4 swapped. The benchmark had already picked QAT for fitting.
- Keep
.15on slot 3 during calls. Slots 1 and 2 carry the agent's reply-path judgments. - Do not change the call slot setting to
main:0,1;aux:2. It turns off the agent's context-judgment pin and could slow each turn.