AI News

Best Local AI Model for Coding: 7 Models Tested on Real Coding Jobs

Kingy tested 7 local AI models (8 files: Qwen3.8 27B in two sizes) on 4 coding jobs (a landing page, a budget tracker app, a browser game and a Python bug fix; the score counts the last three), three runs each, plus a job that means searching files with tools. Scripts marked every result; no AI marked another AI. Main runs: November 14 to 15, 2026.

Lucy AI Studio sent free by Cephalon, which paid for an earlier Kingy AI video. Cephalon has no say in results. Mac and laptop bought, RTX 4090 and 5090 rented, by Kingy AI.

Update, November 27, 2026: Our Local AI Scoreboard moved to a harder job set (0.3) on November 24, 2026, so the board scores further down this page come from the earlier job set. On the harder set, averaging the same three coding jobs this page counts (budget tracker, game and bug fix) on our Lucy AI Studio: Inkling 2 Mini 99.2, gpt-oss-120b 98.0, Flint 40B A2.5B 97.5 and Qwen3.8 27B’s 2-bit file 97.1, while Qwen3.6 35B A3B rose to 92.7. We had not tested Inkling 2 Mini or Flint 40B A2.5B when this page was made. See the scores by job.

The short answer

  • Highest coding scores: gpt-oss-120b scored 99.2, Qwen3.8 27B in a 2-bit file 98.1 and Gemma 4 31B 94.6 out of 100. They never averaged below 87.5 on any of the three scored jobs. Their likely ranges overlap with each other and with three models below them, so treat this as a top group, not a strict order.
  • Best if you have 128 GB (a 128GB Mac or a 128GB Ryzen AI Max PC): gpt-oss-120b. It is in the top group and finished a typical coding job in 1.5 min on our test box. It needs about 72.24 GB, just over what a 96GB machine leaves free by our rule.
  • Best on a 24GB graphics card: Gemma 4 31B (94.6, typical job 3.2 min on our box), or Qwen3.8 27B 2-bit for a higher score if you can wait. We haven’t timed either on a 24GB card yet.
  • Best on a 12GB or 16GB card, or a 16GB Mac: Qwen3.8 27B, 2-bit file. It needs only about 9.80 GB and scored 98.1, but it thinks for a long time: a typical coding job took 11.8 min on our box. Note the file we scored is an August version (details under How to run it).
  • Fast and still good: Gemma 4 26B A4B scored 87.1 and finished a typical coding job in 42 s. It even ran on our 8GB gaming laptop with part of the model in system memory: 82.4 on coding, 52 s a job.
Bar chart of Kingy coding scores: gpt-oss-120b 99.2, Qwen3.8 27B 2-bit 98.1 and Gemma 4 31B 94.6 highest; Qwen3 4B lowest at 48.0

Coding scores for every model we tested

Scores are out of 100: the share of each job’s checks the result passed, averaged over 3 coding jobs (tracker app, game, bug fix) and 3 runs each. Every model scored between 90.2 and 100.0 on the landing page, so it barely tells them apart; like our Local AI Scoreboard, we show it but don’t count it. The likely range is where the real average probably sits; when two ranges overlap, call it a tie. All runs on our Lucy AI Studio (AMD Ryzen AI Max+ 395, 128 GB shared memory), with each maker’s recommended settings.

Model and file Coding jobs Landing (not counted) / tracker / game / bug fix Tool job Kingy Lab coding tasks Typical time per coding job Speed, all jobs Memory needed (8K context)
gpt-oss-120b
gpt-oss-120b-F16.gguf (65.37 GB)
99.2 (likely 97.7 to 100.0) 94.1 / 100.0 / 97.6 / 100.0 95.2 97% 1.5 min 33.8 tok/s 72.24 GB
Qwen3.8 27B, 2-bit file
Qwen3.8-27B-UD-IQ2_S.gguf (8.37 GB)
98.1 (likely 96.0 to 100.0) 100.0 / 96.6 / 97.6 / 100.0 97.6 Not in that test 11.8 min 18.8 tok/s 9.80 GB
Gemma 4 31B
gemma-4-31B-it-Q4_K_M.gguf (18.69 GB)
94.6 (likely 90.5 to 98.8) 100.0 / 100.0 / 96.4 / 87.5 100.0 94% 3.2 min 10.5 tok/s 22.22 GB
Qwen3.8 27B, 3-bit file
Qwen3.8-27B-UD-Q3_K_XL.gguf (13.15 GB)
90.5 (likely 71.8 to 100.0) 90.2 / 100.0 / 71.4 / 100.0 100.0 92% 28.8 min 14.2 tok/s 15.05 GB
Gemma 4 26B A4B
gemma-4-26B-A4B-it-Q4_K_M.gguf (16.80 GB)
87.1 (likely 77.3 to 96.9) 100.0 / 100.0 / 73.8 / 87.5 100.0 92% 42 s 54.5 tok/s 18.89 GB
Qwen3.6 35B A3B
Ollama qwen3.6:35b (Q4_K_M) (21.72 GB)
86.5 (likely 76.1 to 96.9) 98.0 / 81.6 / 90.5 / 87.5 100.0 94% 2.6 min 62.0 tok/s 24.08 GB
Qwen3 8B
Qwen3-8B-Q4_K_M.gguf (5.03 GB)
67.9 (likely 50.9 to 84.8) 94.1 / 83.9 / 40.5 / 79.2 83.3 78% 2.9 min 36.5 tok/s 6.86 GB
Qwen3 4B
Qwen3-4B-Q4_K_M.gguf (2.50 GB)
48.0 (likely 30.9 to 65.1) 94.1 / 42.5 / 45.2 / 56.3 64.3 61% 2.1 min 52.6 tok/s 4.08 GB

Typical time is the middle value over all 12 coding runs (landing included), including up to two fix rounds when a script error was sent back. Speed is tokens written per second while writing, across all 9 board jobs (llama.cpp’s own timings; prompt reading not included). Kingy Lab coding is a separate test of 30 smaller coding tasks (November 7 to 12, 2026); it scored the 3-bit Qwen3.8 27B file, not the 2-bit one. Memory needed uses our Local AI checker‘s rule.

Why time per job matters as much as the score

Two models can both pass a coding job while one keeps you waiting many times longer. Thinking models write a long private plan before the answer, so their typical time depends on how much they think, not only on tokens per second.

  • Qwen3.8 27B writes at 18.8 tokens a second in the 2-bit file on our box and thinks at length. Its slowest coding run took 71.1 min. The 3-bit file scored lower (90.5), partly because one browser-game run hit the 32,768-token reply limit while still thinking and was cut off.
  • gpt-oss-120b is much bigger but uses only about 5.1 billion of its 117 billion parameters for each word (OpenAI’s model card), so it writes at 33.8 tokens a second and finished a typical job in 1.5 min.
  • Qwen3.6 35B A3B was the fastest writer on our Lucy AI Studio (62.0 tokens a second) and scored 86.5; it thinks before answering, so a typical job still took 2.6 min.
  • Gemma 4 26B A4B ran with thinking off and was the quickest to a finished result (42 s).

Pick by the memory you have

This page answers “which model for coding”. Our memory-size pages answer “what fits my machine” for every job. Want to check your own computer? The Local AI checker shows what fits.

Your machine Our coding pick What we measured
8GB graphics card Gemma 4 26B A4B, if you also have 32 GB of system memory Coding 82.4 on our RTX 5070 laptop (8 GB card, 32 GB memory), 46.6 tok/s, typical job 52 s. Only Qwen3 4B fits on the card alone: coding 47.7.
12GB graphics card Qwen3.8 27B, 2-bit file Needs 9.80 GB of the 10.5 GB a 12GB card leaves free. Not timed on a 12GB card.
16GB card or 16GB Mac Qwen3.8 27B, 2-bit file Coding 98.1. On a 24GB MacBook Pro (M4 Pro) llama.cpp’s speed tool measured 14.4 tok/s (our Nov 3 test). A 16GB Mac or card may be slower; not measured.
24GB card or 24GB Mac Gemma 4 31B (card, a tight fit); Qwen3.8 27B, 2-bit file (Mac) Gemma 4 31B needs 22.22 GB, which fits a 24GB card (not a 24GB Mac, where macOS keeps about a third). On August 17 we measured Qwen3.8 27B at 49.1 tok/s on a PC with a 24GB card (llama.cpp’s speed tool), but in a 4-bit Q4_K_M file we didn’t score here (Can You Run It hub). On our rented RTX 4090 Gemma 4 31B scored 91.1 at 20.0 tok/s (it may have been short of memory; the logs don’t show where it ran) and Gemma 4 26B A4B 86.5 at 165.8 tok/s.
32GB card or 32GB Mac Card: Gemma 4 31B for the score, Gemma 4 26B A4B for quick answers. Mac: Qwen3.8 27B 2-bit for the score, Gemma 4 26B A4B for quick answers On a 32GB card both fit (Gemma 4 31B needs 22.22 GB, Qwen3.6 24.08 GB). A 32GB Mac leaves 21.0 GB free: Gemma 4 26B needs 18.89 GB, so Gemma 4 31B and Qwen3.6 don’t fit. On our rented RTX 5090 Gemma 4 31B scored 93.1 at 65.8 tok/s and Gemma 4 26B A4B 92.7 at 227.7 tok/s.
64GB Mac or Ryzen AI Max PC Gemma 4 31B or Qwen3.8 27B 2-bit for the score; Gemma 4 26B A4B for quick answers On shared memory (a Mac or Ryzen AI Max PC) everything we tested fits except gpt-oss-120b. Not timed on a 64GB machine.
128GB Mac or PC gpt-oss-120b Coding 99.2, typical job 1.5 min on our 128GB Ryzen AI Max+ 395.

Same models on a gaming laptop and a MacBook

We ran the same jobs with the model served from two everyday machines and scored the results the same way. For the same file, scores fall within each other’s likely range (the Mac’s Qwen3 8B came in lowest, 14 points under the Lucy’s); speed is what changes.

Machine Model Coding jobs Tool job Speed, all jobs Typical time per coding job
RTX 5070 Laptop GPU, 8 GB, 32 GB memory, Windows Gemma 4 26B A4B 82.4 (likely 62.5 to 100.0) 100.0 46.6 tok/s 52 s
Same laptop Qwen3 8B 73.3 (likely 58.7 to 88.0) 71.4 22.6 tok/s 8.5 min
Same laptop Qwen3 4B 47.7 (likely 31.4 to 64.0) 45.2 41.5 tok/s 5 min
MacBook Pro, M4 Pro, 24 GB Qwen3 8B 53.9 (likely 32.4 to 75.4) 78.6 36.1 tok/s 4.1 min

On the laptop, Gemma 4 26B doesn’t fit the 8GB card, so llama.cpp kept part of it in system memory and it still answered at 46.6 tokens a second. That only works with enough system memory; our laptop has 32 GB.

RTX 4090 and RTX 5090

We rented an RTX 4090 (24 GB) and an RTX 5090 (32 GB) by the hour from RunPod and ran the same board on them: the model ran on the card and the results were checked by the same scripts on our Lucy. All 8 files finished on both cards (November 15 to 16, 2026).

Card Model Coding jobs Tool job Speed, all jobs
RTX 4090 (24 GB), rented gpt-oss-120b 85.1 (likely 66.8 to 100.0) 100.0 9.5 tok/s*
RTX 4090 (24 GB), rented Qwen3.8 27B, 2-bit file 78.2 (likely 53.1 to 100.0) 97.6 71.2 tok/s
RTX 4090 (24 GB), rented Gemma 4 31B 91.1 (likely 81.9 to 100.0) 100.0 20.0 tok/s†
RTX 4090 (24 GB), rented Qwen3.8 27B, 3-bit file 89.7 (likely 71.1 to 100.0) 100.0 54.4 tok/s
RTX 4090 (24 GB), rented Gemma 4 26B A4B 86.5 (likely 74.9 to 98.2) 100.0 165.8 tok/s
RTX 4090 (24 GB), rented Qwen3.6 35B A3B 95.0 (likely 91.1 to 99.0) 100.0 137.6 tok/s
RTX 4090 (24 GB), rented Qwen3 8B 61.6 (likely 47.0 to 76.1) 97.6 133.8 tok/s
RTX 4090 (24 GB), rented Qwen3 4B 39.8 (likely 25.0 to 54.7) 61.9 176.8 tok/s
RTX 5090 (32 GB), rented gpt-oss-120b 96.4 (likely 92.8 to 100.0) 76.2‡ 11.2 tok/s*
RTX 5090 (32 GB), rented Qwen3.8 27B, 2-bit file 86.1 (likely 71.2 to 100.0) 100.0 105.3 tok/s
RTX 5090 (32 GB), rented Gemma 4 31B 93.1 (likely 88.0 to 98.2) 100.0 65.8 tok/s
RTX 5090 (32 GB), rented Qwen3.8 27B, 3-bit file 90.1 (likely 71.5 to 100.0) 100.0 85.3 tok/s
RTX 5090 (32 GB), rented Gemma 4 26B A4B 92.7 (likely 86.1 to 99.2) 100.0 227.7 tok/s
RTX 5090 (32 GB), rented Qwen3.6 35B A3B 89.7 (likely 83.5 to 95.9) 100.0 229.2 tok/s
RTX 5090 (32 GB), rented Qwen3 8B 71.0 (likely 58.2 to 83.8) 85.7 205.2 tok/s
RTX 5090 (32 GB), rented Qwen3 4B 44.6 (likely 28.2 to 61.0) 64.3 270.0 tok/s

Same model files as on the Lucy (checked by fingerprint), where Qwen3 8B scored 67.9 on coding and Qwen3 4B 48.0. Each card’s likely range overlaps the Lucy’s for the same model, so the board can’t see the card changing the score. The speed does change: the 5090 wrote Qwen3 8B at 205.2 tokens a second against 36.5 on the Lucy. Rented-card speed is llama.cpp’s own timing on the card, counting replies from runs repeated after a dropped connection. Time per job on these cards isn’t on this page. * gpt-oss-120b is a 65 GB file, so on both cards part of it ran from system memory; its speed there says little about the card. † Gemma 4 31B on the RTX 4090 may have been short of memory; the logs don’t show whether all of it stayed on the card. ‡ One of the three tool-job runs was hit by a llama.cpp server error and scored 4 of 14 checks.

Coding agents and tools

Coding agents need a model that calls tools reliably. Our tool job gives the model three tools (list, read and write files) and 30 calls to find four facts in 37 files. Gemma 4 31B, Gemma 4 26B A4B, Qwen3.6 35B A3B and the 3-bit Qwen3.8 27B scored 100 on all three runs; Qwen3.8 27B 2-bit 97.6; gpt-oss-120b 95.2; Qwen3 8B 83.3; Qwen3 4B 64.3. To set one up, see our guides to a private coding agent with Qwen3.8-27B and OpenCode with local models.

What we don’t know yet

  • Big projects. Each of our coding jobs is one file. On Kingy Lab’s harder trial set, which includes coding across several files, the home models we tried (Qwen3.6 35B and Gemma 4 31B) scored 64 to 65% overall against 97 to 100% for two top cloud models. gpt-oss-120b and Qwen3.8 27B were not in that set, and it reports overall scores, not coding alone. So for large multi-file projects we can’t yet say how close the best home models get.
  • Speeds on other desktop graphics cards. We measured a rented RTX 4090 and RTX 5090 and our RTX 5070 laptop; other cards are not measured on this page. Our Scoreboard has since added a rented RTX 5080 and RTX 4070 Ti.
  • The newest Qwen3.8 27B files. Unsloth replaced its files on November 10 to 12, 2026; we scored the August versions.
  • Other runners and settings. All scores use llama.cpp and each maker’s recommended settings. A different app, quant or setting can score differently.

How to run it

The easy way: LM Studio. It has a built-in model downloader. Open the Discover tab (Cmd+2 on a Mac, Ctrl+2 on Windows or Linux), paste the repository name shown for each model below into the search bar, and pick the file with the same quant name (LM Studio’s guide).

The direct way: llama.cpp, the engine we test with. Install it with winget install llama.cpp on Windows or brew install llama.cpp on a Mac (install guide). -hf downloads a model from Hugging Face and -c 8192 sets the 8K context our fit numbers assume. -hf also downloads and loads a model’s vision file if it has one (about 1.2 GB for Gemma 4); our fit numbers are for text only, so the commands below add --no-mmproj to skip it (server options).

  • Qwen3.8 27B, 2-bit file: Unsloth replaced many of its Qwen3.8 27B files, including both files we scored, on November 10 to 12, 2026 (commit history), so a plain download now gets a newer file than the one we scored. To use the exact file we tested, download Qwen3.8-27B-UD-IQ2_S.gguf from the August 20 revision, then run llama-server -m Qwen3.8-27B-UD-IQ2_S.gguf -c 8192. The newer file has the same name; we haven’t scored it.
  • Gemma 4 31B: llama-server -hf lmstudio-community/gemma-4-31B-it-GGUF:Q4_K_M -c 8192 --no-mmproj, or search lmstudio-community/gemma-4-31B-it-GGUF in LM Studio and pick Q4_K_M.
  • Gemma 4 26B A4B: llama-server -hf lmstudio-community/gemma-4-26B-A4B-it-GGUF:Q4_K_M -c 8192 --no-mmproj, or search lmstudio-community/gemma-4-26B-A4B-it-GGUF in LM Studio and pick Q4_K_M.
  • Qwen3.6 35B A3B: the file we scored is Ollama’s. Install Ollama, then run ollama run qwen3.6:35b. That tag is the same download as qwen3.6:latest on Ollama’s tag list (checked November 15, 2026).
  • gpt-oss-120b: llama-server -hf unsloth/gpt-oss-120b-GGUF:F16 -c 8192 --no-mmproj, or search unsloth/gpt-oss-120b-GGUF in LM Studio and pick F16.

MLX on a Mac. Apple’s own MLX-LM runs models converted to MLX format: pip install mlx-lm, then mlx_lm.generate --model <an MLX model on Hugging Face> --prompt "hello" (or mlx_lm.chat for a chat session). MLX files are different downloads from the ones above, with different sizes, and we didn’t score or time them, so check the size before you download.

Save memory on a tight fit. With -hf, llama.cpp also downloads a model’s vision file if it has one (about 1.2 GB for Gemma 4) and loads it; add --no-mmproj to skip it (server options). That matters for Gemma 4 31B on a 24GB card, which has only about 0.3 GB to spare by our rule. Ollama’s qwen3.6:35b also includes a 0.9 GB vision part.

How we tested

Kingy tested every score on this page on our own machines. Nothing here is copied from a model maker’s chart.

  • Board score. Kingy’s local AI board v0.2 gives each model the same 9 real jobs: a landing page, a budget tracker app, a browser game, a Python bug fix, a chart from a messy spreadsheet, questions about a long document, a job that means searching 37 files with tools, a motion title and a video cut. Scripts check each result; no AI judges another AI. Every job runs 3 times, so a coding score averages 9 runs (3 counted jobs x 3) and an all-jobs score 27 runs, with the makers’ own settings and the exact files named on this page (checked by fingerprint). The main runs were on our Lucy AI Studio (AMD Ryzen AI Max+ 395, 128 GB), November 14 to 15, 2026 (UTC). If a check script stopped early on a run, the checks it didn’t reach count as fails. “Likely range” is a rough 95% range around the average: when two ranges overlap, we treat the board as unable to tell those two models apart.
  • The Kingy Lab coding column comes from Kingy Lab’s 120-task test (November 7 to 12, 2026), which marks 60 everyday jobs, 30 coding tasks and 30 writing tasks with rules to follow.
  • Fit uses the same rule as our Local AI checker: memory needed = file size + room for 8,192 tokens (8K) of conversation (the “KV cache”, from each model’s official settings file) + 10%. We count a graphics card’s memory minus 1.5 GB for the screen and driver, and, as a cautious rule of our own, two-thirds of a Mac’s memory up to 36 GB (three-quarters above that), leaving the rest for macOS and your apps. macOS itself lets the graphics side use more (about 19 GB of our 24GB MacBook Pro), so a Mac may fit a little more than we say. For Qwen3.6 and Qwen3.8 we leave out a small fixed memory state (under 0.2 GB). GB means a billion bytes. File sizes come from Hugging Face and Ollama, checked November 15, 2026. A “No” here means it doesn’t fit in that memory by this rule.
  • Speed is only shown where we measured it, with the chip and date. Everything else says “not measured yet”. We never estimate a speed on these pages. Speed on real jobs is how fast the model wrote during the 27 board runs: tokens written divided by the time spent writing, from llama.cpp’s own timings, counting every reply (including replies from runs we repeated after a dropped connection). It leaves out the time spent reading the prompt.
  • Coding jobs. Landing page (17 checks), budget tracker app (29), browser game played by a script bot (28) and a Python bug fix with planted bugs and one visible failing test (16). If a result had an error a user would see, the error went back to the model for up to two fix rounds.
  • Time per job is the model’s own writing time for that job, fix rounds included, measured on the machine that served it.
  • Reply limits (maximum tokens per reply) follow each model’s setup: 16,384 for Gemma 4 and gpt-oss-120b, 20,000 for Qwen3 4B and 8B, 32,768 for Qwen3.6 and Qwen3.8. A reply cut off at the limit is marked as it stands.

Sources

Revision log

  • November 15, 2026: first version: 7 models (8 files) on the Lucy, 3 on the laptop, 1 on the Mac; all 8 files on rented RTX 4090 and RTX 5090.
  • November 27, 2026: Added a note with the Scoreboard’s job set 0.3 coding results. Scores below not redone.