Best local uncensored coding models
The best uncensored coding model to run locally is Qwen 3.8 27B Abliterated, which needs about 17 GB at 4-bit and fits one 24 GB GPU or a 32 GB Mac.
The four, side by side
| # | Model | Parameters | Size at 4-bit | Runs on | License |
|---|---|---|---|---|---|
| 5 | Qwen 3.8 27B Abliteratedhuihui-ai/Huihui-Qwen3.8-27B-abliterated | 27.8B | about 17 GB | one 24 GB GPU or a 32 GB Mac | Apache 2.0 |
| 6 | Qwen 3.6 35B-A3B Abliteratedhuihui-ai/Huihui-Qwen3.6-35B-A3B-abliterated | 36B total, 3B active | about 22 GB | one 24 GB GPU | Apache 2.0 |
| 7 | Gemma 4 31B Hereticcoder3101/gemma-4-31B-it-heretic | 31.3B | about 19 GB | one 24 GB GPU | Apache 2.0 |
| 8 | Llama 3.1 8B Abliteratedmlabonne/Meta-Llama-3.1-8B-Instruct-abliterated | 8B | about 5 GB | an 8 GB GPU or a laptop | Llama 3.1 Community License |
Figures come from each Hugging Face model card, and 4-bit sizes are estimates.
Each model
5. Qwen 3.8 27B Abliterated
The newest abliterated Qwen here, small enough at 4-bit to leave room for context on a 24 GB card. Its GGUF build had over 4.3 million downloads in the last month. Weights are on huihui-ai/Huihui-Qwen3.8-27B-abliterated.
6. Qwen 3.6 35B-A3B Abliterated
The only mixture-of-experts model among the local picks. Its MTP GGUF build had over 5 million downloads in the last month. Weights are on huihui-ai/Huihui-Qwen3.6-35B-A3B-abliterated.
7. Gemma 4 31B Heretic
Google's Gemma 4 31B, edited to stay close to the original model. Abliterated with the Heretic tool. Weights are on coder3101/gemma-4-31B-it-heretic.
8. Llama 3.1 8B Abliterated
The smallest and oldest model here, so expect much less from it in an agent than from the 27B to 36B models. Published by mlabonne, whose 2024 write-up made abliteration popular. Weights are on mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated.
Wire one into a coding agent
Run the model behind a local server, then point the agent at it.
- Claude Code works through Ollama, which "supports a subset of the Anthropic Messages API" (Ollama docs), with
ANTHROPIC_BASE_URLset tohttp://localhost:11434. - Codex starts with
codex --oss, which picks "between LM Studio and Ollama" (Codex docs). - OpenCode, Cline, Kilo Code, Roo Code and Hermes Agent take any local Chat Completions server as an OpenAI-compatible provider.
# Claude Code on a local model served by Ollama
export ANTHROPIC_BASE_URL=http://localhost:11434
claudeLocal or hosted?
| Local (ranks 5 to 8) | Hosted (ranks 1 to 4) | |
|---|---|---|
| Model size | 8B to 36B | 320B to 2,780B |
| Context | Limited by the GPU's memory | 1,048,576 tokens |
| Cost | The machine and its electricity | From $0.24 per 1M input tokens |
| Where your code goes | It stays on your machine | To the API, under its retention policy |
For large repositories and long sessions, pick a hosted model from the full ranking and one of the APIs for coding agents.