DEV Community

Cover image for Testing 3 Local LLMs on a CPU-Only Laptop — Here's What Actually Happened
Nayim Imrit
Nayim Imrit

Posted on

Testing 3 Local LLMs on a CPU-Only Laptop — Here's What Actually Happened

As developers, we keep hearing that powerful LLMs require expensive GPUs. I wanted to find out how far local AI could actually go on a modest machine — no cloud, no cost, no GPU.

So I ran a practical experiment using LM Studio on a 40 GB RAM laptop without a dedicated GPU, pitting three open-weight models against each other on a real coding task.


Test Environment

Hardware

  • Standard laptop
  • 40 GB RAM
  • No dedicated GPU (CPU inference only)

Software

  • LM Studio (context length: 8192 tokens)
  • VS Code
  • 100% local inference — no API calls, no internet required

Models tested

  • Qwen 3 14B
  • GPT-OSS 20B
  • Gemma 4 26B A4B QAT

The Experiment

Each model received the exact same prompt: generate a complete Snake Game using only HTML, CSS, and JavaScript — no frameworks, no external libraries.

I evaluated each result on:

  • ⏱ Generation time
  • 🪙 Token usage
  • 🎨 Quality of the generated UI
  • 🔧 Whether manual corrections were needed
  • 🧑‍💻 Overall developer experience

Results

🟡 Qwen 3 14B

Generation took approximately 9 minutes and produced 3 separate files (HTML, CSS, JS).

After testing, the snake moved too fast. I had to send a follow-up prompt, which triggered another full 9-minute generation cycle — and only around five lines of code actually changed.

Pros

  • Functional game on the second attempt
  • Game instructions included
  • Low token usage (~651)

Cons

  • Slow generation
  • Required a second iteration to fix gameplay speed
  • Basic UI

🟢 GPT-OSS 20B

This was the biggest surprise of the experiment.

Generation completed in approximately 3 minutes, producing a single self-contained HTML file with all HTML, CSS, and JS included. Token usage clocked in at ~51 — significantly lower than the other models (worth noting: token counting may differ across models, so treat this as directional rather than a strict apples-to-apples comparison).

Unlike Qwen, the game worked correctly on the first attempt.

Pros

  • Fastest generation by far
  • Lowest token usage
  • No code changes required
  • Score displayed during gameplay
  • Instructions included

Cons

  • UI is functional but not the most polished

🔵 Gemma 4 26B A4B QAT

Gemma required some extra setup before running correctly — specifically, adding capability entries in LM Studio's model configuration. If you're not comfortable editing model configs, budget a few extra minutes here.

Generation took approximately 8 minutes and produced 3 files (HTML, CSS, JS).

The output was noticeably more polished visually than the other two models.

Pros

  • Best-looking interface of the three
  • Well-structured project output
  • Instructions included

Cons

  • Highest token usage (~2170)
  • Slower than GPT-OSS
  • Requires extra LM Studio configuration

Comparison Table

Model Time Files Tokens UI Quality Needed Changes
GPT-OSS 20B ~3 min 1 ~51 Good ❌ No
Gemma 4 26B ~8 min 3 ~2170 ⭐ Best ❌ No
Qwen 3 14B ~9 min 3 ~651 Basic ✅ Yes

Key Observations

A few patterns stood out:

  • GPT-OSS prioritised efficiency — working code, fast, no fuss.
  • Gemma prioritised presentation — the cleanest interface, though it needs configuration upfront.
  • Qwen produced functional code but needed a second pass to be usable.
  • All three models completed a real coding task without touching the cloud.

Conclusion

For my workflow, GPT-OSS was the clear winner.

Gemma produced the most polished result, but GPT-OSS delivered the best overall developer experience:

✅ Fastest generation time

✅ Lowest token consumption

✅ Working solution on the first attempt

✅ Zero additional configuration

✅ Single-file output — easy to review and ship

On CPU-only hardware, these differences compound quickly. Waiting 3 minutes instead of 9 — and skipping multiple iterations — makes a real difference to your flow.

More broadly, this experiment shows how capable modern open-weight models have become. Even on a mid-range laptop with no GPU, you can generate complete applications locally, maintain full privacy, and avoid cloud inference costs entirely.

If you've tested local models on constrained hardware, I'd love to hear what you found — drop a comment below. 👇


Tested with LM Studio on a 40 GB RAM, CPU-only laptop. Models: GPT-OSS 20B, Qwen 3 14B, Gemma 4 26B A4B QAT.

Top comments (0)