Skip to content

Speed, capacity and lanes

This is the speed document, part of OKR 2 (the objective "AI service: performance, packaging, monitoring"). It is on Card 2 of the card list, together with the model-choice document. Done: the cause of the 60-second stalls found, speed and capacity measured on the real guide prompt, 1 to 4 lanes tested, and a bigger context and cache tested. Result: one hotel lane (slot 3) with the original 16,384 context and 1,024 MB cache is the right setup; slow answers come from cold prompt reads and queueing, not from the model. Not done and not counted here: finding why the Mac became about 2 times slower on 25 Nov, and the 24-hour measurement. The gateway is in its own document (the gateway document). Rules for every test (quiet check, callbot owner's OK, restore the original) are in the quality-gate document, last section "Before you run any test". "90th percentile within 3 s" means 9 of 10 answers took 3 s or less.

Each test in plain words, with real numbers

The model runs on one small computer (a Mac mini) that also serves the phone bot. A guest waiting at the TV wants an answer within a few seconds. Think of one cashier in a shop: speed is how long one customer takes, capacity is how long the queue gets when many come, and lanes would be extra cashiers. Some words: a token is a word piece (roughly three quarters of a word); a cold request makes the server read the whole hotel prompt again; a warm request finds the prompt already stored (in the cache) and reads only the new question. The hotel prompt is about 4,600 tokens (about 15 KB).

More words. Local model (LLM): the language model we run on the Mac mini. Gateway: the program in front of the model that every request passes through (see the gateway document). Slot: one place in the model that handles one request at a time; slot 3 is the one the hotel uses. A lane is the same thing seen from the guest's side. Context: how much text the model can hold at once. Callbot: the Korean phone bot that shares this Mac mini and this model. Back-end: the hotel's server program (172.25.25.15) that sends the questions. 90th percentile within 3 s: 9 of 10 answers took 3 s or less.

Even more words. Median: the middle value; half of the answers were faster. Swap: when the Mac runs out of memory it writes some to disk, which is slow. UTM virtual machine: another computer simulated inside the Mac mini, which uses memory and processor. Spotlight: the Mac's file indexing. Keep-warm ping: a small request the hotel back-end sends every 4 minutes so the prompt stays stored.

How reliable are these numbers? Speed numbers wobble much more than the right-or-wrong scores. The same setting, measured twice on 25 Nov with nothing changed, took 2.8 s the first time and 17.3 s after a restart, because the Mac mini had become about 2 times slower in between. So a speed result is only compared with another result from the same day on a quiet machine, and most rows here are one run each. The numbers show the size of a difference (for example 4.07 s against 11.09 s) and not a precise value. The tests ask: how fast is one answer, how many guests can ask per minute, and would more lanes or more memory help. They use the real hotel prompt of about 4,600 tokens and rotating guide questions such as "What time is check-in?" and "Is there a pool?".

Test 1. Why did some hotel requests wait 60 seconds and fail?

  • What we are trying to find out: the hotel back-end sometimes got an error after exactly 60 s. What was the cause?
  • What we did: read the gateway log (5,068 hotel requests from 19 to 23 Nov) and replayed the situation: the same big guide prompt five times in a row; a big prompt then a small one; three big prompts at the same moment.
  • Numbers: from 11 to 13 Nov, 1,641 hotel requests overlapped a callbot test job (the callbot shares the same lane): median 6.58 s, 9 of 10 within 45.07 s, and 347 were cut off after 60 s (the gateway cuts a request that has had no answer for 60 s; a real example is in the gateway document). With the lane free (632 requests): median 0.39 s, 9 of 10 within 0.67 s. Later we found every slow request overlapped another one, and that the stalls of 19 and 20 Nov came on our own test days and two restarts (a burst on 20 Nov from 22:11 to 22:25 is still unexplained); none on 21 to 23 Nov. Per day (requests, requests over 20 s, timeouts): 19 Nov 1,256, 32, 12; 20 Nov 1,948, 143, 44; 21 Nov 720, 0, 0; 22 Nov 720, 0, 0; 23 Nov up to 14:03 424, 0, 0. The script that made this table is not saved.
  • Conclusion: the stalls were a queue on one lane plus cold reads, not a slow model.

Test 2. How fast is one answer: cold and warm?

  • What we send: the real Hilbert Silom guide prompt with a guest question, for example "What time is check-in?", through the gateway, as the hotel back-end does.
  • Numbers (23 Nov): cold: the server read 4,599 tokens in 16.2 s (317 tokens per second) and wrote the 33-token answer at 19.5 tokens per second. Warm: it read only the 14 new tokens and reused 4,583 from the cache; the whole answer took 1.7 to 2.7 s (four questions: 2.47, 1.81, 2.74 and 1.72 s). Writing speed is the limit when warm: about 19 tokens per second, so a 40-token answer takes about 2 s.
  • What it means: a guest should feel 2 s, but a cold read costs about 16 s. That is why the stored prompt must stay stored (see Test 3) and why a warm-up after every restart helps.
  • Two questions at the same moment (warm): 2.0 s and 4.7 s, because they take turns on one lane.

Test 3. Does the stored prompt stay stored?

  • What we are trying to find out: the back-end also sends other prompts (the order reader, the intent step). Do they push the hotel prompt out of the cache so the next guest waits for a cold read?
  • What we did: send the hotel prompt, then five other big prompts on the same lane (The Veranda, two padded Veranda prompts, a mock hotel, a Veranda variant), then the hotel prompt again, and count tokens reused.
  • Numbers: after every one of the five other prompts the hotel prompt was still reused (4,582 of 4,599 tokens) and answered in 1.27 to 2.42 s. The other prompts themselves each cost a cold read: 8.7 s (mock hotel, 2,485 tokens), 17.2 s (Veranda), 20.2 s (5,760 tokens), 28.6 s (4,125 tokens, Veranda plus facilities: this does not fit the reading speed and is unexplained) and 30.5 s (7,265 tokens).
  • Conclusion: the server's cache (1,024 MB) holds at least five other big prompts. An old note in the back-end code that a cached prompt is lost after one other prompt is out of date.

Test 4. How many guests can ask per minute before answers slow down?

  • What we are trying to find out: the capacity of one lane. "90th percentile within 3 s" means 9 of 10 answers take 3 s or less.
  • What we did: send guide questions at a steady rate (for example 20 per minute, one every 3 s on average) for 60 s, with the prompt warm, and record the time of every answer. The questions rotate over six, for example "What time is check-in?", "Is there a pool?", "Where can I park?".
  • Numbers, real guide prompt, one lane (23 Nov): 9 of 10 answers within 1.75 s at 6 and 12 questions per minute, within 4.5 s at 20, within 9.1 s at 30. So one lane meets the 3-second goal up to about 12 questions per minute. With a short prompt (the draft set, about 2,000 tokens) about 20 per minute is comfortable, 30 overloads one slot (median 10.2 s and 8.4 s in two runs, 90th percentile 16.4 s and 12.1 s; with 3 slots the median is 3.2 s and 3.9 s and the 90th percentile 7.2 s and 7.0 s), and 45 overloads both (median about 25 s on 1 slot; 11.7 s and 19.4 s in two runs on 3 slots).
  • What it means: if the hotel guests ask more than about 12 guide questions per minute, answers get slower than 3 s; we do not yet know how many guide questions a real hotel sends per minute.

Test 5. Would more lanes (parallel places in the server) serve more guests?

  • What we are trying to find out: with 2, 3 or 4 lanes, can the server answer more guests at once?
  • What we did: the same steady load (20, 30 and 45 questions per minute, the real Hilbert prompt, warm) on 1, 2, 3 and 4 lanes, straight to the server. The server was restarted with a bigger memory setting for this test and restored afterwards.
  • Numbers (9 of 10 answers within this many seconds): one run per cell, with the bigger context and cache, so the test cannot separate that from the lane count. At 30 per minute: 4.07 s with 1 lane, 5.14 with 2, 4.90 with 3, 11.09 with 4. At 45 per minute: 8.20 s with 1 lane and 65.93 s with 4.
  • What it means: more lanes made it slower, not faster. The likely reason (my reading, not proven) is that all lanes share one chip and take turns. Keep one hotel lane.

Test 6. Would a bigger working memory or cache make it faster?

  • What we are trying to find out: the server has a context setting (how much text it can hold at once: 16,384 tokens shared by all lanes) and a cache setting (memory for stored prompts: 1,024 MB). Would raising them help?
  • What we did: four settings with 3 runs each, plus a control (the original setting again after the restart), the same one-lane test at 20, 30 and 45 questions per minute.
  • Numbers (9 of 10 within this many seconds, at 30 per minute): original 3.1 s, bigger context 7.5 s, bigger cache 49.4 s, both 9.6 s; the control (original again) 43.0 s.
  • What it means: the control was as slow as the bigger settings, so the slowness did not come from them: the machine itself became about 2 times slower from about 10:10 on 25 Nov (cold read 152 tokens per second against 317 on 23 Nov), probably because a virtual machine was using 14 GB and a full CPU. Runs of one setting differed more than the settings did, so there is no proof a bigger setting helps. Keep the original.

Speed, cache and capacity

Conclusion: the slow answers come from cold prompt reads and from queueing, so keep the guide prompt warm and keep other clients (tests, callbot replay) off slot 3.

How to test

  • Speed and cache (Tests 2 and 3): sends the warm-up with max_tokens 1, then 4 real questions through the gateway (slot 3), then the guide prompt again after the order and intent prompts used the slot, then two questions at the same instant; a cold read (cache off) goes straight to slot 1. Cache capacity puts the Hilbert prompt on slot 0, then five other big prompts (The Veranda, padded Veranda at 5.8k and 7.5k tokens, the mock hotel, a Hilbert variant), then the Hilbert prompt again.
python3 -I runner/slot_speed.py runs/<date>_slot-speed
python3 -I runner/guide_capacity.py runs/<date>_guide-capacity
  • Capacity (Test 4): steady arrival of 6, 12, 20, 30 and 45 requests per minute, 60 s each, straight to the LLM on slot 0 (1 slot) or slots 0 to 2 (3 slots), 3 runs each; slot 3 stays free for the hotel.
bash runner/capacity.sh <label> 3 5 per-action 6,12,20,30,45
  • Does not show: speed with several hotels sharing the cache, or with real guest traffic. After about 10:10 on 25 Nov the machine was 2 times slower (cold read 152 tokens per second, writing 11 to 14), so compare only runs from the same day.

Lanes, context and cache (tested 25 Nov)

More lanes do not help

One lane was the fastest or equal at every load, so the hotel keeps its single lane (slot 3). Real Hilbert Silom guide prompt (about 4,600 tokens), warm, straight to the slots, bypassing the gateway, questions rotating over 6, 60 s per step, one run per cell, no errors. The server ran with 32,768 context and 2,048 MB cache for this test and was restored afterwards. 90th percentile in seconds:

Guide questions per minute 1 lane 2 lanes 3 lanes 4 lanes
20 2.33 2.70 5.50 6.72
30 4.07 5.14 4.90 11.09
45 8.20 19.86 11.26 65.93
  • Why: all lanes share one chip, so they take turns instead of adding capacity (my reading of the numbers, not proven).
  • Earlier result withdrawn: "2 warm lanes hold 30 per minute at 3.9 s against 9.1 s on one" (23 Nov, 16,384 context) did not repeat; 1 lane gave 4.07 s at 30 per minute.
  • Memory: the server grew from 13.6 GB to 16.3 GB; free memory 27% to 26%; swap unchanged at 6.6 of 8 GB.
  • Decision: keep LLM_MAX_CONCURRENT at 1; the second-slot proposal is withdrawn.
  • Does not show: behaviour through the gateway and with a call running.

How to test (needs the callbot owner's OK, no call running)

CTX=32768 CACHE=2048 bash runner/lanes_swap.sh in --yes     # restarts the LLM
python3 -I runner/guide_lanes.py runs/<date>_guide-lanes-32k
bash runner/lanes_swap.sh out --yes                          # exact original command back, marker off
bash runner/lanes_swap.sh status                             # proves the command is identical to the snapshot

A bigger context or cache gives no reliable gain

The same one-lane guide test, 3 runs per setting, then a control. It stops and restores if swap goes above 7,600 MB or the LLM is not healthy after a restart; about 50 minutes. Median 90th percentile in seconds; only run A was clean.

Setting (context / cache) 20 per minute 30 per minute 45 per minute
A: original 16,384 / 1,024 MB 2.8 3.1 17.2
B: 32,768 / 1,024 MB 4.3 7.5 107.5
C: 16,384 / 2,048 MB 15.2 49.4 40.5
D: 32,768 / 2,048 MB 6.8 9.6 54.8
Control: original again after the restore 17.3 43.0 79.4
  • Control: the original settings right after a restart were as slow as B, C and D, so the slowness did not come from the bigger settings.
  • The machine: a quiet probe at 11:03 gave a cold read of 152 tokens per second (317 on 23 Nov) and writing at 11 to 14 per second (19.5 on 23 Nov). The UTM virtual machine used 14 GB and about 100% of a CPU, and Spotlight about 23% of a CPU. This is a likely cause; I did not confirm it and did not touch those processes.
  • Hotel pings: from 09:54 the hotel's 868-token ping no longer reused its cache (3.2 s instead of 0.5 s). My big test prompts probably pushed it out of the 1,024 MB cache; this is a guess, so the cache size needs a clean test on a quiet machine.
  • Decision: keep 16,384 context and 1,024 MB cache.
bash runner/ctx_cache_ab.sh     # A, B, C, D with 3 runs each; restores the original at the end
bash runner/lanes_swap.sh status  # proves the original is back

Evidence: runs/2026-11-25_guide-lanes-32k/summary.md, runs/2026-11-25_ctx-cache-ab/summary.md, runs/2026-11-23_guide-capacity/, runs/2026-11-23_slot-speed/.

More evidence. Run folders under /Users/non/hotel-concierge/runs/: 2026-11-13_gateway-baseline, 2026-11-19_capacity-v5, 2026-11-20_capacity-v5b-*, 2026-11-23_slot3-stall-probe, 2026-11-23_slot-speed, 2026-11-23_guide-capacity, 2026-11-25_guide-lanes-32k, 2026-11-25_ctx-cache-ab.