Models larger than memory
Tur keeps most of a mixture-of-experts model on the SSD and reads experts into a fixed cache, with several requests at once and no SSD writes during a run.
Expert cacheRust · Metal · Apple Silicon
Serve models bigger than your Mac's memory
Tur runs language models on your Mac's GPU with Metal kernels fitted to those models. One binary handles generation, an OpenAI-compatible server, Whisper transcription and quantization.
curl -fsSL https://github.com/danylokravchenko/tur/releases/latest/download/install.sh | sh
Your Mac doesn't have to hold a mixture-of-experts model to serve it. Each token uses only a few of the model's experts, so Tur keeps them on the SSD and reads the ones a token needs into a cache whose size you choose. Memory only has to hold the rest of the model, that cache and the request state.
gpt-oss-20b runs this way on a 16 GB Mac at 3.3 tokens/s for one request, and several requests can share the cache. The cache doesn't change what the model computes, it never writes to the SSD, and Tur refuses a cache so large that it would push other apps into swap.
Reads cost speed, which suits batch work and short answers, so keep every expert in memory when the model fits.
How the expert cache worksPick Tur if you want one of these on an Apple Silicon Mac.
Tur keeps most of a mixture-of-experts model on the SSD and reads experts into a fixed cache, with several requests at once and no SSD writes during a run.
Expert cacheSeveral clients or agents share each model pass, so eight sequences decode 60% faster than on llama.cpp on the same Mac.
SchedulingTur plans all its memory before loading a weight, so a configuration that doesn't fit fails at startup, and one failed request doesn't affect the others.
State memoryProducing a token on a Mac is mostly a memory problem: the GPU spends more time waiting for weights and request state than computing with them. Tur shapes each layer to read fewer bytes.
Every running request's next token joins chunks of new prompts in one execution with no padding.
Execution engineFused Metal kernels read the weights once for the whole batch. A custom kernel stays only where it beats Candle's.
Metal kernelsAttention and recurrent state live in fixed pools, so nothing is copied or reassembled per token.
State memorySampling runs right after the model pass, and only the chosen token returns to the CPU.
SamplingTwo more mechanisms skip work without changing the generated text. Prefix reuse computes a shared system prompt once, and speculative decoding drafts several tokens and verifies them in one pass.
Add sequences and see total throughput climb. Each row is one request, replayed at the rate measured on that Mac. No model runs in your browser.
Percent difference in tokens per second, on the same Mac. Tur is ahead when requests share a pass, and level or behind on long prefill, which is mostly compute.
| Test | Tur (tok/s) | llama.cpp (tok/s) | Difference |
|---|---|---|---|
| Decode, 8 sequences, M3 Pro | 729 | 456 | 60% |
| Qwen3.6-35B 4-bit, burst of 8, M3 Pro | 94.8 | 75 | 26% |
| Qwen3.6-35B 4-bit, decode, 1 sequence, M3 Pro | 47.2 | 35.6 | 33% |
| Decode, 1 sequence, 4-bit, M3 Pro | 182 | 141 | 29% |
| Qwen3.8-27B 4-bit, decode, 8 sequences, M3 Pro | 52.5 | 41.1 | 28% |
| Prefill 2K, M3 Pro | 3799 | 3383 | 12% |
| Decode, 1 sequence, M3 Pro | 123 | 113 | 9% |
| Qwen3.8-27B 4-bit, prefill 2K, M3 Pro | 93.7 | 96.3 | -3% |
| Prefill 8K, M1 | 1129 | 1142 | -1% |
Source: Tur and other engines
Qwen3.5-0.8B, Q8_0 weights, total tokens per second. The weights are read once per pass, so sequences added to a pass cost little.
tok/s
| sequences | Tur (tok/s) | llama.cpp (tok/s) |
|---|---|---|
| 1 | 123 | 113 |
| 2 | 240 | 172 |
| 4 | 420 | 320 |
| 8 | 729 | 456 |
Source: Measured performance
You need an Apple Silicon Mac. The first run downloads the model into your Hugging Face cache, and the pinned revision means every run loads the same weights.
tur run qwen
tur run qwen 'Write one sentence about the Moon.'
tur serve qwen
Tur supports few models, and reads images and H.264 or HEVC video only on Qwen3.5-family models and Gemma 4. It has no embeddings and serves one chat model per process. On 8K-token prompts, llama.cpp prefills 6 to 11% faster on a 16 GB M1.
For those, or for other hardware, look at oMLX, llama.cpp, Ollama, SGLang or Strata. Tur and other engines says which fits what.
Pick what you need most.
Usage, architecture and the measurement behind each decision.