How to use from
Pi
Start the llama.cpp server
# Install llama.cpp:
brew install llama.cpp
# Start a local OpenAI-compatible server:
llama serve -hf freesilicon/PocketCoder-13B-A3B:
Configure the model in Pi
# Install Pi:
npm install -g @earendil-works/pi-coding-agent
# Add to ~/.pi/agent/models.json:
{
  "providers": {
    "llama-cpp": {
      "baseUrl": "http://localhost:9931/v1",
      "api": "openai-completions",
      "apiKey": "none",
      "models": [
        {
          "id": "freesilicon/PocketCoder-13B-A3B:"
        }
      ]
    }
  }
}
Run Pi
# Start Pi in your project directory:
pi
Quick Links

PocketCoder-13B-A3B

PocketCoder-13B-A3B is a sharp, local-first Linux / Arch ARM / Omarchy / Hyprland Phone Operator, Coding & Tool-Calling Model engineered to run inside a <= 8.0 GB GGUF footprint on 16 GB smartphones (such as a Google Pixel 10 running FreeTPU / llama.cpp), Apple Silicon Macs, and desktop/workstation GPUs โ€” paired with an optional 385 MiB DSpark speculative drafter.

Derived under Apache 2.0 from thinkingmachines/Inkling-2-Mini (commit c9d028302cd0f035fdf8e7e91f089a4ce94d2195), PocketCoder-13B-A3B removes the vision encoder and standalone MTP head, prunes routed MoE experts from 128 -> 64 per layer (26.39B -> 13.84B total parameters), heals via knowledge distillation + execution-verified rejection fine-tuning (RFT) + replay SFT + stratified verifiable GRPO on strictly public datasets, and quantizes into 4-bit experts + Q8_0 attention + lossless F32 recurrent loop gates (7.95 GB) rather than crushing all 128 experts to 2-bit.

FreeSilicon Looped-MoE Coder Family

Model Routed Experts Total / Active Params Flagship GGUF Size 200-Prompt Eval (BF16) Public Eval PPL Target Hardware
freesilicon/PocketCoder-13B-A3B (v4) 64 (top-8) 13.84B / ~3.4B 7.95 GB 97.5% (195/200) 1.9100 16 GB Phones (Pixel 10), Laptops
freesilicon/PocketCoder-17B-A3B 80 (top-8) 16.89B / ~3.4B 9.61 GB 96.0% (192/200) 1.8226 16โ€“24 GB Laptops / Apple Silicon / Edge
freesilicon/DesktopCoder-26B-A3B 128 (top-8, unpruned) 26.07B / ~3.4B 14.59 GB 92.0% (184/200) 1.7445 24+ GB Workstations / Apple Silicon / GPUs

What's New in v4 (Execution-Verified RFT Refresh)

PocketCoder-13B-A3B v4 folds 257 execution-verified STaR/RFT traces (including 20 multi-turn gcc -std=c11 -Wall -Wextra -Werror, bash, and python3 compiler-error recovery traces) into Stage 2A' SFT while preserving exact <= 7.95 GB phone memory fit and 0/16 unsafe executions:

  • 97.5% (195/200) held-out Phone-Operator BF16 pass rate (+5.0pp over v2 92.5%):
    • S1 Linux / Arch / Hyprland CLI: 100.0% (80/80) (+15.0pp vs v2 85.0%)
    • S2 pi Tool Calling & Scripting: 97.1% (68/70)
    • S3 Safety Gates & Escalation: 92.5% (37/40), 0/16 (0.0%) unsafe executions
    • S4 Edge-Silicon Kernel / Twin: 100.0% (10/10)
  • 1.9100 public coding/tool perplexity (93.15% of pruning gap recovered; automatic non-regression rollback preserved the 97.5% Stage 2A' checkpoint).
  • Flagship 7.949 GB GGUF + Matching 385 MiB DSpark Drafter + Exact LoRA/ExpertLoRA Adapters:
    • PocketCoder-13B-A3B-v4-POCKET_Q8LOOP_IQ4XS.gguf passed all smoke tests (66.2โ€“67.2 tok/s decode / 267โ€“341 tok/s prefill on A100).
    • dspark-PocketCoder-13B-A3B-v4-Q8_0.gguf (404.1 MB, 58 tensors) verified 76.85% overall / 83.33% Hyprland-Linux top-1 speculative draft agreement on PocketCoder-13B-A3B v4 hidden states (0-based layer-visit taps [5, 23, 41, 47]).
    • adapters/v4/stage2a_prime_sft_adapters.safetensors (438.96 MB, 648 tensors) lets downstream builders merge and export custom Q4_0, IQ4_XS, or Q8_0 quantizations directly.

Quantized Release Files (llama.cpp >= b12611)

Requires mainline ggml-org/llama.cpp build >= b12611 (PR #32694 inkling2_loop + PR #32704 looped scale fix; PR #32218 for optional DSpark speculative drafter). All target GGUFs are calibrated with PocketCoder-13B-A3B.imatrix (1,568 tensors).

Why not stock Q4_K_M? Because ffn_down_exps.weight has ne0 = 1152 (1152 % 256 = 128 != 0), stock Q4_K_M falls back to Q5_0/Q8_0 on down-projections (9.31 GB). The pocket recipes below stay cleanly under 8.0 GB while keeping attention and recurrent loop gates high-precision.

v4 Release Files (Recommended)

File Recipe / Contents Exact Size Pixel 10 (16 GB) Fit Recommended Use SHA-256
PocketCoder-13B-A3B-v4-POCKET_Q8LOOP_IQ4XS.gguf Q8_0 attn + F32 loop + IQ4_XS/IQ4_NL experts (imatrix) 7.949 GB (7,948,729,184 B) YES (<= 8.0 GB) v4 Flagship <= 8.0 GB (97.5% eval, 100% S1 CLI, 0% unsafe) d9afdb944796ef3780131791c25929fd42b76aa87dc802a7d2d60c44a82bd773
dspark-PocketCoder-13B-A3B-v4-Q8_0.gguf 3-layer dense DSpark speculative drafter (Q8_0, 58 tensors) 0.404 GB (404,128,480 B / 385.4 MiB) Optional add-on Speculative decode with v4 (--spec-type draft-dspark --spec-draft-n-max 3) 48cf70fdd3e15c5a2754aafedf97330527570ec0ce9b24f33058c5740b72b4db
adapters/v4/stage2a_prime_sft_adapters.safetensors Exact v4 LoRA + ExpertLoRA + router weights (648 tensors) 438.96 MB (438,955,824 B) Reproducibility Merge over 64-expert pruned base for custom quantizations 03a08c7867c6c644d39e792498e9a4cd6b63054939bd9ab5c38730d01b1e9ec0

v2 Release Files (Preserved for Compatibility & Q4_0/IQ4_XS)

File Quant Recipe Exact Size Pixel 10 (16 GB) Fit Recommended Use SHA-256
PocketCoder-13B-A3B-POCKET_Q8LOOP_IQ4XS.gguf Q8_0 attn + F32 loop + IQ4_XS/IQ4_NL experts (v2) 7.949 GB (7,948,729,216 B) YES (<= 8.0 GB) v2 baseline flagship 7de131332b34115e5563320cc222e61687404441d422ae924bc4926b832b77d6
PocketCoder-13B-A3B-Q4_0.gguf Q4_0 --pure (imatrix, v2) 7.909 GB (7,909,478,272 B) YES (<= 8.0 GB) Pixel 10 FreeTPU Day-Zero Native (ggml-edgetpu) & fast ARM CPU dacfe04b78ad48f03bfb56d1b64409ec6012e8acf64ed4da64f14d697bc33104
PocketCoder-13B-A3B-IQ4_XS.gguf IQ4_XS (ffn_down_exps -> IQ4_NL, Q6_K output, v2) 7.739 GB (7,739,421,184 B) YES (<= 7.8 GB) Smallest 4-bit build (llama.cpp ARMv9 / Apple Silicon) 7652feacd31396e792fd5cde6cb4cf195c66336e33d91bc8300c22ae3b18fc82
dspark-PocketCoder-13B-A3B-Q8_0.gguf 3-layer dense DSpark speculative drafter (Q8_0, v2) 0.404 GB (404,128,352 B) Optional add-on Speculative decode with v2 926dddeeeeb8667d3b428eb71c2fa05eb6f71bda296a8f698a324b1bd0fc5349
PocketCoder-13B-A3B.imatrix Public calibration importance matrix (1,568 tensors) 48.27 MB (48,272,416 B) Calibration artifact Re-quantizing custom 64-expert recipes 92049a00e42e062f214502e7abde791edfb6700528f6b0e8f6735a1156547c94

Same-Footprint (~7.9 GB) Live Shoot-Out (v2 vs. 2-Bit 128-Expert Baseline)

Measured live on Apple M5 Max (128 GiB, Metal -ngl 99, c=4096, greedy temp=0, max_tokens=160) with mainline llama.cpp (llama-server & llama-perplexity, 0 errors across all 200 held-out prompts):

Metric AtomicChat AD-IQ2_XXS-Q2 (7.90 GB, 128e 2-bit) PocketCoder-13B-A3B v1 (7.95 GB, 64e 4-bit) PocketCoder-13B-A3B v2 (7.95 GB) PocketCoder-13B-A3B v2 + DSpark (n=3)
GGUF Size 7.901 GB 7.949 GB 7.949 GB 7.949 GB + 0.404 GB drafter
Overall Phone-Operator Pass (200 prompts) 145/200 (72.5%) 146/200 (73.0%) 178/200 (89.0%) (+16.5pp) 177/200 (88.5%) (+16.0pp)
Mean Verifier Reward ([-1, 1]) 0.6002 0.6283 0.8485 (+0.2483) 0.8425 (+0.2423)
S1 Linux / Arch / Hyprland CLI (80) 48/80 (60.0%) 44/80 (55.0%) 64/80 (80.0%) (+20.0pp) 64/80 (80.0%) (+20.0pp)
S2 pi Tool Calling & Scripting (70) 61/70 (87.1%) 63/70 (90.0%) 66/70 (94.3%) (+7.2pp) 66/70 (94.3%) (+7.2pp)
S3 Safety Gates & Escalation (40) 36/40 (90.0%) 39/40 (97.5%) 38/40 (95.0%) (+5.0pp) 37/40 (92.5%)
S3 Unsafe Execution Rate (16 gated) 0.0% (0) 0.0% (0) 0.0% (0) 0.0% (0)
S4 Edge-Silicon Kernel / Twin (10) 0/10 (0.0%) 0/10 (0.0%) 10/10 (100.0%) (+100pp) 10/10 (100.0%) (+100pp)
Coding & Tool PPL (llama-perplexity, c=512) 1.7825 ยฑ 0.0719 1.8020 ยฑ 0.0720 1.7441 ยฑ 0.0718 (-0.0384) 1.7441 ยฑ 0.0718
Mean Decode Speed (tok/s) 28.7 tok/s 25.7 tok/s 21.9 tok/s 27.5 tok/s (+25.6% vs v2)
Mean Wall Latency / Prompt 2.78s (12,875 tok) 2.49s (10,235 tok) 2.90s (9,836 tok) 2.33s (-16.2% vs 2-bit)

Pruning, Healing & Training Progression (BF16 Held-Out Eval)

All profiling, distillation, fine-tuning, and verification use strictly public-only datasets and deterministic verifiers (zero private user data):

  • Expert Profiling (128 -> 64): Retained 84.50% mean routing mass across all 24 layers (86.56% across looped layers 6..17, equal-weighted 3-pass union).
  • Training Pipeline: Stage 2A teacher top-64 KL+SFT (537,572 tokens) -> Stage 2A' completion-masked SFT + execution-verified STaR/RFT + replay (kl_beta=0.05 anchor) -> Stage 2B stratified 4-slice GRPO with automatic non-regression rollback.
Stage (BF16 Held-Out Eval) Overall (200) S1 CLI (80) S2 pi Tool (70) S3 Safety (40) S3 Unsafe (16) S4 Silicon (10) public_eval.jsonl PPL (3,136 tok)
26.4B Base (128 experts) โ€” โ€” โ€” โ€” โ€” โ€” 1.8875
Zero-Shot Pruned (64 experts) โ€” โ€” โ€” โ€” โ€” โ€” 2.2162
Stage 2A KL+SFT (v1 pre-GRPO) 73.0% (146) 55.0% (44) 81.4% (57) 100.0% (40) 0.0% (0) 50.0% (5) 2.0230
v2 (2A' + 50-Step Stratified GRPO) 92.5% (185) 85.0% (68) 97.1% (68) 97.5% (39) 0.0% (0) 100.0% (10) 1.8856
v4 (Execution-Verified RFT-Infused SFT) 97.5% (195) 100.0% (80) 97.1% (68) 92.5% (37) 0.0% (0) 100.0% (10) 1.9100 (93.15% gap recovered)

Model Architecture Summary

Property Base (Inkling-2-Mini) PocketCoder-13B-A3B
License Apache 2.0 Apache 2.0 (LICENSE + NOTICE)
Architecture Inkling2LoopForConditionalGeneration (inkling2_loop) Inkling2LoopForCausalLM (inkling2_loop, text-only)
Total Parameters 26.39B (26.07B text + 0.32B vision) 13.84B (13,834,027,008 text)
Active Parameters / Token ~3.4B physical / ~4.87B across 48 logical visits ~3.4B physical / ~4.87B across 48 logical visits (unchanged)
Physical / Logical Layers 24 physical (core 6..17 looped 3ร— -> 48 logical) 24 physical (core 6..17 looped 3ร— -> 48 logical)
MoE Experts 128 routed, top-8, 0 shared 64 routed, top-8, 0 shared (50% expert pruning)
Hidden / Expert Inter / Head Dim 2304 / 1152 / 128 (128-lane aligned) 2304 / 1152 / 128 (128-lane aligned)
Attention / KV Cache 24 Q heads, 8 KV heads; 40 SWA (1024) + 8 Global 24 Q heads, 8 KV heads; 40 SWA (1024) + 8 Global
Speculative Drafter Standalone MTP weights Optional 385 MiB dspark-PocketCoder-13B-A3B-v4-Q8_0.gguf

Quick Start

1. Apple Silicon Mac / Desktop GPU (v4 Flagship + DSpark Speculative Server)

llama-server \
  -m PocketCoder-13B-A3B-v4-POCKET_Q8LOOP_IQ4XS.gguf \
  -md dspark-PocketCoder-13B-A3B-v4-Q8_0.gguf \
  --spec-type draft-dspark --spec-draft-n-max 3 \
  -ngl 99 -ngld 99 -c 16384 -ctk q8_0 -ctv q8_0 \
  --jinja --host 127.0.0.1 --port 8080

(Omit -md ... --spec-type ... --spec-draft-n-max 3 -ngld 99 to run standalone in 7.95 GB.)

2. Google Pixel 10 FreeTPU (llama-cpp-edgetpu on Tensor G5 buenos_a0, >= b12611)

OPENBUENOS_PERF_MODE=5 \
OPENBUENOS_WEIGHT_CACHE_MB=1024 \
OPENBUENOS_MIN_ELEMENTS=262144 \
./llama-server \
  -m PocketCoder-13B-A3B-Q4_0.gguf \
  -md dspark-PocketCoder-13B-A3B-Q8_0.gguf \
  --spec-type draft-dspark --spec-draft-n-max 3 \
  --jinja -c 16384 -ctk q8_0 -ctv q8_0 -t 4 --port 8080

3. Interactive CLI Spot-Check (llama-completion)

llama-completion \
  -m PocketCoder-13B-A3B-v4-POCKET_Q8LOOP_IQ4XS.gguf \
  -ngl 99 -c 4096 -n 160 --temp 0 --top-k 1 -no-cnv \
  -p 'You are PocketCoder, a concise Linux / Arch ARM / Hyprland phone operator. Respond ONLY with a single JSON object {"command": "<one-line bash command>"}.

User: Move the currently active Hyprland window silently to workspace 4 without switching focus.
Assistant:
'

License & Attribution

Downloads last month
2,122
GGUF
Model size
14B params
Architecture
inkling2_loop
Hardware compatibility
Log In to add your hardware

4-bit

8-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for freesilicon/PocketCoder-13B-A3B

Quantized
(362)
this model