Core AI model zoo

BitCPM-8B (1.58-bit ternary) — Core AI

🤗 mlboydaisuke/BitCPM-8B-CoreAI · Apache-2.0 · base openbmb/BitCPM-CANN-8B

The zoo’s first 1.58-bit ternary LLM and first sub-int8 packed-GEMM Metal kernel, running fully on-device on iPhone through Apple Core AI. BitCPM-CANN-8B is OpenBMB’s MiniCPM4-8B architecture quantization-aware trained to ternary — every transformer weight is just {-1, 0, +1}. The result: an 8B model at a 3–4B-class footprint and decode speed, with 8B-class quality (95.7–97.2% of full precision, OpenBMB).

On-device (iPhone 17 Pro, A19 Pro — CoreAIChat pipelined GPU engine, greedy)

bundle decode prefill resident load
gpu-pipelined/ (ship, AOT h18p) 17 tok/s 13 tok/s ~2.1 GB 9 s cold

Headroom ~4.3 GB, no jetsam. An int4 8B needs ~5–6 GB resident — the 2-bit ternary weight stream is the lever. 17 tok/s decode puts an 8B model in the zoo’s 3–4B speed class (Nanbeige-3B 15.9, FastContext-4B 20.4, Gemma-E4B 15.1).

Mac (M4 Max GPU, pipelined engine, greedy)

  decode numerics
fp16-activation ternary 62.7 tok/s engine token-identical to the torch ternary reference — 3/3 probe prompts, greedy

Conversion

Conversion scripts: ../conversion/export_bitcpm8b_decode_pipelined.py (+ conversion/bitcpm/ for the gguf reference, oracle gate, and engine gate).

Run

In the zoo’s CoreAIChat app (Model → “BitCPM-8B 1.58bit”), or via Foundation Models:

import FoundationModels
import CoreAILanguageModels
let model = try await CoreAILanguageModel(resourcesAt: bundleURL)
let session = LanguageModelSession(model: model)
print(try await session.respond(to: "The capital of France is"))   // -> "Paris."

Why ternary, now

MLX got fast on Apple Silicon in 2026 (M5 neural accelerators; MLX-Swift overtaking llama.cpp on decode). The durable edge for Core AI isn’t matching MLX on a Mac — it’s a kernel MLX doesn’t have (its quantization is 4/8-bit affine; there is no 2-bit ternary GEMM), on a device MLX doesn’t ship to. 1.58-bit on iPhone is both.