PrismML’s Bonsai 2.5 brings better coding and tool use to on-device AI
PrismML’s Bonsai 2.5 27B is a ternary‑quantized large language model that fits within a 4 GB memory envelope on Apple silicon. The weight tensors are stored in a 1.58‑bit ternary format with per‑channel scaling factors, allowing the model to be streamed directly from the unified memory pool into the Apple Neural Engine (ANE) without intermediate de‑quantization. PrismML’s custom inference runtime fuses the attention kernels with Metal Performance Shaders (MPS) graph operations, eliminating the traditional CPU‑GPU round‑trip for key‑value cache updates. The runtime also implements a dynamic KV‑cache compression scheme that discards low‑entropy heads after each decoding step, reducing the on‑device footprint to roughly 3.9 GB while preserving full‑precision logits for the final softmax.
The 2.5 release targets two concrete engineering gaps identified in the September ternary build: coding‑task accuracy and tool‑use latency. Benchmarks on HumanEval‑Plus show a 4.2 % absolute pass‑rate increase, attributed to a revised instruction‑tuning curriculum that injects synthetic function‑call traces during pre‑training. The function‑calling layer now exposes a native Swift async API that maps directly onto iOS Shortcuts intents, enabling zero‑copy hand‑off between the model and system services such as Calendar, HealthKit, or HomeKit. Latency measurements on an iPhone 15 Pro (A17 Pro) report a median 68 ms per tool invocation versus 120 ms in the prior binary‑quantized version, a result of pipeline‑fused ANE kernels that keep the model weights resident in the neural engine’s SRAM throughout the call chain.
| Subsystem / Parameter | Baseline / Previous | Updated Implementation |
|---|---|---|
| Quantization Scheme | 1‑bit binary weights with static scaling | Ternary (1.58‑bit) weights with per‑channel dynamic scaling |
| On‑device Memory Footprint | ~4.2 GB (including full KV cache) | ~3.9 GB (compressed KV cache + weight packing) |
| Function‑Calling Latency (ANE) | 120 ms per call | 68 ms per call (pipeline‑fused kernels) |
Actionable Diagnostic & Implementation Steps
- Verify device eligibility (iPhone 15 Pro/Pro Max or later, iOS 18.2+) and install the PrismML runtime via the official TestFlight build.
- Add the Bonsai 2.5 model bundle to your Xcode project using the provided Swift Package Manager manifest; ensure the
PrismMLInferencetarget links against the ANE‑acceleratedlibprismml_ane.dylib. - Register custom tool schemas in the iOS Shortcuts app, then invoke the model through
PrismMLInference.shared.generate(prompt:tools:)to exercise the fused function‑calling path.
Ecosystem Compatibility & Support Notice
- iPhone 15 Pro / Pro Max (A17 Pro) or newer running iOS 18.2 or later.
- Minimum 6 GB RAM (8 GB recommended for concurrent background workloads).
- Xcode 16.2+ with Swift 6.0 toolchain for development and App Store submission.
- Apple Neural Engine firmware version 12.4 or newer (delivered via iOS system updates).
Source and technical reference: 9to5Mac.
Share your OS version, device model, and exact error code in our independent peer Q&A rooms.
Comments