Skip to main content

AX Engine

High-performance local inference engine for Apple Silicon — Python bindings.

Installation

Python SDK (pip)

Use pip when your application imports ax_engine or needs AX Engine's optional Python integrations. Install the wheel in a dedicated Python 3.12+ environment. Without uv or Homebrew, install Python 3.13 using the macOS installer from python.org, reopen Terminal, and create the environment explicitly with python3.13. The wheel requires Python 3.12 or later:

python3.13 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install --upgrade "ax-engine>=8.1.0,<9"
ax-engine doctor

If you already use uv, it can create the environment with an explicit Python version instead:

uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install --upgrade "ax-engine>=8.1.0,<9"
python -c 'import importlib.metadata; print(importlib.metadata.version("ax-engine"))'
which -a ax-engine
ax-engine doctor

An existing virtual environment keeps its original Python version; upgrading pip does not upgrade Python. If installation fails under Python 3.9, follow Python installation troubleshooting to create a separate environment with a supported Python version. Keep one installation channel active per shell when Homebrew is installed too.

Requires macOS 26.2 or later, Apple Silicon (M5 or later recommended, M3–M4 supported, M2 best-effort), and Python 3.12+. 16 GB is enough for compact single models; 32 GB+ for multi-model / larger packs. The current macOS arm64 wheel also includes the ax-engine orchestration CLI plus bundled ax-engine-server and ax-engine-bench binaries when you need a wheel-only install.

Verify the installed command surface:

ax-engine doctor
ax-engine-server --help

macOS app and native CLI

Use the macOS app for model downloads, chat, and local server controls. For native CLI, server, or benchmark tools, install the Homebrew formula:

brew install defai-digital/tap/ax-engine
ax-engine doctor

If both channels are installed, an active virtual environment normally shadows Homebrew's commands. Use which -a ax-engine to identify every copy and avoid mixing versions in one shell. See the Getting Started installation guide for requirements, linkage details, and troubleshooting.

Quick start

import ax_engine

session = ax_engine.Session(mlx=True, mlx_model_artifacts_dir="/path/to/model")
result = session.generate([token_id, ...], max_output_tokens=128)
print(result.output_tokens)

Native Unlimited-OCR image requests

AX Engine exposes native Unlimited-OCR global and high-resolution tile paths without model repository code. Tokenize a prompt containing exactly one literal <image>, then let the helper expand and attach one local path or Pillow image:

from tokenizers import Tokenizer
import ax_engine

model_dir = "/path/to/ax-unlimited-ocr"
tokenizer = Tokenizer.from_file(f"{model_dir}/tokenizer.json")
input_tokens = tokenizer.encode(
    "<image>Convert the document to markdown.",
    add_special_tokens=False,
).ids
request = ax_engine.prepare_unlimited_ocr_image_request(
    model_dir,
    [0, *input_tokens],
    ["page.png"],
)

with ax_engine.Session(
    model_id="unlimited_ocr",
    mlx=True,
    mlx_model_artifacts_dir=model_dir,
) as session:
    result = session.generate(
        request.input_tokens,
        multimodal_inputs=request.multimodal_inputs,
        max_output_tokens=8192,
        no_repeat_ngram_size=35,
        ngram_window=128,
    )

text = tokenizer.decode(result.output_tokens, skip_special_tokens=False)

The public path accepts exactly one bounded RGB source image. By default it selects the released processor's bounded 640px tile grid (up to 32 tiles) in addition to the 1024px global view; pass cropping=False only for an explicit global-only tradeoff. Resize, tiling, letterboxing, normalization, dual-vision projection, and BF16 conversion run in the native MLX implementation.

Or use the OpenAI-compatible shim:

python -m ax_engine.openai_server \
    --model-id my-model \
    --mlx-model-artifacts-dir /path/to/model \
    --tokenizer /path/to/tokenizer.json \
    --port 31418

Then point any OpenAI client at http://127.0.0.1:31418.

Optional dependencies

Install the Python model downloader, OpenAI shim, or Pillow image helpers with the matching extra:

python -m pip install --upgrade "ax-engine[download]>=8.1.0,<9"
python -m pip install --upgrade "ax-engine[openai]>=8.1.0,<9"
python -m pip install --upgrade "ax-engine[multimodal]>=8.1.0,<9"

Requirements

  • macOS 26.2 or later
  • Apple Silicon — M5 or later recommended; M3–M4 supported; M2 best-effort (16 GB light / single compact model; 32 GB+ full stack)
  • Python 3.12+

Project

github.com/defai-digital/ax-engine

Metadata

Release files for ax-engine 8.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for ax-engine 8.2.0
File Interpreter ABI Platform Actions
ax_engine-8.2.0-cp312-abi3-macosx_26_0_arm64.whl CPython 3.12 abi3 macOS 26.0+ ARM64 Details for ax_engine-8.2.0-cp312-abi3-macosx_26_0_arm64.whl

Release files / ax_engine-8.2.0-cp312-abi3-macosx_26_0_arm64.whl

Download URL ax_engine-8.2.0-cp312-abi3-macosx_26_0_arm64.whl
Size 99.7 MB
Tags CPython 3.12 abi3 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
5c0342ff08d96324a4f751d10cc92af5820a5b52d3b6a31b8590ad65f933e48b
BLAKE2b-256 checksum
How to use checksums
e9e651c6be26539c7ac3606f2d2cad9dbfde10b7772f51d498d5460b873cad2a
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 Nov 30, 2026.

Transparency log

Security for ax-engine 8.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

1 file in this release has been uploaded with provenance metadata.

Attestation for ax_engine-8.2.0-cp312-abi3-macosx_26_0_arm64.whl

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 Nov 30, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

8.2.0 This release

1 release file Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page