AKL MiniCPM5 2B
A frozen MiniCPM5-2B receiver with binary gist memory, an addressable exact-source store, a learned span selector, and a gated input bridge. This release includes the 4-bit MiniCPM weights, source code, selected checkpoints, Qwen sender assets, API server, pi/omp configs and measured reports. It runs locally on Apple Silicon macOS using MLX plus a separate CPU PyTorch sender.
256K is experimental source-history capacity, not demonstrated reliable 256K factual retention. The original source IDs are retained in full; exact evidence is retrieved from that store. This is a custom hybrid runtime, not a model that stock AutoModel, llama.cpp, Ollama or a Hugging Face inference widget can execute as-is.
Download and run
Use Python 3.12 and sufficient free disk space for the roughly 3 GB download plus the runtime environments. No upstream model download is required after obtaining this complete snapshot.
python3.12 -m venv hf-fetch
hf-fetch/bin/python -m pip install huggingface_hub
hf-fetch/bin/hf download neutrino2211/akl-minicpm5-2b --local-dir akl-minicpm5-2b
cd akl-minicpm5-2b
python3.12 bootstrap.py --install
.venv-api/bin/python -m experimental.akl_api.server --port 8000
bootstrap.py verifies the release hashes, extracts the source bundle and installs three isolated runtimes. Start from the downloaded repository directory so the relative asset/checkpoint paths resolve. Base URL: http://127.0.0.1:8000/v1.
| Model ID | Receiver | Memory |
|---|---|---|
akl-minicpm5-2b | MiniCPM5-2B, 4-bit MLX | Gist plus retrieved exact evidence; attention gate 0.01 |
minicpm5-2b | Same frozen receiver | Exact native prompt |
akl-qwen35 | Qwen3.5-0.8B, FP32 text receiver | Gist plus retrieved exact evidence |
qwen3.5-0.8b | Same frozen Qwen | Exact native prompt |
The bundled original Qwen assets supply the frozen CPU sender vocabulary and the optional Qwen receiver. One GPU receiver family is loaded at a time. The API provides Chat Completions, legacy Completions, SSE streaming and function tools; it never executes tools itself. The harness executes returned validated tool calls. It does not implement /v1/responses.
pi and omp
Merge pi-models.json into ~/.pi/agent/models.json, preserving other providers. Merge omp-models.yml into ~/.omp/agent/models.yml. Select akl/akl-minicpm5-2b. Both use openai-completions and the localhost base URL.
For omp, use tools.intentTracing: false in ~/.omp/agent/config.yml, or launch with:
omp --config omp-settings.yml --model akl/akl-minicpm5-2b
Omp's optional intent tracing adds a required i argument that this small model can omit. Disabling it removes that harness metadata requirement while retaining tool-argument validation. Real omp read and bash (pwd) tool executions passed; general agentic task quality is not established. Tool instructions are prompted without constrained decoding, so malformed calls remain possible.
Architecture and limits
- Frozen width-64 codec, update 2800. Four 1024-bit codes per 64 original Qwen sender tokens: 16 source tokens per gist position.
- Frozen original MiniCPM projection with fixed 0.01 attention priority on gist keys when exact evidence is present. No retraining or weight modification during these context/API tests.
- Original source IDs retained in an addressable store. 32 learned proposals per 4K page; lightweight lexical candidate retrieval before a frozen neural reranker. One 64-sender-token evidence span, retokenized to at most 96 receiver tokens.
- Experimental archive cap: 262,144 sender tokens. API receiver budget: 32,768 positions, including gist, exact instructions/task/tool definitions/recent history/evidence and generation. Output default cap: 2,048 tokens. Native harness entries remain conservatively set to 16K.
- Stable gist-prefix KV cache, private per-query forks and incremental append. Instruction/tool/schema changes, rewritten history or receiver switches can rebuild it. Selection/index work and exact suffix prefill still occur. One in-memory archival state, no multi-session LRU or automatic rolling eviction.
- The first/latest user task stays exact; an oversized pinned task or tool schema can still exhaust the receiver budget. Harness token estimates and original sender-token counts can differ.
Measured results
All model components remain frozen. These are small, repetitive synthetic fixtures on an M1 Pro Mac with 16 GiB RAM, not general accuracy benchmarks.
| Test | Result |
|---|---|
| Fresh 4K paired test, gated retrieved evidence | 24/32 exact answers; versus 16/32 without attenuation |
| 32K / 64K factual retrieval | 3/8 and 5/8 exact; final neural ranking is the measured bottleneck |
| 128K / 256K capacity | Fits under a 4 GiB isolated MLX allocation cap; cached token replay matches |
| 256K receiver allocation | Approximately 2.99 GiB peak MLX; standing allocated KV approximately 672.8 MiB |
| 256K factual smoke | Retrieved 0/2, complete supports selected 0/2; oracle exact evidence 2/2 |
| Actual HTTP archive | 262,128 sender tokens → 16,380 gist positions; repeated current-task answer unchanged |
| Actual near-256K HTTP repeat | 2.09 s end to end; this is a short exact-current-task capacity/cache check |
| Cold HTTP at 245,739 sender tokens | 73.35 s including startup; prefix build 59.15 s |
| Omp tool integration | Both read and bash execute and final answer uses their returned results |
The 256K isolated run first builds 128K in 24.84 s and then extends by another 128K in 38.59 s. It does not measure a cold full 256K rebuild. Isolated cached questions take 0.83–1.11 s. The HTTP check has different prompt/selection/startup costs. These timings must not be mixed into a single benchmark or advertised as guaranteed agent latency.
CPU sender peak RSS in the isolated 256K preparation is approximately 1.95 GiB, measured separately from the receiver. A live service retains that sender concurrently. MLX allocation and receiver RSS overlap on unified memory; the 3 GiB receiver allocation figure is not whole-pipeline RAM. Packed 256K source IDs occupy 1 MiB, plus index, keys, gist states and Python objects. Retention depends on retrieval; these results do not show exact recovery from gist alone.
See CONTEXT_256K.md, MINICPM_LONG_REPORT.md, MINICPM_EVIDENCE_REPORT.md, VERIFICATION.md and evaluations/ for the measurements and practical limits. Improving the selector is the next supported direction; larger advertised capacity does not resolve its mistakes.
Contents and reproducibility
assets/minicpm5-2b-mlx/ contains the pinned official MiniCPM MLX weights and tokenizer. assets/qwen3.5-0.8b/ contains the pinned original Qwen weights/tokenizer used by the sender and optional Qwen receiver. runs/ contains only explicitly selected frozen checkpoints and the recommendation metadata. The browsable experimental/ tree and runtime.zip contain source, dependency locks, data/provenance needed by strict checkpoint checks, and research reports. release_manifest.json records hashes for every distributed file and source-bundle entry.
MiniCPM MLX revision: 8a9ad7539ac86281d0ac2b017ba04a5de53fe9a3. Qwen revision: 2fc06364715b967f1860aea9cf38778875588b17. Selected MiniCPM bridge SHA256: b1c6f06bd5de8345a506556e2f08c4dd793b052e4072b63bf35974cf71c3598b.
After setup:
.venv-api/bin/python -m unittest experimental.akl_api.test_protocol -v
.venv-api/bin/python -m experimental.akl_api.smoke
Public model assets and checkpoints are bundled; credentials, private conversation histories, local environments and raw service logs are excluded. The previous AKL Qwen GGUF release remains a separate artifact.
Licenses and attribution
Upstream MiniCPM and Qwen assets retain Apache-2.0; their model cards, pinned provenance and license texts are included. DABE reference code retains MIT; its paper and attribution retain CC BY 4.0. The small included TinyStories sample retains CDLA-Sharing-1.0, with its notice and provenance. Authored alignment passages retain CC0-1.0. This release does not relicense third-party material or assign a new license to the original AKL project code/checkpoints. See LICENSES.md and NOTICE for per-artifact terms and provenance.