PocketCoder-17B-A3B / README.md
smoky-agent's picture
Initial public release: PocketCoder-17B-A3B (K=80, 96.0% eval, PPL 1.8226, 3 GGUFs + imatrix + adapters)
ffb759e verified
|
Raw History Blame Contribute Delete
8.32 kB
---
license: apache-2.0
license_link: LICENSE
base_model:
- thinkingmachines/Inkling-2-Mini
base_model_relation: quantized
language:
- en
pipeline_tag: text-generation
library_name: gguf
tags:
- inkling2_loop
- moe
- pruned
- gguf
- phone-operator
- linux
- arch-arm
- omarchy
- hyprland
- tool-calling
- coding
- edge
- freetpu
- apache-2.0
---
# PocketCoder-17B-A3B
**`PocketCoder-17B-A3B`** is the mid-tier **`K=80` expert (`16.89B` total / `~3.4B` active)** looped-MoE Linux, Hyprland, Coding & Tool-Calling model in the FreeSilicon family β€” hitting **`96.0%` (`192/200`)** on the held-out operator benchmark with **`0/16` unsafe executions** and **`1.8226` coding/tool perplexity** (**outperforming the unpruned `26.4B` base model's `1.8875` PPL by `-0.0649`**) in a **`9.40–9.63 GB`** 4-bit GGUF footprint.
Derived under **Apache 2.0** from [`thinkingmachines/Inkling-2-Mini`](https://huggingface.co/thinkingmachines/Inkling-2-Mini) (commit `c9d028302cd0f035fdf8e7e91f089a4ce94d2195`), `PocketCoder-17B-A3B` removes the vision encoder and standalone MTP head, prunes routed MoE experts from `128 -> 80` per layer (`37.5%` expert reduction while preserving `~3.4B` active parameters per token across `48` logical looped layer visits), heals via teacher top-64 KL+SFT + completion-masked replay SFT + stratified 4-slice verifiable GRPO on strictly public datasets, and exports calibrated 4-bit GGUFs (`POCKET_Q8LOOP_IQ4XS`, `Q4_0`, `IQ4_XS`) alongside a fresh importance matrix and exact stage adapters.
### 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`](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 |
| **[`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** |
| [`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 |
---
## Quantized Release Files & Adapters (`llama.cpp >= b12611`)
Requires mainline [`ggml-org/llama.cpp`](https://github.com/ggml-org/llama.cpp) build **`>= b12611`** (PR `#32694` `inkling2_loop` + PR `#32704` looped scale fix). All 3 GGUFs are calibrated with `PocketCoder-17B-A3B.imatrix` (`1,568` tensors) and passed all `6/6` CUDA smoke tests (`hyprctl` CLI + C11 ring buffer).
| File | Recipe / Contents | Exact Size | Recommended Use | SHA-256 |
|---|---|---:|---|---|
| **`PocketCoder-17B-A3B-POCKET_Q8LOOP_IQ4XS.gguf`** | **`Q8_0` attn + `F32` loop + `IQ4_XS`/`IQ4_NL` experts (imatrix)** | **`9.608 GB`** (`9,608,495,424 B`) | **Flagship Quality** (zero 48-pass loop/attn drift) | `a49a8f884171aa40d366043de515f8c0a0db6eaabdef43cd3edc3b3e29167504` |
| `PocketCoder-17B-A3B-Q4_0.gguf` | `Q4_0 --pure` (imatrix) | `9.633 GB` (`9,632,945,472 B`) | Fast ARMv9 / TPU / INT8-lane hardware backends | `3bad752a22169fbf6fe77a74749fa00d336a22a052e31a187eef7bf0ca9c758d` |
| `PocketCoder-17B-A3B-IQ4_XS.gguf` | `IQ4_XS` (`ffn_down_exps -> IQ4_NL`, `Q6_K` output, imatrix) | `9.399 GB` (`9,399,187,392 B`) | **Smallest 4-Bit Build** (`9.40 GB`) | `5fe97deccd46b492f16883a51cdf1e66a32317f000d91ed63dde712a8e28086c` |
| `PocketCoder-17B-A3B.imatrix` | Fresh `K=80` public calibration importance matrix (`1,568` tensors) | `58.89 MB` (`58,892,320 B`) | Re-quantizing custom 80-expert GGUF recipes | `460b41884b2d31560964bf5229120f21f2eba302742d4362abd906d4ce121930` |
| `adapters/stage2a_kl_sft_adapters.safetensors` | Stage 2A teacher-KL + SFT healing adapters | `541.59 MB` (`541,585,280 B`) | Reproducibility / Stage 2A checkpoint | `301085a03af841f10db7111ff8c36ad0cc4fce71ddc92f4e88d599161eae87b8` |
| `adapters/stage2a_prime_sft_adapters.safetensors` | Stage 2A' completion-masked replay SFT adapters | `541.59 MB` (`541,585,280 B`) | Reproducibility / Stage 2A' checkpoint | `f0fca577f06ffce2d45a2985fc4ee0cd12eb88452266073a8e0d59c107ce9367` |
| `adapters/stage2b_grpo_adapters.safetensors` | Final Stage 2B stratified GRPO adapters | `541.59 MB` (`541,585,280 B`) | Final adapter weights merged into GGUFs | `f1d7be3e4125a3a537c60821ea5e3406c6aabe69e53245564192d91231a8a1e6` |
---
## Training Progression & Held-Out Evaluation (BF16)
All profiling, healing, fine-tuning, and verification use **strictly public-only** datasets and deterministic verifiers:
| 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) | Sanity |
|---|---:|---:|---:|---:|---:|---:|---:|---:|
| `26.4B` Base (`128` experts) | β€” | β€” | β€” | β€” | β€” | β€” | `1.8875` | `2/3` |
| Stage 2A KL+SFT (`80` experts) | `87.5% (175)` | `85.0% (68)` | `91.4% (64)` | `82.5% (33)` | `0.0% (0)` | `100.0% (10)` | `1.7884` | `3/3` |
| Stage 2A' Cold-Start SFT+Replay | `96.0% (192)` | `92.5% (74)` | `97.1% (68)` | `100.0% (40)` | `0.0% (0)` | `100.0% (10)` | `1.8237` | `3/3` |
| **Final Stage 2B Stratified GRPO** | **`96.0% (192)`** | **`92.5% (74)`** | **`97.1% (68)`** | **`100.0% (40)`** | **`0.0% (0)`** | **`100.0% (10)`** | **`1.8226`** (`-0.0649` vs 26.4B base) | **`3/3`** |
- **`173.25%` of pruning PPL gap recovered** (`1.8226` vs `1.8875` unpruned base).
- **`100.0%` (`40/40`) Safety Gate calibration** with **`0/16` (`0.0%`) unsafe executions** and **`100.0%` (`10/10`)** edge-silicon kernel twin pass rate.
---
## Model Architecture Summary
| Property | Base (`Inkling-2-Mini`) | `PocketCoder-17B-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) | **`16.89B`** (`16,892,559,360` 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 | **`80` routed, `top-8`, `0` shared** (`37.5%` expert pruning) |
| **Hidden / Expert Inter / Head Dim** | `2304` / `1152` / `128` | `2304` / `1152` / `128` |
| **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 |
---
## Quick Start
### 1. Local OpenAI-Compatible Server (`llama-server`)
```bash
llama-server \
-m PocketCoder-17B-A3B-POCKET_Q8LOOP_IQ4XS.gguf \
-ngl 99 -c 32768 -ctk q8_0 -ctv q8_0 \
--jinja --host 127.0.0.1 --port 8080
```
*(Compatible with the dense `dspark-PocketCoder-13B-A3B-v4-Q8_0.gguf` drafter via `-md ... --spec-type draft-dspark --spec-draft-n-max 3 -ngld 99` because DSpark depends only on `hidden_size=2304` and vocabulary.)*
### 2. Interactive CLI Spot-Check (`llama-completion`)
```bash
llama-completion \
-m PocketCoder-17B-A3B-POCKET_Q8LOOP_IQ4XS.gguf \
-ngl 99 -c 4096 -n 160 --temp 0 --top-k 1 -no-cnv \
-p 'Write a concise C11 function `int ring_push(RingBuf *rb, uint8_t byte)` for a fixed-size power-of-two ring buffer returning 0 on success and -1 if full.
```c
'
```
---
## License & Attribution
- Licensed under the **Apache License, Version 2.0** (see [`LICENSE`](LICENSE) and [`NOTICE`](NOTICE)).
- Derived from [`thinkingmachines/Inkling-2-Mini`](https://huggingface.co/thinkingmachines/Inkling-2-Mini) (commit `c9d028302cd0f035fdf8e7e91f089a4ce94d2195`), copyright Thinking Machines Lab, Inc., licensed under Apache 2.0.
- Users must also comply with the base model's [Acceptable Use Policy](https://thinkingmachines.ai/model-acceptable-use-policy/) where applicable.