Tinkerbox for Apple Neural Engine
Run models on Apple's Neural Engine through Core AI. Critical inference always runs on the Neural Engine, the CPU does only supplementary work, and the GPU stays idle.
| Model | Task | Notes |
|---|---|---|
LiquidAI/d1-3B (d1-3b) |
Decisions over text and images | docs/models/d1.md |
vllm-sr/d3-nano (d3-nano), vllm-sr/d3-mini (d3-mini) |
Decisions over text and images, one question per pass | docs/models/d3.md |
k2-fsa/OmniVoice (omnivoice) |
Speech synthesis, voice cloning and voice design | Usage |
openbmb/VoxCPM2 (voxcpm2) |
Multilingual speech synthesis, voice design, cloning and continuation | Usage |
Requires Apple Silicon (M1–M6), macOS 27, and Python 3.12 or 3.13. Bundle availability varies by model and chip. VoxCPM2 has fully ANE-compiled bundles across M1–M6; OmniVoice and the decision models cover M4 and newer. Bundles for chips other than M5 Pro are cross-compiled; on-device correctness and performance have been checked on M5 Pro. The app shows unavailable models before downloading and accepts compatible local bundles.
Quickstart
Install the wheel from the GitHub release (Xcode is not required):
python -m pip install ./tinkerbox_ane-*.whl
import tinkerbox_ane
with tinkerbox_ane.load("d1-3b") as model:
result = model.system_one(
"I was charged twice this month.",
{"refund": {"type": "noul", "instructions": "Is this a refund request?"}},
)
print(result)
tinkerbox_ane.load(model_id) loads any model in the catalog and returns the API for its task. It downloads the Core AI bundle for this Mac to ~/Library/Caches/tinkerbox-ane/models/<model>/<revision>/; pass a directory as the second argument to select a local AOT-compiled bundle. Each bundle carries a checkpoint folder with everything the runtime reads from the upstream checkpoint: its code, tokenizer and configuration, and only the weights that run on the CPU, such as the token embeddings. Loading never downloads the upstream checkpoint, and imports only upstream code whose digest the package pins. Each model package also has its own load(), such as tinkerbox_ane.d1.load().
python -m tinkerbox_ane.storage reports, as JSON, each model's bundles, Core AI's compiled copies of their assets, and any upstream checkpoint in the Hugging Face cache, which exports and earlier versions download, then the compiled copies no downloaded bundle uses and the Python and packages the models share. --remove MODEL deletes all of a model's files; add --outdated to delete only bundle revisions the catalog no longer loads. --remove-unused deletes unused compiled copies, such as those of local exports, which compile again on their next load.
Decision models expose the System One API: system_one, system_one_batch, probabilities, and probabilities_batch for binary, choice, and score queries, plus count_tokens. Models with parallel decisions (question_trees in the catalog, such as d1-3B) answer several questions about one input in a shared pass; the others answer them one after another and warn when a call asks more than one. Inputs, limits, and execution details are in each model's notes.
OmniVoice and VoxCPM2 expose generate, reusable voice prompts, and on-device transcription. Python users need the speech dependency extra; compatible model bundles download automatically. The app includes a Text to Speech page with playback and WAV/M4A export. Saved voices belong to the model that created them.
The speech API advertises each model's native modes and controls. The UI uses those capabilities to display supported controls. OmniVoice supplies native numeric duration and speed controls; VoxCPM2 supplies descriptive delivery conditioning and distinct reference-cloning and continuation modes.
Tinkerbox app
A standalone desktop application is in app. To build and launch it from source:
uv run --no-project --python 3.12 python app/run.py
Pass --build-only to create artifacts/swiftui/Tinkerbox.app and the release ZIP without launching. The prebuilt app manages its own Python environment and dependencies via an embedded uv binary.
The Storage page, opened from the bottom of the sidebar, lists every file the models keep on this Mac and deletes a model with everything it downloaded.
Architecture & Staging
The Swift host manages persistent state and dynamically allocates attention cache buffers. Initial execution compiles and specializes the AOT asset for the local ANE hardware, after which Core AI reuses its persistent cache.
Weight staging uses an APFS copy-on-write workaround to eliminate redundant disk writes during specialization.
Adding a Model
Model-independent infrastructure is located at the package top level and is shared across models:
| Module | Role |
|---|---|
host.py, host.swift |
Native Core AI host: tiered caches, packed chains and trees, RoPE tables, and named vision inputs |
bundle.py |
Bundle manifest and asset identity verification, downloads, and AOT compilation |
coreai.py, guard.py, publish.py |
Compiler watchdog, ANE placement verification, and Hugging Face releases |
models.json, models.py |
Model catalog shared by tinkerbox_ane.load() and the app |
storage.py |
Disk usage of downloaded models, and their removal |
A model package (such as tinkerbox_ane.d1) provides:
- Neural Graph & Export: Fused FP16 graph (
model.py) and Core AI export (export.py). - Runtime: Tokenization, prompt formatting, readout (
runtime.py), and optional tree planning (tree.py) or vision processing (vision.py). - Package Interface: Exposes
load(asset=None), bundleKIND, and compile/publish CLI wrappers.
To register a model, add an entry to src/tinkerbox_ane/models.json specifying id, name, publisher, summary, task, repo, revision, and min_version. Add notes in docs/models/<id>.md.
Building from Source
Building requires Xcode 27 / Swift 6.4 and uv:
uv sync --locked
uv build
The wheel in dist/ bundles the native tinkerbox-ane-host executable and links against macOS system frameworks. Source and editable installs compile the host during installation. Compilation verifies source identity, function manifests, and full ANE placement.
The developer guide describes model export, compilation, publishing and validation. Reusable Core AI compilation and Hugging Face publishing utilities are provided in tinkerbox_ane.coreai and tinkerbox_ane.publish. To use a compiled bundle locally before publishing:
uv run python -m tinkerbox_ane.install <model> <bundle directory>
For package releases, see Releasing.
Tests
uv run python -m tinkerbox_ane.d1.guard artifacts/validation/smoke -- uv run pytest -q
Metadata
Release files for tinkerbox-ane 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tinkerbox_ane-2.2.0.tar.gz | 315.3 kB | With provenance | Details for tinkerbox_ane-2.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tinkerbox_ane-2.2.0-py3-none-macosx_26_0_arm64.whl | Python 3 | none | macOS 26.0+ ARM64 | Details for tinkerbox_ane-2.2.0-py3-none-macosx_26_0_arm64.whl |
Total release size: 665.3 kB
Release files / tinkerbox_ane-2.2.0.tar.gz
| Download URL | tinkerbox_ane-2.2.0.tar.gz |
|---|---|
| Size | 315.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c274b7417a40ee68f2059989cb337e1ab930a419928ad2771bae4933604c4da4
|
|
BLAKE2b-256 checksum How to use checksums |
7ff09569b0fa88c8ed0691b27ed21d99a0704be2c86ceb627674cd61a816adb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / tinkerbox_ane-2.2.0-py3-none-macosx_26_0_arm64.whl
| Download URL | tinkerbox_ane-2.2.0-py3-none-macosx_26_0_arm64.whl |
|---|---|
| Size | 350.0 kB |
| Tags | Python 3 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e0e6be73454a7b7a33a2ce61f2ce5bbfcbf4903ff83d6d760fcb99c65ca29947
|
|
BLAKE2b-256 checksum How to use checksums |
b17ad2804d2da844e0c0712831c6622209a0e3f44a307415ad0505b6f9328e96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logSecurity for tinkerbox-ane 2.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for tinkerbox_ane-2.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.