The biggest speed trick in our lab for long chats with an AI character on your own hardware. Keep the character's fixed text first and unchanged, and the model reads it once. After that, every reply starts in a fraction of a second.
As a model reads your prompt, it builds working notes on everything it has read so far (the KV cache). Local servers like llama.cpp and LM Studio keep those notes between messages. When the next prompt begins with exactly the same text, the server reuses the notes and only reads what is new.
The catch is the word exactly. One changed character near the top, like a clock, a date or a turn counter, and everything after it has to be read again. Most character setups put "today is…" right at the top, so they pay for the whole character on every single message.
The ROM trick: the fixed part first, and only the end changes. Read once.
The common mistake: one changing line at the top, and the whole character is read again, every turn.
| first reply | every reply after | |
|---|---|---|
| With the ROM trick | 16.7 s | 0.17 s to the first word |
| Without it (a clock line at the top) | 16.6 s | 16.6 to 17.7 s, every turn |
| After a server restart, restoring the saved read from disk | restore 0.28 s, then 0.26 s to the first word | |
With the trick, each later turn read only the 22 or so new tokens. Without it, each turn read 10,100 to 10,300. Writing speed was the same either way (46 tokens a second). The saved read for that character was a 1.1 GB file.
| character, model, machine | cold first reply | with the ROM |
|---|---|---|
| A 3,400-token character, Gemma 4 26B, Mac M1 Max (LM Studio) | 3.0 s | 0.8 to 1.0 s |
| The same character, one 2015 Quadro M4000 (llama.cpp) | 47.8 s | 6 to 7 s |
| A 10,800-token character, Qwen 3.8 27B, Mac M1 Max | 153 s | about 2 s, restored from disk |
The slower your card reads, the more this matters. On old hardware a long character can take a minute or more to read. With the ROM, you pay that once.
# start the server with a folder for saved reads; for sliding-window models give the cache room # (e.g. --cache-ram 6144) so a side call does not push the character out llama-server -m model.gguf -ngl 99 -fa on -c 32768 -np 1 --jinja --slot-save-path ./slots # every request: keep the cache, and pin the character to her slot {"messages": [...], "cache_prompt": true, "id_slot": 0} # save her read after a reply, and put it back after a restart curl -X POST "http://127.0.0.1:8080/slots/0?action=save" -d '{"filename":"iris.bin"}' curl -X POST "http://127.0.0.1:8080/slots/0?action=restore" -d '{"filename":"iris.bin"}'
After a restore, send the conversation the saved read was made from plus the new message; the server then reads only the new part. If you change the character's fixed text, the old saved read no longer matches: one cold read, then save again. LM Studio keeps the cache in memory on its own; the ordering rules are what make it work.
Questions or your own numbers: @Escher2112 on X. Our Qwen 4 files are on Hugging Face, and the test that made the Qwen 4 numbers is in the field report.
Read it once. Talk all night.