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.
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.
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.
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.
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.
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.
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 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.
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.
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 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.
Not every idea survives contact with a measurement, and the honest part of the story is the ideas I dropped:
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.
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.