smoky-agent commited on
Commit
14339a2
Β·
verified Β·
1 Parent(s): 718ef5a

Add PocketCoder-13B-A3B v4 (97.5% eval, 7.95 GB flagship + matching DSpark v4 + adapters)

Browse files
.gitattributes CHANGED
@@ -38,3 +38,5 @@ PocketCoder-13B-A3B-POCKET_Q8LOOP_IQ4XS.gguf filter=lfs diff=lfs merge=lfs -text
38
  PocketCoder-13B-A3B-Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
39
  PocketCoder-13B-A3B.imatrix filter=lfs diff=lfs merge=lfs -text
40
  dspark-PocketCoder-13B-A3B-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
 
 
 
38
  PocketCoder-13B-A3B-Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
39
  PocketCoder-13B-A3B.imatrix filter=lfs diff=lfs merge=lfs -text
40
  dspark-PocketCoder-13B-A3B-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
41
+ PocketCoder-13B-A3B-v4-POCKET_Q8LOOP_IQ4XS.gguf filter=lfs diff=lfs merge=lfs -text
42
+ dspark-PocketCoder-13B-A3B-v4-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
PocketCoder-13B-A3B-v4-POCKET_Q8LOOP_IQ4XS.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9afdb944796ef3780131791c25929fd42b76aa87dc802a7d2d60c44a82bd773
3
+ size 7948729184
README.md CHANGED
@@ -30,19 +30,65 @@ tags:
30
 
31
  # PocketCoder-13B-A3B
32
 
33
- **`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 **NVIDIA DGX Spark / desktop GPUs** β€” paired with an optional **`385 MiB` DSpark speculative drafter**.
34
 
35
- Derived under **Apache 2.0** from [`thinkingmachines/Inkling-2-Mini`](https://huggingface.co/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 + 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.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  ---
38
 
39
- ## Same-Footprint (`~7.9 GB`) Live Shoot-Out vs. 2-Bit 128-Expert Baseline
 
 
40
 
41
- At the exact **`~7.9 GB`** smartphone memory ceiling, pruning and healing `128 -> 64` experts lets `PocketCoder-13B-A3B` run at **4-bit MoE + `Q8_0` attention + `F32` loop precision** instead of 2-bit quantization across 128 unpruned experts.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  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):
44
 
45
- | 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`, Flagship)** | **`PocketCoder-13B-A3B` v2 + DSpark (`7.95 + 0.40 GB`, `n=3`)** |
46
  |---|---:|---:|---:|---:|
47
  | **GGUF Size** | `7.901 GB` | `7.949 GB` | **`7.949 GB`** | `7.949 GB` + `0.404 GB` drafter |
48
  | **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`)** |
@@ -56,22 +102,22 @@ Measured live on **Apple M5 Max (128 GiB, Metal `-ngl 99`, `c=4096`, greedy `tem
56
  | **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)** |
57
  | **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)** |
58
 
59
- ### Key Highlights
60
- - **`+16.5pp` higher Phone-Operator pass rate (`89.0%` vs `72.5%`)** at the same `~7.9 GB` footprint, including **`+20.0pp`** on Arch/Hyprland CLI, **`+7.2pp`** on strict `pi` JSON tool calling, **`+5.0pp`** on safety-gate calibration with **`0.0%` unsafe executions**, and **`100%`** on edge-silicon kernel tasks.
61
- - **Lower (better) coding/tool perplexity (`1.7441` vs `1.7825`)** than the unpruned 128-expert 2-bit quantization, despite using half as many routed experts.
62
- - **`1.26Γ—` speculative decode speedup (`21.9 -> 27.5 tok/s`, `2.33s` mean latency)** across all 200 prompts with the included `385 MiB` `dspark-PocketCoder-13B-A3B-Q8_0.gguf` drafter β€” **16.2% faster end-to-end wall latency** than the 2-bit baseline (`2.78s`).
63
- - **`8/8 (100%)` interactive `llama-completion` usability spot-check PASS** (`8/8` zero-repetition clean) across Hyprland CLI, Arch ARM Bluetooth/PipeWire diagnostics, strict `pi` JSON tool calling, destructive/outbound human-gate refusal, Python & C bugfixes, mixed-precision architecture reasoning, and multi-turn debugging.
64
-
65
  ---
66
 
67
- ## Core Capabilities
 
 
68
 
69
- 1. **Linux / Arch ARM / Omarchy / Hyprland CLI & System Control**
70
- - Composes exact, flag-accurate commands for `hyprctl`, `bash`, `systemd` (`systemctl`/`journalctl`), `nmcli`, `pactl`, `bluetoothctl`, `pacman`, `jq`, and `sqlite3` for Linux-native mobile and desktop workflows.
71
- 2. **Strict Tool Calling & Concise Local Coding**
72
- - Emits schema-valid JSON tool calls for `pi`-style local harnesses (`read`, `edit`, `write`, `grep`, `bash`, `git`), writes tight Python/C/TypeScript/Bash fixes, and stays concise for mobile screens and low-power decode.
73
- 3. **Calibrated Safety Gates & Escalation**
74
- - Executes safe read-only or reversible local operations directly; stops cleanly with `decision: "gate_human"` and `action: null` on outbound sends, destructive deletes, spend, or account/security changes; and escalates genuinely complex refactors cleanly.
 
 
 
 
75
 
76
  ---
77
 
@@ -81,77 +127,24 @@ Measured live on **Apple M5 Max (128 GiB, Metal `-ngl 99`, `c=4096`, greedy `tem
81
  |---|---|---|
82
  | **License** | Apache 2.0 | Apache 2.0 (`LICENSE` + `NOTICE`) |
83
  | **Architecture** | `Inkling2LoopForConditionalGeneration` (`inkling2_loop`) | `Inkling2LoopForCausalLM` (`inkling2_loop`, text-only) |
84
- | **Total Parameters** | `26.39B` (`26.07B` text + `0.32B` vision) | **`13.84B`** (`13,836,254,208` raw / `13,834,028,544` unpadded) |
85
  | **Active Parameters / Token** | `~3.4B` physical / `~4.87B` across 48 logical visits | **`~3.4B` physical / `~4.87B` across 48 logical visits** (unchanged) |
86
  | **Physical / Logical Layers** | `24` physical (`core 6..17` looped `3Γ—` -> `48` logical) | `24` physical (`core 6..17` looped `3Γ—` -> `48` logical) |
87
  | **MoE Experts** | `128` routed, `top-8`, `0` shared | **`64` routed, `top-8`, `0` shared** (`50%` expert pruning) |
88
  | **Hidden / Expert Inter / Head Dim** | `2304` / `1152` / `128` (`128`-lane aligned) | `2304` / `1152` / `128` (`128`-lane aligned) |
89
- | **Attention / KV Cache** | `24` Q heads, `8` KV heads; `40` SWA (`1024`) + `8` Global (`48` logical slots) | `24` Q heads, `8` KV heads; `40` SWA (`1024`) + `8` Global (`48` logical slots) |
90
- | **Context Length** | `1,048,576` max | `4K / 16K / 64K` practical on 16 GB phones (`Q8_0` KV: `157 MiB` / `361 MiB` / `1.23 GB`) |
91
- | **Vision / Speculative Drafter** | Vision tower + MTP weights | Vision removed; MTP exported separately as optional `385 MiB` `dspark-PocketCoder-13B-A3B-Q8_0.gguf` |
92
-
93
- ---
94
-
95
- ## Quantized Release Files (`llama.cpp >= b12611`)
96
-
97
- Requires mainline [`ggml-org/llama.cpp`](https://github.com/ggml-org/llama.cpp) build **`>= b12611`** (PR `#32694` `inkling2_loop` + PR `#32704` looped scale fix; PR `#32218` for optional DSpark speculative drafter). All 3 target GGUFs are calibrated with `PocketCoder-13B-A3B.imatrix` (`1,568` tensors) and passed `6/6` CUDA + Metal smoke tests (`hyprctl dispatch movetoworkspacesilent 3` + C ring buffer).
98
-
99
- > **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.
100
-
101
- | File | Quant Recipe | Exact Size | Pixel 10 (`16 GB`) Fit | Recommended Use | SHA-256 |
102
- |---|---|---:|:---:|---|---|
103
- | `PocketCoder-13B-A3B-POCKET_Q8LOOP_IQ4XS.gguf` | **`Q8_0` attn + `F32` loop + `IQ4_XS`/`IQ4_NL` experts (imatrix)** | **`7.949 GB`** (`7,948,729,216 B`) | **YES** (`<= 8.0 GB`) | **Flagship Quality `<= 8.0 GB`** (lowest KL, zero 48-pass loop/attn drift) | `7de131332b34115e5563320cc222e61687404441d422ae924bc4926b832b77d6` |
104
- | `PocketCoder-13B-A3B-Q4_0.gguf` | `Q4_0 --pure` (imatrix) | **`7.909 GB`** (`7,909,478,272 B`) | **YES** (`<= 8.0 GB`) | **Pixel 10 `FreeTPU` Day-Zero Native** (`ggml-edgetpu`) & fast ARM CPU | `dacfe04b78ad48f03bfb56d1b64409ec6012e8acf64ed4da64f14d697bc33104` |
105
- | `PocketCoder-13B-A3B-IQ4_XS.gguf` | `IQ4_XS` (`ffn_down_exps -> IQ4_NL`, `Q6_K` output, imatrix) | **`7.739 GB`** (`7,739,421,184 B`) | **YES** (`<= 7.8 GB`) | **Smallest 4-Bit Build** (`llama.cpp` ARMv9 / Apple Silicon / tight RAM) | `7652feacd31396e792fd5cde6cb4cf195c66336e33d91bc8300c22ae3b18fc82` |
106
- | `dspark-PocketCoder-13B-A3B-Q8_0.gguf` | 3-layer dense DSpark speculative drafter (`Q8_0`, 58 tensors) | **`0.404 GB`** (`404,128,352 B` / `385.4 MiB`) | Optional add-on | Speculative decode (`--spec-type draft-dspark --spec-draft-n-max 3`) | `926dddeeeeb8667d3b428eb71c2fa05eb6f71bda296a8f698a324b1bd0fc5349` |
107
- | `PocketCoder-13B-A3B.imatrix` | Public calibration importance matrix (`1,568` tensors) | `48.27 MB` (`48,272,416 B`) | Calibration artifact | Re-quantizing custom pocket recipes | `92049a00e42e062f214502e7abde791edfb6700528f6b0e8f6735a1156547c94` |
108
-
109
- ---
110
-
111
- ## Pruning, Healing, GRPO & Parity Verification
112
-
113
- All profiling, distillation, fine-tuning, and verification use **strictly public-only** datasets and deterministic verifiers (zero private user data):
114
-
115
- ### 1. Pruning & Post-Pruning Training Progression (BF16 Held-Out Eval)
116
-
117
- - **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).
118
- - **Healing & Stratified RL Pipeline**: `Stage 2A` teacher top-64 KL+SFT (`537,572` tokens) -> `Stage 2A-Prime` completion-masked SFT + general coding/reasoning replay (`kl_beta=0.04` anchor) -> `Stage 2B` stratified 4-slice GRPO polish (`50` steps, `G=6`, `lr=3e-5`, `kl_beta=0.06`, per-slice token caps, smooth S1 partial credit):
119
-
120
- | 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) |
121
- |---|---:|---:|---:|---:|---:|---:|---:|
122
- | `26.4B` Base (`128` experts) | β€” | β€” | β€” | β€” | β€” | β€” | `1.8875` |
123
- | Zero-Shot Pruned (`64` experts) | β€” | β€” | β€” | β€” | β€” | β€” | `2.2171` |
124
- | 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` |
125
- | Stage 2B Unstratified GRPO (`v1`) | `74.0% (148)` | `58.8% (47)` | `88.6% (62)` | `97.5% (39)` | `0.0% (0)` | `0.0% (0)` | `2.0306` |
126
- | Stage 2A-Prime Cold-Start SFT+Replay | `89.5% (179)` | `85.0% (68)` | `97.1% (68)` | `85.0% (34)` | `0.0% (0)` | `90.0% (9)` | `1.8914` |
127
- | **Final `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`** (`-0.0019` vs 26.4B base) |
128
-
129
- ### 2. Real 13.8B Few-Layer Activation Parity (`PyTorch BF16` vs. `llama.cpp`)
130
-
131
- Verified directly on the real 13.8B model across `L0..L2`, `L6.p0`, and looped re-entry `L6.p1 (il=24)` (`sconv`, `SiTU`, `d_rel`, value norm, router top-8, and final logits):
132
-
133
- | Quantized Build (vs. 13.8B PyTorch BF16) | `L0.p0` Top-8 | `L6.p1 (il=24)` Out Cos | `logits` Cos | `logits` Top-1 | `logits` KL |
134
- |---|---:|---:|---:|---:|---:|
135
- | `BF16` GGUF (Metal) | `100.0%` | `0.9997` | `0.9998` | `100.0%` | `0.00072` |
136
- | **`POCKET_Q8LOOP_IQ4XS` (`7.95 GB`, Metal)** | **`99.43%`** | **`0.9979`** | **`0.9984`** | **`100.0%`** | **`0.01045`** (*15Γ— lower than 2-bit `0.158`*) |
137
- | `Q4_0` (`7.91 GB`, Metal) | `97.73%` | `0.9957` | `0.9967` | `95.45%` | `0.02007` |
138
-
139
- ### 3. DSpark Speculative Decoding (`dspark-PocketCoder-13B-A3B-Q8_0.gguf`)
140
-
141
- Because DSpark (`385 MiB Q8_0`) is a dense 3-layer drafter that shares only hidden dimension (`2304`) and vocabulary β€” with zero dependency on `n_routed_experts` β€” it pairs directly with the pruned 64-expert model:
142
- - **Coding / Tool Benchmark (`n_max=3`, Metal `llama-server --metrics`)**: `4/4 (100%)` token-ID exact greedy match on both `POCKET_Q8LOOP_IQ4XS` (`alpha = 0.559`, **`2.66 tok/step`**, up to **`1.41Γ—` / `32.8 tok/s`** on C code) and `Q4_0` (`alpha = 0.529`, **`2.57 tok/step`**, up to **`37.3 tok/s`** on C code).
143
- - **Full 200-Prompt Phone-Operator Shoot-Out (`v2 + DSpark`, `n_max=3`)**: **`+25.6%` decode speedup** (`21.9 -> 27.5 tok/s`) and **`-19.7%` lower mean latency** (`2.90s -> 2.33s`).
144
 
145
  ---
146
 
147
  ## Quick Start
148
 
149
- ### 1. Apple Silicon Mac / NVIDIA DGX Spark / Desktop GPU (Flagship + DSpark Speculative Server)
150
 
151
  ```bash
152
  llama-server \
153
- -m PocketCoder-13B-A3B-POCKET_Q8LOOP_IQ4XS.gguf \
154
- -md dspark-PocketCoder-13B-A3B-Q8_0.gguf \
155
  --spec-type draft-dspark --spec-draft-n-max 3 \
156
  -ngl 99 -ngld 99 -c 16384 -ctk q8_0 -ctv q8_0 \
157
  --jinja --host 127.0.0.1 --port 8080
@@ -159,16 +152,7 @@ llama-server \
159
 
160
  *(Omit `-md ... --spec-type ... --spec-draft-n-max 3 -ngld 99` to run standalone in `7.95 GB`.)*
161
 
162
- ### 2. Lightweight Local `pi` Harness (CPU / ARMv9 / Smallest 4-Bit Build)
163
-
164
- ```bash
165
- llama-server \
166
- -m PocketCoder-13B-A3B-IQ4_XS.gguf \
167
- --jinja -c 16384 -ctk q8_0 -ctv q8_0 --port 8080 \
168
- --temp 0.0 --top-k 1
169
- ```
170
-
171
- ### 3. Google Pixel 10 `FreeTPU` (`llama-cpp-edgetpu` on Tensor G5 `buenos_a0`, `>= b12611`)
172
 
173
  ```bash
174
  OPENBUENOS_PERF_MODE=5 \
@@ -181,13 +165,11 @@ OPENBUENOS_MIN_ELEMENTS=262144 \
181
  --jinja -c 16384 -ctk q8_0 -ctv q8_0 -t 4 --port 8080
182
  ```
183
 
184
- *(On `buenos_a0`, `Q4_0` maps natively to INT8/Q4_0 TPU weight lanes, and DSpark `M=4` verification amortizes DMA per token by `~2.0×–2.3Γ—`.)*
185
-
186
- ### 4. Interactive CLI Spot-Check (`llama-completion`)
187
 
188
  ```bash
189
  llama-completion \
190
- -m PocketCoder-13B-A3B-POCKET_Q8LOOP_IQ4XS.gguf \
191
  -ngl 99 -c 4096 -n 160 --temp 0 --top-k 1 -no-cnv \
192
  -p 'You are PocketCoder, a concise Linux / Arch ARM / Hyprland phone operator. Respond ONLY with a single JSON object {"command": "<one-line bash command>"}.
193
 
 
30
 
31
  # PocketCoder-13B-A3B
32
 
33
+ **`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**.
34
 
35
+ Derived under **Apache 2.0** from [`thinkingmachines/Inkling-2-Mini`](https://huggingface.co/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.
36
+
37
+ ### FreeSilicon Looped-MoE Coder Family
38
+ | Model | Routed Experts | Total / Active Params | Flagship GGUF Size | 200-Prompt Eval (BF16) | Public Eval PPL | Target Hardware |
39
+ |---|---:|---:|---:|---:|---:|---|
40
+ | **[`freesilicon/PocketCoder-13B-A3B`](https://huggingface.co/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 |
41
+ | [`freesilicon/PocketCoder-17B-A3B`](https://huggingface.co/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 |
42
+ | [`freesilicon/DesktopCoder-26B-A3B`](https://huggingface.co/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 |
43
+
44
+ ---
45
+
46
+ ## What's New in **v4** (Execution-Verified RFT Refresh)
47
+
48
+ **`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:
49
+
50
+ - **`97.5%` (`195/200`) held-out Phone-Operator BF16 pass rate** (`+5.0pp` over v2 `92.5%`):
51
+ - **S1 Linux / Arch / Hyprland CLI:** **`100.0%` (`80/80`)** (`+15.0pp` vs v2 `85.0%`)
52
+ - **S2 `pi` Tool Calling & Scripting:** **`97.1%` (`68/70`)**
53
+ - **S3 Safety Gates & Escalation:** **`92.5%` (`37/40`)**, **`0/16` (`0.0%`) unsafe executions**
54
+ - **S4 Edge-Silicon Kernel / Twin:** **`100.0%` (`10/10`)**
55
+ - **`1.9100` public coding/tool perplexity** (`93.15%` of pruning gap recovered; automatic non-regression rollback preserved the `97.5%` Stage 2A' checkpoint).
56
+ - **Flagship `7.949 GB` GGUF + Matching `385 MiB` `DSpark` Drafter + Exact LoRA/ExpertLoRA Adapters:**
57
+ - `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).
58
+ - `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]`).
59
+ - `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.
60
 
61
  ---
62
 
63
+ ## Quantized Release Files (`llama.cpp >= b12611`)
64
+
65
+ Requires mainline [`ggml-org/llama.cpp`](https://github.com/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).
66
 
67
+ > **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.
68
+
69
+ ### v4 Release Files (Recommended)
70
+ | File | Recipe / Contents | Exact Size | Pixel 10 (`16 GB`) Fit | Recommended Use | SHA-256 |
71
+ |---|---|---:|:---:|---|---|
72
+ | **`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` |
73
+ | **`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` |
74
+ | `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` |
75
+
76
+ ### v2 Release Files (Preserved for Compatibility & `Q4_0`/`IQ4_XS`)
77
+ | File | Quant Recipe | Exact Size | Pixel 10 (`16 GB`) Fit | Recommended Use | SHA-256 |
78
+ |---|---|---:|:---:|---|---|
79
+ | `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` |
80
+ | `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` |
81
+ | `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` |
82
+ | `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` |
83
+ | `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` |
84
+
85
+ ---
86
+
87
+ ## Same-Footprint (`~7.9 GB`) Live Shoot-Out (v2 vs. 2-Bit 128-Expert Baseline)
88
 
89
  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):
90
 
91
+ | 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`)** |
92
  |---|---:|---:|---:|---:|
93
  | **GGUF Size** | `7.901 GB` | `7.949 GB` | **`7.949 GB`** | `7.949 GB` + `0.404 GB` drafter |
94
  | **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`)** |
 
102
  | **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)** |
103
  | **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)** |
104
 
 
 
 
 
 
 
105
  ---
106
 
107
+ ## Pruning, Healing & Training Progression (BF16 Held-Out Eval)
108
+
109
+ All profiling, distillation, fine-tuning, and verification use **strictly public-only** datasets and deterministic verifiers (zero private user data):
110
 
111
+ - **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).
112
+ - **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.
113
+
114
+ | 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) |
115
+ |---|---:|---:|---:|---:|---:|---:|---:|
116
+ | `26.4B` Base (`128` experts) | β€” | β€” | β€” | β€” | β€” | β€” | `1.8875` |
117
+ | Zero-Shot Pruned (`64` experts) | β€” | β€” | β€” | β€” | β€” | β€” | `2.2162` |
118
+ | 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` |
119
+ | `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` |
120
+ | **`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) |
121
 
122
  ---
123
 
 
127
  |---|---|---|
128
  | **License** | Apache 2.0 | Apache 2.0 (`LICENSE` + `NOTICE`) |
129
  | **Architecture** | `Inkling2LoopForConditionalGeneration` (`inkling2_loop`) | `Inkling2LoopForCausalLM` (`inkling2_loop`, text-only) |
130
+ | **Total Parameters** | `26.39B` (`26.07B` text + `0.32B` vision) | **`13.84B`** (`13,834,027,008` text) |
131
  | **Active Parameters / Token** | `~3.4B` physical / `~4.87B` across 48 logical visits | **`~3.4B` physical / `~4.87B` across 48 logical visits** (unchanged) |
132
  | **Physical / Logical Layers** | `24` physical (`core 6..17` looped `3Γ—` -> `48` logical) | `24` physical (`core 6..17` looped `3Γ—` -> `48` logical) |
133
  | **MoE Experts** | `128` routed, `top-8`, `0` shared | **`64` routed, `top-8`, `0` shared** (`50%` expert pruning) |
134
  | **Hidden / Expert Inter / Head Dim** | `2304` / `1152` / `128` (`128`-lane aligned) | `2304` / `1152` / `128` (`128`-lane aligned) |
135
+ | **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 |
136
+ | **Speculative Drafter** | Standalone MTP weights | Optional `385 MiB` `dspark-PocketCoder-13B-A3B-v4-Q8_0.gguf` |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
 
138
  ---
139
 
140
  ## Quick Start
141
 
142
+ ### 1. Apple Silicon Mac / Desktop GPU (v4 Flagship + DSpark Speculative Server)
143
 
144
  ```bash
145
  llama-server \
146
+ -m PocketCoder-13B-A3B-v4-POCKET_Q8LOOP_IQ4XS.gguf \
147
+ -md dspark-PocketCoder-13B-A3B-v4-Q8_0.gguf \
148
  --spec-type draft-dspark --spec-draft-n-max 3 \
149
  -ngl 99 -ngld 99 -c 16384 -ctk q8_0 -ctv q8_0 \
150
  --jinja --host 127.0.0.1 --port 8080
 
152
 
153
  *(Omit `-md ... --spec-type ... --spec-draft-n-max 3 -ngld 99` to run standalone in `7.95 GB`.)*
154
 
155
+ ### 2. Google Pixel 10 `FreeTPU` (`llama-cpp-edgetpu` on Tensor G5 `buenos_a0`, `>= b12611`)
 
 
 
 
 
 
 
 
 
156
 
157
  ```bash
158
  OPENBUENOS_PERF_MODE=5 \
 
165
  --jinja -c 16384 -ctk q8_0 -ctv q8_0 -t 4 --port 8080
166
  ```
167
 
168
+ ### 3. Interactive CLI Spot-Check (`llama-completion`)
 
 
169
 
170
  ```bash
171
  llama-completion \
172
+ -m PocketCoder-13B-A3B-v4-POCKET_Q8LOOP_IQ4XS.gguf \
173
  -ngl 99 -c 4096 -n 160 --temp 0 --top-k 1 -no-cnv \
174
  -p 'You are PocketCoder, a concise Linux / Arch ARM / Hyprland phone operator. Respond ONLY with a single JSON object {"command": "<one-line bash command>"}.
175
 
adapters/v4/stage2a_prime_sft_adapters.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03a08c7867c6c644d39e792498e9a4cd6b63054939bd9ab5c38730d01b1e9ec0
3
+ size 438955824
dspark-PocketCoder-13B-A3B-v4-Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:48cf70fdd3e15c5a2754aafedf97330527570ec0ce9b24f33058c5740b72b4db
3
+ size 404128480