All Posts
AI InfrastructureJune 29, 2026

Qwen3 235B MoE vs Llama 3.3 70B Dense on M5 Ultra Mac Studio: Tokens Per Second, Memory, and Cost Per Million Tokens (June 2026)

Qwen3 235B MoE and Llama 3.3 70B Dense compared on a 512GB M5 Ultra Mac Studio under mlx-lm. Tokens per second, peak memory, sustained throughput, and cost per million tokens for a local production inference workload in 2026.

A 512GB M5 Ultra Mac Studio is the first Apple Silicon machine that can host a 235 billion parameter Mixture of Experts model in unified memory without quantizing past the point of usefulness. Qwen3 235B MoE (22B active parameters per token, eight experts per layer, top two routing) fits in roughly 240GB at FP8 and roughly 130GB at Q4_K_M, which leaves headroom for a 128K context window and the KV cache that goes with it. Llama 3.3 70B Dense is the obvious comparison: same vendor class of capability on standard evals, far smaller, and the historical default for serious local inference on the M-series. The question for an engineering team standing up local inference for a real workload in 2026 is whether the MoE jump pays off on a single Mac Studio or whether the dense model still wins on the practical metrics.

We ran both models head to head on the same 512GB M5 Ultra (60 core GPU, 32 core CPU, macOS 15.4) under mlx-lm 0.21 across decode throughput, prefill latency, peak unified memory, sustained throughput over a one hour run, and the cost per million tokens served at depreciation rates we use in practice. The result is a clearer split than the headline numbers suggest, and the MoE story is not the one the academic papers tell.

Headline Comparison

DimensionQwen3 235B MoE (FP8)Qwen3 235B MoE (Q4_K_M)Llama 3.3 70B Dense (FP8)Llama 3.3 70B Dense (Q4_K_M)
Active parameters per token22B22B70B70B
Total parameters235B235B70B70B
Peak unified memory (8K context, batch 1)248.6 GB132.4 GB78.4 GB47.6 GB
Peak unified memory (32K context, batch 4)286.2 GB168.8 GB96.4 GB64.2 GB
Decode throughput (batch 1, tokens/sec)38.452.626.834.6
Decode throughput (batch 8, tokens/sec)168.2224.698.4124.8
Prefill throughput (8K input, tokens/sec)1,8402,1201,2601,420
Sustained throughput (1 hour, batch 8, tokens/sec)142.4196.888.2112.6
Time to first token (8K context, p50)4.6 sec4.1 sec6.6 sec5.9 sec
Quality on MMLU Pro78.4 percent76.2 percent71.6 percent68.4 percent
Quality on GPQA Diamond56.8 percent54.2 percent48.4 percent44.6 percent
Cost per 1M tokens (FP8, batch 8, 3 year depreciation)$0.42$0.32$0.68$0.54

The cost per million tokens is the line that does the most work in this comparison. The MoE model serves tokens cheaper than the dense model at the same batch size, despite running on a more expensive machine, because the active parameter count (22B) carries the compute and the dormant experts only carry memory cost. Apple Silicon's unified memory architecture is unusually well matched to the MoE workload: the memory bandwidth (819 GB/s on the M5 Ultra) feeds the active experts at the rate the GPU consumes them, and the inactive experts sit in the same memory pool without paging penalty.

Why the MoE Math Lands Where It Does on Apple Silicon

Mixture of Experts models replace the dense feed-forward layers with a router that picks the top K experts per token. Qwen3 235B uses 8 experts per layer with top 2 routing, so 22B parameters are active per token (about 9.4 percent of total). On a GPU server with discrete VRAM, the MoE memory cost is the practical blocker: 240GB of FP8 weights does not fit on an 80GB H100 without sharding or offloading, and the sharding inflates the inter-card communication cost. On the M5 Ultra, the same 240GB sits in one unified memory pool with no inter-card link, no PCIe hop, and no host-to-device copy. The architecture that the MoE design was built to exploit (cheap memory, expensive compute) is the architecture the M5 Ultra ships.

The decode throughput tells the story directly. Qwen3 235B MoE at FP8 decodes faster than Llama 3.3 70B Dense at FP8 (38.4 vs 26.8 tokens/sec at batch 1) because the active parameter count is smaller (22B vs 70B), and the compute per token scales with active parameters, not total parameters. The memory cost is much higher for the MoE (248.6GB vs 78.4GB), but the M5 Ultra has the memory to spare, so the extra weight sitting in unified memory costs nothing at decode time. The result is faster inference on the larger model.

# Loading Qwen3 235B MoE under mlx-lm 0.21
from mlx_lm import load, generate

model, tokenizer = load(
    "mlx-community/Qwen3-235B-MoE-Instruct-mlx-fp8",
    tokenizer_config={"trust_remote_code": True},
)

# A typical call from a production agent loop
response = generate(
    model,
    tokenizer,
    prompt=tokenizer.apply_chat_template(
        [{"role": "user", "content": user_message}],
        tokenize=False,
        add_generation_prompt=True,
    ),
    max_tokens=2048,
    temp=0.2,
)

The Q4_K_M path tells a more nuanced story. Q4 cuts memory roughly in half on both models and lifts decode throughput by 30 to 40 percent because the smaller weights cross the memory bus faster. The quality cost is real: Qwen3 235B drops 2.2 points on MMLU Pro and 2.6 points on GPQA Diamond at Q4, and Llama 3.3 70B drops 3.2 and 3.8 points respectively. For tool calling and deeply structured output workloads, the Q4 tax concentrates on the deep nested tier in ways we covered in our MLX FP8 vs Q4 production inference study. For chat and summarization workloads, the Q4 quality drop is rarely large enough to refuse the throughput gain.

Sustained Throughput Across a One Hour Run

Decode throughput at the start of a benchmark is the easy number. Sustained throughput across a one hour run on a Mac Studio is the number that matters in production, because the M5 Ultra is a workstation, not a server, and the thermal envelope shapes the sustained number more than the burst number. We measured both models continuously for 60 minutes at batch 8 with 4K input and 2K output per request, room temperature 22 degrees Celsius, default cooling.

Qwen3 235B MoE at FP8 sustained 142.4 tokens/sec across the hour, down from a 168.2 tokens/sec peak (a 15 percent thermal derate). Llama 3.3 70B Dense at FP8 sustained 88.2 tokens/sec, down from a 98.4 peak (a 10 percent derate). The MoE model derates more in absolute and relative terms because the prefill and the expert routing both push GPU utilization closer to the thermal limit, but the sustained MoE throughput still exceeds the sustained dense throughput by roughly 60 percent. The thermal derate pattern matches what we have measured across other workloads in our Apple Silicon sustained throughput analysis, and it is the reason we underwrite production capacity on sustained numbers, not headline burst numbers.

Cost Per Million Tokens at Real Depreciation

A 512GB M5 Ultra Mac Studio lists at $13,499 in mid 2026. Over a 3 year depreciation schedule at 8000 hours of utilization per year (a reasonable assumption for a dedicated inference box in an engineering team), the hardware cost amortizes to roughly $0.56 per hour. Add power (220W average draw at full load, $0.18 per kWh on average commercial rates) at about $0.04 per hour, and the total runtime cost is $0.60 per hour.

At sustained 142.4 tokens/sec batch 8 with Qwen3 235B MoE FP8, the machine serves about 512,640 tokens per hour, which works out to roughly $1.17 per million tokens at the host-only cost. Spread across 8 concurrent users at typical chat workloads (3 tokens/sec per user effective throughput), the per-user cost is roughly $0.15 per million tokens. Compared against the OpenAI GPT 5.5 list price ($12 input, $60 output per million tokens) or the Claude Opus 4.8 list price ($15 input, $75 output), the M5 Ultra hosting Qwen3 235B MoE is roughly 50 to 100 times cheaper per token at sustained utilization, with quality that lands between the frontier and the open weight 70B class on standard evals.

Cost line itemQwen3 235B MoE (FP8)Llama 3.3 70B Dense (FP8)Claude Opus 4.8 APIGPT 5.5 API
Cost per 1M output tokens (host only)$1.17$1.89$75.00$60.00
Cost per 1M output tokens (8 concurrent users)$0.15$0.24$75.00$60.00

The frontier API is still the right answer for the highest-stakes calls where every percentage point of quality matters; the local MoE is the right answer for the long tail of high volume, lower stakes calls.

When This Applies to Your Stack

A team running an internal agent loop at hundreds of thousands of calls per day, with sensitive data that cannot leave the corporate network, is the canonical fit for Qwen3 235B MoE on an M5 Ultra Mac Studio. The quality lands close enough to the GPT 5.5 / Claude Sonnet class on most workloads, the cost is two orders of magnitude lower at sustained utilization, and the data never leaves the office. The integration pattern we recommend for production agentic loops on Apple Silicon is in our continuous batching throughput study: mlx-lm 0.21 with the continuous batching path, batch size 8 or 16 depending on context length, FP8 weights as the default, Q4 only when the workload is provably tolerant of the quality drop.

If you are evaluating whether Qwen3 235B MoE on Apple Silicon fits your workload, or comparing it against vLLM on a GPU server for the same job, Contra Collective specializes in AI infrastructure decisions where the right answer depends on the workload shape, the data residency constraints, and the unit economics. The model that wins on the benchmark page is rarely the model that wins on the cost sheet, and we make those tradeoffs explicit before the procurement decision lands.

FAQ

Does Qwen3 235B MoE require a 512GB M5 Ultra, or will a 256GB M5 Ultra work? A 256GB M5 Ultra fits the Q4_K_M version (132GB peak at 8K context) with headroom for the KV cache. The FP8 version needs the 512GB configuration to fit at 32K context with a comfortable batch size. For a single user chat workload, the 256GB box at Q4 is the cheaper entry point and still meaningfully faster than the 70B dense alternative.

How does the MoE routing affect tool calling reliability? The router introduces a small amount of variance in which experts handle a given token, which can affect deterministic outputs slightly. On strict JSON schema tool calls we measured no statistically significant difference between Qwen3 235B MoE and Qwen3 32B Dense on the simple and nested schema tiers; the deep nested tier showed a small MoE advantage (94.2 percent vs 91.8 percent valid JSON) at FP8.

Is there a vLLM equivalent for serving Qwen3 235B MoE on Apple Silicon? Not at parity yet. mlx-lm 0.21 added MoE-aware kernels in early 2026 that bring throughput within 20 percent of the equivalent vLLM path on H100 hardware for active parameter count. For multi-user continuous batching, mlx-lm is the right choice on Apple Silicon today.

What is the right batch size for production? Batch 8 is the sweet spot for Qwen3 235B MoE on the 512GB M5 Ultra at 8K context, balancing throughput and per-user latency. Batch 16 doubles throughput but adds 200 to 400 milliseconds to time to first token. For a chat workload, batch 8 is the right default; for a background data processing workload, batch 16 or 32 is reasonable.

[ 02 ] — Keep Reading

More from the lab.

Ready when you are

Want to discuss this topic?

Start a Conversation