Tur

Rust · Metal · Apple Silicon

Local inference with a little muscle

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
Tur mascot, a red Cossack with a sweeping moustache, flexing an arm
12.8 GiBof weights served on a 16 GB Mac whose GPU can't hold them, through a 2 GiB expert cache +60%eight-sequence decode against llama.cpp, 729 tok/s to 456 on an M3 Pro 0.56 sto first token behind a cached system prompt, against 9.46 s without reuse 3.1×speculative decoding on repetitive text, with output identical to normal decoding

Bigger than your memory

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 works
On the SSD: 9.5 GiB of experts
In memory: a 2 GiB cache of the experts in use

Why Tur

Pick Tur if you want one of these on an Apple Silicon Mac.

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 cache

Many clients, one model

Several clients or agents share each model pass, so eight sequences decode 60% faster than on llama.cpp on the same Mac.

Scheduling

A server you can leave running

Tur 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 memory

How one pass works

Producing 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.

  1. Pack

    Every running request's next token joins chunks of new prompts in one execution with no padding.

    Execution engine
  2. Read weights once

    Fused Metal kernels read the weights once for the whole batch. A custom kernel stays only where it beats Candle's.

    Metal kernels
  3. Read state in place

    Attention and recurrent state live in fixed pools, so nothing is copied or reassembled per token.

    State memory
  4. Sample on the GPU

    Sampling runs right after the model pass, and only the chosen token returns to the CPU.

    Sampling

Two 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.

Watch the tokens

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.

Measured, with the losses left in

Tur against llama.cpp

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.

  • Tur faster
  • llama.cpp faster
Decode, 8 sequences, M3 Pro
+60%
Qwen3.6-35B 4-bit, burst of 8, M3 Pro
+26%
Qwen3.6-35B 4-bit, decode, 1 sequence, M3 Pro
+33%
Decode, 1 sequence, 4-bit, M3 Pro
+29%
Qwen3.8-27B 4-bit, decode, 8 sequences, M3 Pro
+28%
Prefill 2K, M3 Pro
+12%
Decode, 1 sequence, M3 Pro
+9%
Qwen3.8-27B 4-bit, prefill 2K, M3 Pro
−3%
Prefill 8K, M1
−1%
Show the numbers
TestTur (tok/s)llama.cpp (tok/s)Difference
Decode, 8 sequences, M3 Pro72945660%
Qwen3.6-35B 4-bit, burst of 8, M3 Pro94.87526%
Qwen3.6-35B 4-bit, decode, 1 sequence, M3 Pro47.235.633%
Decode, 1 sequence, 4-bit, M3 Pro18214129%
Qwen3.8-27B 4-bit, decode, 8 sequences, M3 Pro52.541.128%
Prefill 2K, M3 Pro3799338312%
Decode, 1 sequence, M3 Pro1231139%
Qwen3.8-27B 4-bit, prefill 2K, M3 Pro93.796.3-3%
Prefill 8K, M111291142-1%

Source: Tur and other engines

Batched decode on an M3 Pro

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

02004006008001248sequences729456
Show the numbers
sequencesTur (tok/s)llama.cpp (tok/s)
1123113
2240172
4420320
8729456

Source: Measured performance

All the charts

Up and running

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

Models

  • Qwen3.5-family hybrid models with images and video, including Qwen3.8 and, experimentally, the Qwen3.6 mixture-of-experts
  • Gemma 4 with images and video, and with WAV audio on E2B and E4B
  • gpt-oss text, through the expert cache when it doesn't fit
  • Whisper large-v3-turbo for transcription

How far each model has been validated

When to look elsewhere

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.

Is Tur the right engine for you?

Pick what you need most.

The book

Usage, architecture and the measurement behind each decision.