Skip to main content

aion-engine

Python bindings for Aion — a graph-IR tensor runtime with a Zig core, CPU and GPU. The distribution is aion-engine; the import name is aion.

Install

pip install aion-engine          # CPU
pip install aion-engine[gpu]     # + the GPU (wgpu) runtime

Prebuilt wheels for CPython 3.12/3.13 on Windows x64, Linux x86_64/aarch64 and macOS arm64/x86_64 — no Zig or C toolchain needed. The Aion runtime is static-linked into the extension module, so there is no separate aion.dll/libaion.so to ship or locate.

The GPU backend is compiled into those same wheels but links no wgpu — it dlopens wgpu-native at runtime. [gpu] adds the companion aion-wgpu wheel, which ships that library for every platform the runtime wheels target. Without it, GPU calls raise aion.AionError and CPU is unaffected.

NumPy is optional ([numpy] extra); without it use tensor.tolist() / tensor.item().

Run a model

A .aion file carries graph, weights and metadata, so this is the whole setup:

import aion, numpy as np

model = aion.load_model("model.aion")              # device="gpu" to run on GPU
out = model.run_numpy({"x": np.zeros((1, 4), "f4")})["y"]

In hot loops, bind tensors once (model.bind_input(name, t) + model.run()) instead of creating temporaries per step. KV caches and streaming state are managed by the runtime from the model's input roles — you don't thread them through Python (load_model(..., cache_capacity=, growable=) tunes it).

Build a model

Two handles, and they don't mix. aion.Tensor is data: what you write inputs into, read outputs from, and hand a layer as a weight. aion.TensorRef is a value in a graph: what ops and aion.nn layers take and return.

import aion, numpy as np
from aion import nn

ctx = aion.Context()
w = aion.tensor(np.random.randn(4, 3).astype("f4"))   # data

with aion.Builder(ctx) as b:
    x = b.input((1, 4)).rename("x")                   # TensorRef
    y = nn.Linear(w)(x).relu().rename("y")
    model = b.compile([y])

out = model.run_numpy({"x": np.ones((1, 4), "f4")})["y"]

For a reusable module, aion.compile(MyModule(), aion.spec((None, 4))) traces forward once (None = dynamic axis) and aion.export(..., "mlp.aion") writes the package. compile works on a copy of the graph, so authoring survives it: you can compile twice, and print(y) / y.numpy() evaluates just that value's cone while you keep building.

dtype takes Aion constants (aion.float32, float16, int8, int32, q8_0, q4_0) or NumPy dtypes — not strings.

GPU

ctx = aion.Context.gpu()                                  # first discrete adapter
model = aion.LoadedModel.load(ctx, "model.aion", device="gpu")

Keep feeding CPU input tensors: the model migrates them on run() and flushes outputs back for reading. A standalone tensor.to("gpu") is a move — the host copy is freed, so to("cpu") before reading it. device="gpu:1" (or adapter_index=) picks a physical adapter, power="low"/"high" picks integrated/discrete, and Context(gpus=[...]) registers several.

Examples

Runnable scripts in bindings/python/examples/, all taking --device {cpu,gpu,auto}:

silero_vad_simple.py chunked VAD, reports throughput
harrier_embed.py text embeddings, ranks documents against a query
nemotron_asr_streaming.py, nemotron_asr_mic.py streaming ASR from a wav or the mic
gemma4_e2b_generate_one.py LLM token generation

Models are produced by the converters in scripts/.

Developing from a checkout

uv sync        # environment + native build (dev group: numpy, torch, pytest, aion-wgpu)
uv run pytest

uv run rebuilds and relinks the extension when the Zig core changes — the uv cache key covers src/**/*.zig, the public headers and the build files. uv sync --reinstall-package aion-engine forces a rebuild.

Build knobs: AION_PY_OPTIMIZE (default ReleaseFast), AION_PY_CPU (native), AION_PY_TARGET, AION_PY_GPU (overrides [tool.aion] gpu in pyproject.toml). Building from source needs Zig on PATH plus a C toolchain.

Notes: prefer with for deterministic cleanup (Context.close() closes live tensors/models first); AION_DEFAULT_THREAD_COUNT sets the default context's thread count, and aion.reset_default_context() re-reads it.

Metadata

Release files for aion-engine 0.0.3

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

Built distributions (wheels)

Table of built distributions (wheels) for aion-engine 0.0.3
File Actions
aion_engine-0.0.3-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for aion_engine-0.0.3-cp313-cp313-win_amd64.whl
aion_engine-0.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for aion_engine-0.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
aion_engine-0.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ ARM64 Details for aion_engine-0.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
aion_engine-0.0.3-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for aion_engine-0.0.3-cp313-cp313-macosx_11_0_arm64.whl
aion_engine-0.0.3-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for aion_engine-0.0.3-cp312-cp312-win_amd64.whl
aion_engine-0.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for aion_engine-0.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
aion_engine-0.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details for aion_engine-0.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
aion_engine-0.0.3-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for aion_engine-0.0.3-cp312-cp312-macosx_11_0_arm64.whl

Total release size: 28.0 MB

Release files / aion_engine-0.0.3-cp313-cp313-win_amd64.whl

Download URL aion_engine-0.0.3-cp313-cp313-win_amd64.whl
Size 1.7 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
7a2f1ec74ca88f44ebf3308ec2dbb483c31fa898704d399b65f582a3f7e73a9f
BLAKE2b-256 checksum
How to use checksums
f8361c8a1d5d9e7cb600d25d337d2c81f5b16291e0425125d2624ab0f726bf24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

Release files / aion_engine-0.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL aion_engine-0.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 6.5 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
bd84db5a00c7f769c0e6b6708aa02e0e502d42becb0c8cb05e6ce9d291b91d0b
BLAKE2b-256 checksum
How to use checksums
2d21f107088ce22b2006b63583cc3b3ac3232559c2de7de483a17fe7ab18ea2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

Release files / aion_engine-0.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL aion_engine-0.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 4.3 MB
Tags CPython 3.13 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
3f6f4a7caaac39a74a08f90a022f4a4b24f9407bbd9deabf6702e6e6170b3a0f
BLAKE2b-256 checksum
How to use checksums
ca03d5f1e90576832d34cd16522fc1f8177fd6b83dcd6f1a70456fa9439122ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

Release files / aion_engine-0.0.3-cp313-cp313-macosx_11_0_arm64.whl

Download URL aion_engine-0.0.3-cp313-cp313-macosx_11_0_arm64.whl
Size 1.5 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f625120690085ce5bb0fcabfe15c656f4e4c81ecfdddc0e65987c5dcbb3fb63f
BLAKE2b-256 checksum
How to use checksums
e6566b3729f327e78b8334fa38fb1f15469e6b4b05017cc8ddedc37be6985332
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

Release files / aion_engine-0.0.3-cp312-cp312-win_amd64.whl

Download URL aion_engine-0.0.3-cp312-cp312-win_amd64.whl
Size 1.7 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
495aa1f1b5b8857851910228d389b1439cb5c3df1e0b963bbc3d8db88716cad1
BLAKE2b-256 checksum
How to use checksums
701663582a0a2faa5f2442b06910e97c83b0767878c3bd35bb78fc1bab194b28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

Release files / aion_engine-0.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL aion_engine-0.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 6.5 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
de0cb000dcc701d769d91110e7d8b06e3f8ec629cf6f1b5e39bffa355222b8c4
BLAKE2b-256 checksum
How to use checksums
ee37654ec07e2f88d30eaff570cb185ecf70aa1f0b3a46b330e0dff55fd6aa3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

Release files / aion_engine-0.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL aion_engine-0.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 4.3 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
e58b9eca424fac1d32061247fa77f6801ae8ccb09500c885fcb41220f4f73dc7
BLAKE2b-256 checksum
How to use checksums
799358cc21dffec51499a0e16b1c9bf3571a06488f6205e4a2595e7e21362cfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

Release files / aion_engine-0.0.3-cp312-cp312-macosx_11_0_arm64.whl

Download URL aion_engine-0.0.3-cp312-cp312-macosx_11_0_arm64.whl
Size 1.5 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3b2895180085c28edb758851463861017d825fc8e345590fa0d69182c88adc96
BLAKE2b-256 checksum
How to use checksums
f32a1551b24c3f306ec0a8c7cb84ccd1016694b5519cb036fd414914bd4fe68f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

Security for aion-engine 0.0.3

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

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for aion_engine-0.0.3-cp313-cp313-win_amd64.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 Sep 19, 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.

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