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 virtual environment:

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade "ax-engine[download]>=6.12.1,<7"
ax-engine doctor

Requires macOS 26+, Apple Silicon (M2 Max or newer), Python 3.10+. 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

Native CLI and server (Homebrew, primary)

For end users running the TUI, CLI, server, or benchmark tools, Homebrew is the primary installation channel:

brew tap defai-digital/ax-engine
brew trust --formula \
  defai-digital/ax-engine/ax-engine \
  defai-digital/ax-engine/mlx \
  defai-digital/ax-engine/mlx-c
brew install defai-digital/ax-engine/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 6.12 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 OpenAI shim or image/audio helpers with the matching extra:

python3 -m pip install --upgrade "ax-engine[openai]>=6.12.1,<7"
python3 -m pip install --upgrade "ax-engine[multimodal]>=6.12.1,<7"

Requirements

  • macOS 26 (Tahoe) or later
  • Apple Silicon — M2 Max / M2 Ultra / M3 / M4 family (32 GB RAM minimum)
  • Python 3.10+

Project

github.com/defai-digital/ax-engine

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ax_engine-6.12.1-cp310-abi3-macosx_26_0_arm64.whl (71.6 MB view details)

Uploaded CPython 3.10+macOS 26.0+ ARM64

File details

Details for the file ax_engine-6.12.1-cp310-abi3-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for ax_engine-6.12.1-cp310-abi3-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 2330a06be6759bf71de86752e01690a6c0b0872935f7603922dcd097e05afab7
MD5 dcfbbf4a118c61ff3626932ced145706
BLAKE2b-256 3540634024a8b983ceacb1b7275f3eb68bdf69dbc4ee9b1148680d3e119e3b95

See more details on using hashes here.

Provenance

The following attestation bundles were made for ax_engine-6.12.1-cp310-abi3-macosx_26_0_arm64.whl:

Publisher: pypi.yml on defai-digital/ax-engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

7.3.1

1 file

7.3.0

1 file

7.2.1

1 file

7.2.0

1 file

7.1.5

1 file

7.1.4

1 file

7.1.3

1 file

7.1.2

1 file

7.1.1

1 file

7.1.0

1 file

7.0.2

1 file

7.0.1

1 file

7.0.0

1 file

6.16.1

1 file

6.15.0

1 file

6.14.0

1 file

6.13.5

1 file

6.13.4

1 file

6.13.3

1 file

6.13.2

1 file

6.13.1

1 file

6.13.0

1 file

This release

6.12.1 This release

1 file

6.12.0

1 file

6.11.1

1 file

6.11.0

1 file

6.10.0

1 file

6.9.1

1 file

6.9.0

1 file

6.8.2

1 file

6.8.1

1 file

6.8.0

1 file

6.7.1

1 file

6.7.0

1 file

6.6.0

1 file

6.5.2

1 file

6.5.1

1 file

6.5.0

1 file

6.4.6

1 file

6.4.5

1 file

6.4.4

1 file

6.4.3

1 file

6.3.4

1 file

6.3.3

1 file

6.3.2

1 file

6.3.1

1 file

6.3.0

1 file

6.2.7

1 file

6.2.6

1 file

6.2.5

1 file

6.2.4

1 file

6.2.3

1 file

6.2.2

1 file

6.2.1

1 file

6.2.0

1 file

6.1.3

1 file

6.1.2

1 file

6.1.1

1 file

6.1.0

1 file

6.0.1

1 file

5.3.3

1 file

5.3.2

1 file

5.3.1

1 file

5.3.0

1 file

5.2.4

1 file

5.2.3

1 file

5.2.2

1 file

5.2.1

1 file

5.2.0

1 file

5.1.13

1 file

5.1.12

1 file

5.1.10

1 file

5.1.9

2 files

5.1.8

2 files

5.1.7

1 file

5.1.6

1 file

5.1.5

1 file

5.1.4

1 file

5.1.3

1 file

5.1.2

1 file

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