askmira.es
← Writing

Making a small Mac keep up with a big AI

19 August 2026 · Technical article · Originally written in English
A holiday side-quest

Mira is a private AI assistant that runs entirely on one Mac. Over the holidays I tried to make it faster without making it dumber. Here is the whole story, explained from scratch.

01 · The machine

A fast engine on a narrow road

Everything here runs on a single 32 GB Mac. The graphics chip is genuinely fast at doing sums, but sums are not where the time goes.

To write one word, the AI model has to read its own weights, the billions of numbers it learned during training, out of memory and into the chip. The chip can multiply those numbers far quicker than the memory can hand them over. So the real limit is not how fast it can think, it is how fast it can read.

The one idea the rest of this hangs on

Picture a chef who can chop at superhuman speed but has to walk to the pantry for every single ingredient. The chopping is never the problem. The walking is. Speeding up this kind of AI is almost entirely about walking to the pantry less, or coming back with more each trip.

The proper name for the limit is memory bandwidth. Almost every trick below is a different way of respecting it.

to write ONE word, read the whole model out of memory MODEL WEIGHTS tens of billions of numbers, in memory narrow pipe memory bandwidth = the bottleneck GPU can do the maths faster than it is fed
The squeeze. The chip sits idle waiting for numbers to arrive down a pipe that is too narrow. Reading the whole model, once per word, is the tax we spend the rest of the story trying to dodge.
02 · The starting point

Out of the box, it is only okay

Download a model, point a standard server at it, and it works. A capable model even fits on this 32 GB Mac. But out of the box it crawls, at roughly 8 tokens per second, slow enough that calling it a useful assistant is a real stretch. And now and then it wobbles, repeating itself or drifting off. Turning “it runs” into “it feels good” is a craft.

Luckily it is a craft with a huge, public toolbox. Researchers publish new speed tricks most weeks. They come in two rough sizes:

The universal wins. A handful of ideas make almost everything better at once: faster to start answering, faster to type the answer out, and steadier and more accurate while doing it. You just take these.

The long tail. After that, it is a grind of one-percent-here, one-percent-there tweaks, and the deeper you go the more specialised it gets, until you are writing custom code for the graphics chip by hand. Since my holiday was not infinite, the rule was simple: chase the biggest levers first.

A word I will keep using

Speed here is measured in tokens per second. A token is a chunk of text, very roughly a short word or part of one. More tokens per second means the answer appears on screen faster. Everything below is, in the end, a fight over that one number, without letting the answers get worse.

03 · The model you pick

Don't wake the whole staff for every question

The biggest lever is a choice you make before any clever engineering: which kind of model to run. This is where the pantry trips get cut in half.

That slow model from a moment ago was a dense one: it uses every one of its weights for every single word. Every trip to the pantry fetches the entire inventory. A newer Mixture of Experts model, MoE for short, is built from many small specialists, and for each word it wakes only a handful of them.

Mira's default model has about 35 billion weights but touches only around 3 billion per word. Since our whole problem was reading weights, reading roughly a tenth of them is an enormous head start, and it comes nearly free: the model was trained to route each word to the right specialists, so the answers stay just as good.

That one switch, from a dense model to a Mixture of Experts, is what took Mira from those painful 8 tokens per second to nearly 60. A single decision, a seven-fold jump, and the biggest single win in the whole story. Everything after this is fighting for the last stretch.

None of that was theoretical shopping; I worked through a real shortlist on this one Mac. Gemma 4 at 31B, then a mixture-of-experts Gemma (26B-A4B), then Ministral 3. The one that most impressed me on sheer answer quality was a dense Qwen3.8 at 27B, but it is exactly the crawler above: wonderful replies, at those 8-odd tokens per second. The model that finally paired good answers with real speed is the mixture-of-experts Qwen3.6, 35B in total with only about 3B awake per word, and nothing I have thrown at it since has knocked it off the top spot. I am now waiting on the updated Qwen3.8 mixture-of-experts to see whether it finally can.

DENSE every weight, every word all lit · a full pantry trip every time MIXTURE OF EXPERTS a few specialists per word only the green few wake upa fraction of the reading
Dense vs Mixture of Experts. Same intelligence on tap, a fraction of the memory read per word. This is the model you pick, not a trick you apply, and it is the foundation everything else is built on.
not here
Expert offloading is a related MoE idea: keep the sleeping specialists on the disk instead of in memory. It only helps when the model is too big to fit at all. On a Mac where everything already fits, pushing experts to disk just adds slow trips, so it is a way to run a bigger model, never a way to run this one faster. Not applicable, and I left it alone.
04 · The big lever

Guess a few words, then check them all at once

Normally the model writes one word, reads itself again, writes the next, and so on: one expensive pantry trip per word. The trick that changed the most is called speculative decoding, and the idea is almost cheeky.

Bolt a tiny, cheap predictor onto the model. Let it guess the next few words in a flash. Then let the real model check all of those guesses in a single read, and here is the magic: on this hardware, checking four guesses costs almost the same as checking one. The expensive part was the trip to the pantry, and one trip covers all four. Keep every guess the real model agrees with, fix the first wrong one for free, and repeat.

Say the model is halfway through a sentence: “To make an omelette, first crack a few…” The cheap predictor blurts out the next few words in one go, eggs, into, the. The real model checks that whole burst in a single read, agrees with eggs and into, and overwrites the last one with its own choice. Three words considered, one expensive read, two of them kept.

the model is writing this, one word at a time: To make an omelette, first crack a few ? ? ? 1 · GUESS cheap predictor, instant eggs into the 2 · CHECK real model, ONE read one trip checks all three at once 3 · KEEP agree → keep · wrong → free fix eggs · into  kept the → a
Guess, check, keep. The predictor guessed eggs into the; the model kept eggs and into and swapped the last guess for its own word, giving “crack a few eggs into a bowl”. Two words landed from a single expensive read, and even the wrong guess cost only a sliver of speed, never a worse answer.
Why this is safe, and what “lossless” really means

The final say is always the real model's own pick. A bad guess just gets thrown away and costs a little speed; it can never put a word in the answer that the model would not have chosen itself. So the technique is lossless in a precise sense: the decisions are exactly the ones the model would have made anyway.

It does not promise byte-for-byte identical text. Deep down, checking several words at once nudges some numerical tie-breaks, so the exact wording can shift a hair. I checked the diverging answers side by side: same quality, just occasionally paraphrased. And to be sure I was not fooling myself, I re-ran a slice of a standard reasoning exam with the trick on and off. The scores held.

The payoff: decoding went from around 60 tokens per second to just over 70. About a fifth faster, with the answers unchanged. That is a universal win of exactly the kind worth taking first.

05 · The bar to beat

The standard I measure against

I am not doing this in a vacuum. There is another engine, oMLX, that I have leaned on since the early days when running these models on a Mac barely worked at all.

It has matured a lot. It even grew its own way of compressing the model, its own quantization format. That matters because a good compression keeps the answers sharp while making the model smaller to read (that is, it uses less RAM), and reading is our whole bottleneck, so the quality comes essentially for free. For a long time Mira ran on top of other people's engines, and oMLX was the fast one. So it is my gold standard: about 77.5 tokens per second on the same little Mac.

The honest target was to match it with Mira's own engine, and then see if I could nudge past it. I knew going in that the last stretch would not be free. Somewhere near 80 tokens per second, every extra bit of speed starts costing you something: either more wrong guesses, or slightly worse answers. The interesting question was where that wall actually sits.

06 · The long tail

Then it becomes a grind of small levers

With the big wins banked, you enter the part with no glamour: lots of small ideas, each worth a percent or two. Some pay off, some quietly backfire, and some just do not deliver what I think the theory promised (I'm here learning too!).

The one that worked: guess from a shorter list

The little predictor was considering the model's entire vocabulary, hundreds of thousands of possible word-pieces, just to pick one. But the words it actually needs are nearly always the common ones. So I let it guess from only the most common slice of the vocabulary. Cheaper guesses, no loss in quality, and it closed the gap: Mira's own engine reached about 76, level with oMLX.

Dense
8.5 t/s
MoE
59.5 t/s
+ guess & check
71.2 t/s
+ shorter list
76.0 t/s
oMLX, the bar
77.5 t/s

The ones that did not pan out

Not every idea survives contact with a measurement, and the honest part of the story is the ideas I dropped:

net loss
Guess deeper. If guessing three words ahead helps, surely guessing more helps more? Measured, it was slower. The further ahead you guess, the more often you are wrong, and the wasted guesses cost more than the occasional lucky streak saves.
under-delivered
A hand-written GPU routine. I wrote custom code for the graphics chip to speed up the checking step. It worked, and it barely moved the needle at Mira's scale. Hand-writing chip code is the very bottom of the toolbox, and at this size the payoff was not there. Worth knowing for certain rather than assuming.
below the bar
DFlash. Another published speed technique I tried earlier. It simply did not clear the threshold that would make it worth carrying, so it did not make the cut.

That is the shape of the long tail: a pile of small bets where the discipline is not being clever, it is being willing to measure and throw away the ones that do not earn their place.

07 · Where it landed

A small Mac, holding its own

The scoreboard: from a barely-usable 8 tokens per second, to nearly 60 the moment the model became a Mixture of Experts, to level with the fast engine I have admired for years, all on the same 32 GB Mac and with the answers just as good. Eighty is reachable, but only by paying in quality or accuracy, so I stopped where the trade stopped being worth it.

And here is the honest footnote. This is a hobby. It is not my job, and if I am being truthful it is not really anyone's job, it is my slightly odd idea of a fun holiday. But that is exactly why the constraint is the point. A small machine forces you to actually understand where every millisecond goes, instead of solving the problem by renting a bigger computer. Necessity really is the mother of invention, and there is an enormous amount out there to play with.

If any of this made you curious about the actual numbers, charts, and the research it draws on, there is a much deeper write-up that goes lever by lever. The deep-dive with every chart and citation lives in the full explainer.

Privacy · Support · GitHub