aria-engine (Python)
aria-engine 是 Aria 推理引擎的 Python SDK(ctypes 封装 libaria_ffi)。
通过 PyPI 安装的 平台 wheel 内已捆绑动态库,开箱即用,无需手动设置环境变量。
安装(PyPI 发布版)
pip install aria-engine
支持 Linux (x86_64 / aarch64 manylinux)、macOS (x86_64 / arm64)、Windows (x86_64), Python 3.10+。wheel 内自带
libaria_ffi.so/.dylib/.dll。
用法
from aria_engine import Engine
with Engine("/path/to/bundle") as eng:
print(eng.complete([{"role":"user","content":"hi"}], {"max_tokens": 16}))
按模型名自动下载
Engine 同时接受本地 bundle 路径或 Aria 模型名(如 gemma-4-e2b-it_q4)。含 /
或本地已存在的值直接加载;否则由 SDK 从 Dashboard 私有源 自动下载(需 token,
site 默认 https://ariacompute.com)到 ~/.ariacompute/models/{model} 再加载。
缓存中已有有效 bundle 时直接复用,不重复下载。
with Engine("gemma-4-e2b-it_q4", token="API_TOKEN") as eng:
print(eng.complete([{"role":"user","content":"hi"}], {"max_tokens": 16}))
动态库查找顺序
_load_lib() 按以下顺序解析:
- 显式传入的
path - 环境变量
ARIA_FFI_LIB(源码安装 / 自定义路径时使用) - wheel 内捆绑的
aria_engine/lib/<libaria_ffi.so|dylib|dll> - 都找不到 →
RuntimeError(提示安装 wheel 或设置ARIA_FFI_LIB)
源码安装(开发)
export ARIA_FFI_LIB=/path/to/libaria_ffi.so
pip install -e .
构建 wheel(cibuildwheel)
bash scripts/build-python-ffi.sh # 编译 libaria_ffi 并拷入 aria_engine/lib/
pip install cibuildwheel
cibuildwheel --platform linux # 或 macos / windows
发布到 PyPI
GitHub Release 触发 .github/workflows/publish-pypi.yml:五平台构建 + twine upload。
需要仓库 Secret PYPI_TOKEN(PyPI API token,project-scoped,owner ariacompute)。
版本号取 tag 去 v(也支持 workflow_dispatch 手动输入)。
Metadata
Release files for aria-engine 1.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 30.0 MB
Release files / aria_engine-1.11.0-cp313-cp313-win_amd64.whl
| Download URL | aria_engine-1.11.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
12fba6af2f32380caee0671107308a325e1ce225f28bc1190c1612ab922993e9
|
|
BLAKE2b-256 checksum How to use checksums |
c23575753c0e43f1ff4e45c19ba5da5172b1c3b80838886c464b82c537fef3a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.11.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
8e1360ad738fd593cac5877662fc7ce0e2088282ffc59f316cd5f8f083b296a4
|
|
BLAKE2b-256 checksum How to use checksums |
3214d704280fab92efd5315e9060905f5a3fe6f96c01d280f5a007e0c8dc6815
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.11.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
a760230db2d54ca1f47b2cb63c84767ae354cdf4262d94f505ed0d6418c7d0a5
|
|
BLAKE2b-256 checksum How to use checksums |
98280f44d7fc890378c1dacc0fc4bfc33fe02d8c80f794f916bf4dbff6731001
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.11.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
adee55853eb379350b26b6278220c38f5448d66d6e728aeb08f0d923635e0c56
|
|
BLAKE2b-256 checksum How to use checksums |
a7ad85f19b002ad1365f31a5c42bbe9a10e0e178593e9b928e60302d332ac12b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp312-cp312-win_amd64.whl
| Download URL | aria_engine-1.11.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8381d6ebef61f8498f38f2982e7ddb89fa77552f866f984d39448c052dfcc1c5
|
|
BLAKE2b-256 checksum How to use checksums |
0498d39a5218dddddaec31f18866b396d9f5008129253ba6677470a5bae90511
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
9ba9642caf0db2bf645a792ee46c95bbf5e5b69edac54aa16df6c4c03f6bd2d2
|
|
BLAKE2b-256 checksum How to use checksums |
b87380456b222c60a7842934a9d73107fc0cc84eef0879dee30258bbfb24c35d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.11.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
eda467bf593bbfc2fd192348200b9400608dc83d7256f5b566cfcfddcafd6fda
|
|
BLAKE2b-256 checksum How to use checksums |
b1b0df2745b9ef72d32130bf21cd91e5f29f417d5c08abf3b1149904ce7de907
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.11.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
69ddc513e6ecbc987f161dc6807c799755a48a7766188e940f44424b0c915dc1
|
|
BLAKE2b-256 checksum How to use checksums |
c61254eae8e2a99a5b66eff35af13bfa9351c2edff0eb1ffc421dec31993975e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp311-cp311-win_amd64.whl
| Download URL | aria_engine-1.11.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
60e5be20cf18a11498c3455d97514eff5b6377117a040b4e56eb01599ebd781d
|
|
BLAKE2b-256 checksum How to use checksums |
49a35b46a83ab7afeeed843a30771a1d1855faee1e523000551866cf87c37276
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
ab539b4cd869161603bdee17708bc7ed1b64e3ea1d6f788bebac910f6bf8861d
|
|
BLAKE2b-256 checksum How to use checksums |
c5be547afafcd62a1d020adef12c6be1a1681db375a80e69bae973579b43908c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.11.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
41bb5b3ccb379078deafcf531df8730d3d44e0f4d135556ebd33de4dd22c4929
|
|
BLAKE2b-256 checksum How to use checksums |
c68c263f0c5df917f9446926c1f63276b0ab70d648952718ff465309bff0a0c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.11.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7a0e6b329f049aa678136f4718a53650611915df7571272497586afa7b8b659b
|
|
BLAKE2b-256 checksum How to use checksums |
3af68b36cc7fb97e6361cdcd4a746c94a394efd23abfea5a20b6ba537a29d343
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp310-cp310-win_amd64.whl
| Download URL | aria_engine-1.11.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
48130f607056ad29ee1d21e8fc6f1dba4c738f4afd7fbbc2f648a1151c2fb4d8
|
|
BLAKE2b-256 checksum How to use checksums |
90d7a055d3f3094aef3530cb4cf8f5a8c98d5e670143fcda857b294db929c645
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
11199c7c48523a638afe59f1e5af8441ea4d0d260dc445a1ff1dc6671ad1599a
|
|
BLAKE2b-256 checksum How to use checksums |
07656548c4138d806ff56baf071802fa1de32443870f58e79fd79472c14f1836
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.11.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
f1b718dae4891d2a467c21d88e605d281bb447e198224e93f219d2551d01d948
|
|
BLAKE2b-256 checksum How to use checksums |
c3a648e4d5f87a37e940330b7b00f4e314f46a3be2f20ec2fb2c605ecc5c4fab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aria_engine-1.11.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.11.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5ad4541c18b66dc0e59ca9123e1161515cbb594527c1b16e437e55826830bf4c
|
|
BLAKE2b-256 checksum How to use checksums |
612c5cea6a6b4e13ed59092f4b96699b640816cafa92cbeed09b6d20c9463ee9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|