We tested this on six machines with graphics cards between 6 and 16 GB. On the 8 GB cards, putting 34 of the 40 layers on the GPU gave a fivefold speed-up over running on the processor alone, and the machine stayed usable for other work.
A model that fits entirely in GPU memory runs several times faster than one in main memory. Heron 14B at 8.9 GB does not fit in an 8 GB card, but you can put most of it there. The setting that controls this is the number of layers on the GPU.
Find out how much GPU memory you have
If the free value is far below the total, something else is holding memory. Browsers with hardware acceleration and video calls are the usual culprits. Close them for the test: you can open them again afterwards and see how much headroom is left.
loom gpu
Note the total and free values. Close anything that uses the card, such as games and video editors, and run it again.
Start with half the layers
Heron 14B has 40 layers. Begin with 20 on the GPU:
loom run heron-14b --gpu-layers 20 --stats "Write a haiku about routers."
Read the stats line. You want to see the tokens per second and the memory used.
Raise the number until it stops helping
If a run fails with an out-of-memory message, do not worry: nothing is damaged. Lower the number by four, run again and keep the figure that worked. Write down the final number for each model, since a different model needs its own value.
Repeat with 24, 28 and 32 layers. Each step uses about 200 MB more. Stop at the highest number where the run completes without an out-of-memory error and where free GPU memory stays above 500 MB.
| GPU layers | GPU memory | Speed |
|---|---|---|
| 0 | 0 GB | 2.1 tokens/s |
| 20 | 4.3 GB | 5.0 tokens/s |
| 28 | 6.0 GB | 8.4 tokens/s |
| 34 | 7.3 GB | 11.8 tokens/s |
Shrink the context
Longer context also slows each answer, because the model has more to read. If you only use short questions, there is no reason to leave the window at its maximum.
The context window needs memory as well. Lowering it from 8192 to 4096 frees about 700 MB and usually costs nothing for ordinary chat.
loom run heron-14b --gpu-layers 34 --ctx 4096
Try a smaller quantisation
Quantisation stores the model’s numbers with fewer bits. The 4-bit file is the default. A 3-bit file is smaller and a little worse. Try it only if you cannot fit enough layers.
Quality check
Run the same question on both files. If the 3-bit answer is clearly worse, go back.
Make it permanent
Save your numbers in the Loom Runner config so every run uses them.
loom config set heron-14b.gpu_layers 34
loom config set heron-14b.ctx 4096
Leave headroom
If the card is also driving your screen, 500 MB of headroom keeps the desktop from freezing.
For a gentler start, see the guide to running Wren 7B first.

Comments
Write a comment