Downloads · 30 days
262
100% of all-time downloads
massimolauri/NomadCoder-4B-GGUF
NomadCoder-4B-GGUF is a text generation model from massimolauri. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
Downloads · 30 days
262
100% of all-time downloads
All-time downloads
262
Public
Repo size
2.7 GB
Likes
0
Public
Click a slice to open those files.
.gguf2.7 GB · 100%
From the Hugging Face model README
| Attribute | Specification |
|---|---|
| Maintainer & Author | Massimo Lauri |
| Base Model | Qwen 3.5 4B (Alibaba Cloud) |
| Core Architecture | DeepSeek Engram (Conditional Associative N-Gram Memory) |
| Execution Innovation | Massimo Lauri Engram Weight Folding (Zero-Overhead GGUF) |
| Binary Format | GGUF (Q4_K_M Mixed Precision Quantization) |
| Disk & RAM Footprint | 2.57 GB |
| Primary Target | 100% CPU Execution (AVX-512 / AVX2 / DDR5) with ultra-low latency |
| License | Apache 2.0 |
NomadCoder-4B is a specialized, production-ready coding LLM designed for local, autonomous execution on CPU-only hardware. It delivers state-of-the-art code generation, Next.js 15.4 / React 19 architecture, accessible UI design (Shadcn / Aceternity 3D), and robust Linux SRE distributed concurrency while fitting entirely inside 2.57 GB of RAM.
Unlike standard small language models that suffer from catastrophic forgetting on recent 2025/2026 framework releases, NomadCoder-4B integrates the DeepSeek Engram N-Gram Memory Architecture, trained and mathematically folded directly into the transformer weights.
NomadCoder-4B implements the architectural breakthrough pioneered by DeepSeek-AI:
Reference: "Conditional Memory via Scalable Lookup: A New Axis of Sparsity for LLMs" (arXiv:2601.07372).
DeepSeek demonstrated that modern Transformers suffer from capacity bottlenecks when forced to store vast syntactic idioms, library APIs, and repetitive code sequences within dense feed-forward weights. While Mixture-of-Experts (MoE) introduces sparsity along the compute axis, Engram introduces a completely orthogonal axis of sparsity: Conditional Memory via Scalable N-Gram Lookup.
Input Tokens: [t_1, t_2, ..., t_i]
│
├──► 1. Causal 1D Convolution (Preserves local sequence grammar)
│
├──► 2. Multi-Head N-Gram Hashing (Deterministic LCG Prime Modulo)
│ hash(t_i, ..., t_{i-n}) = ( Σ t_{i-k} * p^k ) mod M
│
├──► 3. Associative Key-Value Memory Retrieval
│ W_key ∈ R^[2560 x 1024], W_val ∈ R^[2560 x 1024]
│
└──► 4. Massimo Lauri Weight Folding (Zero-Overhead C++ Compilation)
ΔW = (W_val · W_key^T) · scale ──► Folded into Attention & MLP
DeepSeek's original Engram architecture requires custom CUDA lookup tables and dynamic embedding gather ops, which cannot run efficiently on CPU environments (causing Python overhead, slow speeds of 2 tok/s, and 18 GB RAM bloat).
To bring this architecture to commercial CPU production, Massimo Lauri engineered "Engram Weight Folding":
decoder_layers[i].linear_attn.out_proj.weightdecoder_layers[i].mlp.down_proj.weight--no-mtp), cleanly aligning the model to a standard 32-layer GGUF layout.Result: 100% of the DeepSeek Engram associative memory benefits are preserved, but the model compiles into a standard GGUF binary that runs natively in C++ via llama.cpp and ollama with AVX-512 SIMD vectorization and zero runtime memory lookup overhead.
NomadCoder-4B was aligned on a strictly audited corpus of 592 multi-turn production code pairs across 4 critical modern software domains:
| Dataset Source | Temporal Audit | Samples | Domain Focus |
|---|---|---|---|
Claude Fable 5 (saidutta69/fable-5-premium) | August 2026 | 200 | Linux SRE, distributed async locks, Redlock atomic Lua release, zero-orphan concurrency. |
Next.js 15.4 Reasoning (Slava32/next.js-15.4-with-reasoning) | August 2025 | 150 | React 19 (useActionState, useOptimistic), Server Actions ('use server'), App Router caching, typed Zod validation. |
Shadcn UI Interactions (dimsavva/shadcn) | July 2025 | 150 | Accessible UI components, micro-animations, physical cubic-bezier easing, modern form integration. |
Aceternity UI 3D Aesthetics (ParthDesai1719/aceternity_ui_comps) | June 2025 | 92 | 3D Tilt Cards (perspective: 1000px), dynamic cursor glare lighting, spring physics, Tailwind CSS. |
16.54 (Loss: 2.8059)2.47 (Loss: 0.9039, representing an 85.07% reduction in uncertainty).Because the model weights are only 2.57 GB, execution speed is bounded strictly by RAM bandwidth:
| Architecture / Platform | RAM Technology | Effective Bandwidth | Baseline Generation Speed | With N-Gram Speculative Decoding |
|---|---|---|---|---|
| Standard Server / PC | DDR4-2666 Dual | ~50 GB/s | 15.0 – 16.0 tok/s | 25 – 35 tok/s |
| Modern Desktop PC | DDR5-6000 Dual | ~90 GB/s | 30 – 35 tok/s | 55 – 65 tok/s 🎯 |
| Modern AI Laptop / Mini-PC | LPDDR5X-7500 | ~120 GB/s | 40 – 48 tok/s | 65 – 80 tok/s 🚀 |
| Workstation / Cloud Server | DDR5 Quad/8-Channel | 160 – 300 GB/s | 60 – 100+ tok/s | 120+ tok/s 🔥 |
ollama run hf.co/massimolauri/NomadCoder-4B-GGUF
llama-server \
-m NomadCoder-4B-Q4_K_M.gguf \
--alias NomadCoder-4B \
--port 10200 \
--host 0.0.0.0 \
-ngl 0 \
-c 131072 \
-t 16 \
-tb 24 \
--jinja
When using NomadCoder-4B in IDE extensions (Cline, Roo Code, Aider, Cursor), enable in-context N-gram self-speculation:
llama-server \
-m NomadCoder-4B-Q4_K_M.gguf \
--alias NomadCoder-4B \
--port 10200 \
--host 0.0.0.0 \
-ngl 0 \
-c 131072 \
-t 16 \
--spec-type ngram-simple \
--spec-ngram-simple-size-n 3 \
--spec-ngram-simple-size-m 8 \
--spec-draft-n-max 8 \
--jinja
docker run -d \
--name nomadcoder_gguf_server \
--restart unless-stopped \
-p 10200:10200 \
nomadcoder-4b-gguf:latest
| Task Domain | Base Qwen 3.5 4B | NomadCoder-4B (DeepSeek Engram Fused) |
|---|---|---|
| Distributed Lock | Generates insecure redis.delete(key) vulnerable to race-condition lock stealing. | Generates atomic Lua release script (if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('del', KEYS[1])). |
| Next.js 15 & React 19 | Defaults to deprecated React 18 useFormState and pages/ routing conventions. | Implements React 19 useActionState, useOptimistic, 'use server' Server Actions, and typed Zod schemas. |
| 3D UI Aesthetics | Static Tailwind cards without interactive 3D lighting or physics. | Computes mouse bounding rect offsets to drive 3D rotateX/rotateY transforms with dynamic glare reflections and spring easing. |