,

Benchmark Test: Gemma 4 E2B on Ollama on the 2021 MacBook Pro

Gemma 4 E2B (5.1B parameters, Q4_K_M, 131,072-token context) on Ollama 0.40.18, on an M1 Max MacBook Pro with 64 GB of unified memory. Generation ran at 72.2 tok/s and prompt reading at 1,530 tok/s at 14k tokens, dropping to 345 tok/s at 64k. It passed 25 of 30 scored tests, and the judge scored its open-ended answers 6.25 out of 10.

The Short Version

MetricResult
Cold start (first token)8.5 s, of which 8.3 s is model load
Warm first token0.09 s
Generation speed72.2 tok/s (server-reported)
Prompt reading at ~64k tokens345 tok/s
Agent follow-up first token0.22 s, 100% of the prompt reused
Reused after switching agents100%
Long-prompt recall4/6 (67%)
Tool use6/6, 3.72 s per model turn
Logic8/9 in 175 s
Instruction following5/6 (83%)
Judged quality (1-10)6.25
Total test time628 s

The Model

  • Model: Gemma 4 E2B (gemma4 architecture, 35 blocks, with a 512-token sliding attention window)
  • Parameters: 5.1 billion
  • Quantization: Q4_K_M, about 4.8 bits per weight, GGUF format
  • Context window: 131,072 tokens, the model’s maximum
  • Capabilities: text, vision, audio, tool calling, thinking. Thinking is on by default, and I left it on.
  • Sampling: the model’s Ollama entry sets temperature 1, top_k 64 and top_p 0.95. BenchPatrol sends temperature 0 on every request so runs are repeatable. The other settings stayed as the entry has them.

The Engine and Settings

  • Engine: Ollama 0.40.18, llama.cpp runner, GGUF model file
  • Serving: Ollama’s OpenAI-compatible /v1 endpoint
  • Speculative decoding: none

The Hardware

  • Machine: Apple MacBook Pro 16″ (2021), M1 Max with a 10-core CPU (8 performance + 2 efficiency) and a 24-core GPU
  • Memory: 64 GB unified LPDDR5, shared by the CPU and GPU
  • Storage: 1 TB internal SSD
  • OS: macOS 26.6
  • Network: Wi-Fi 6 (802.11ax, 5 GHz, 80 MHz)
  • Power: 45 W AC adapter during the test

How I Tested

Every number here comes from BenchPatrol, a small benchmark harness I wrote to stop guessing at inference speed from agent logs. It talks to any OpenAI-compatible endpoint, runs as a one-shot Docker container on a separate test machine (an old Intel NUC, so the benchmark never competes with the model for CPU or memory), and saves every run as JSON so the next one can be compared against it.

A full run has seven suites:

  • Cold start: time to first token when the model isn’t loaded, and how much of that is load time.
  • Warm generation: three ~700-token answers with the model loaded. I report the median first-token time and generation speed, using the server’s own timing.
  • Tool use: six cases against six fake tools with exact expected answers: a single call with arguments, choosing the right tool, a three-step chain, knowing when not to call a tool, a calculator, and two lookups at once.
  • Agent prompt reuse: an agent with a ~20k-token system prompt asks three questions, a second agent with a different prompt asks one, then the first agent comes back. It measures how much of the prompt the server reuses from its cache, and what that does to first-token time.
  • Long-prompt reading: ~14k- and ~64k-token prompts with three codes buried at 10%, 50% and 90% depth, plus a decoy. It measures reading speed and recall.
  • Logic: nine generated puzzles with checkable answers (ordering, knights and knaves, weekday math, letter counting, inventory math, sequences, inclusion-exclusion, price differences, clock angles). Each gets up to 8,192 output tokens.
  • Quality: six strict instruction-following checks (exact bullet count, raw JSON, all lowercase, a forbidden word plus a word count, answering only from a passage, a three-line haiku) and four open-ended tasks scored 1-10 by a judge model, Claude Sonnet 5.5. In this run, quality answers were capped at 4,096 output tokens. None of the failures below came from hitting that cap.

The questions use a fixed seed, so every run asks exactly the same questions. Each prompt also carries a random nonce, so an earlier run can’t help through the cache.

Three things specific to this run:

  1. Real cold start. The model wasn’t loaded when the run started.
  2. Another model was resident. A second, larger model was loaded on the Mac during the run by something other than the benchmark. I can’t rule out that it shared the GPU for part of the time, but the last two warm runs matched to within 0.2 tok/s.
  3. Network path. The test machine is wired, and the MacBook was on Wi-Fi. That adds a few milliseconds to every first-token time, which only matters for the sub-second numbers.

Results

Speed

The first warm run came in at 55.0 tok/s, then the next two settled at 72.2 tok/s each. First-token times dropped from 0.47 s on that first run to 0.09 and 0.08 s after it.

Prompt reading falls off a cliff as prompts get longer:

Prompt tokensRead timeReading speedRecall
13,6739.09 s1,530 tok/s2/3
63,838185.62 s345 tok/s2/3

At 14k tokens it reads quickly. At 64k it’s less than a quarter of that speed, and the document takes over three minutes.

Cold start was 8.5 seconds, nearly all of it loading the model.

Agent Workloads

This is the test I care about most, because it’s what my agents actually do all day: send the same long system prompt over and over with a little more on the end.

StepPrompt tokensReusedFirst token
A1: agent A, first turn20,3770 (0%)17.87 s
A2: agent A, follow-up20,40920,377 (100%)0.24 s
A3: agent A, follow-up20,44020,417 (100%)0.2 s
B1: agent B, first turn20,3060 (0%)17.32 s
A4: back to agent A20,47220,448 (100%)0.27 s

This is where the model shines. Follow-ups came back 81 times faster than the first turn, and agent A’s cache survived agent B coming through in between. Switching back cost 0.27 seconds.

Accuracy

Tool use: 6/6. Right tools, no malformed JSON, at 3.72 s per model turn. Two quirks still passed. In the three-step chain it looked up the customer and the invoices but added the two amounts itself instead of calling the calculator. In the two-city weather lookup it left out the optional temperature unit.

Long-prompt recall: 4/6. It found the codes at 10% and 50% depth at both sizes, and it didn’t fall for the decoy. But it missed the code buried 90% of the way through both times. At 14k tokens it left that key out of its answer. At 64k it returned null.

Logic: 8/9, in 175 seconds. It used 10,194 output tokens across the nine puzzles, about 1,130 per puzzle. The miss was knights and knaves. The correct answer was that nobody in the puzzle is a knight, and it named three people. Nothing got near the 8,192-token cap.

Instruction following: 5/6. The miss was the forbidden-word test, which asks for a 40-70 word answer that avoids one specific word. It avoided the word but wrote only 35 words.

Judged quality: 6.25/10.

TaskScoreJudge’s notes
Explain MFA to a non-technical owner6Plain and short, with email and banking as priorities, but it only offers texted codes, never recommends an authenticator app, and skips phishing, backup codes and admin accounts.
Debug a Python function7Found the mutable default argument and gave the right fix, but contradicted itself about when the list is created, and its extra alternative changes the function’s behavior.
Decline a meeting politely6Asked for one email and wrote three. They’re courteous, but they overpromise future interest and stay vague about next quarter.
Backup advice6Says no and covers offsite copies, immutability, restore tests and monitoring, but never says to separate backup credentials, and its priorities contradict each other between the text and the table.

Verdict

Gemma 4 E2B is fast and light enough to run anywhere, and its cache handling is excellent. For quick chat, short tool calls or a lightweight router in front of a bigger model, it’ll do the job.

I wouldn’t trust it with anything that matters, though. It missed a code in a long document, got a logic puzzle wrong, and didn’t follow a simple length instruction. On this same Mac, inkling 2 mini is three times slower but got every one of those right, so that’s what I’d run for real work.

Quick on its feet, but it doesn’t read to the end.