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.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 29.7 MB
Release files / aria_engine-1.6.3-cp313-cp313-win_amd64.whl
| Download URL | aria_engine-1.6.3-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
572c147d7e464f84ec47de3a7fb8c5eeaa97846f1e8c098f07a041b5c185b5d3
|
|
BLAKE2b-256 checksum How to use checksums |
c4e4741e6f355380452c1dcce7d0ad9e88f143595dd52ec7849df55db133a16e
|
| 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.6.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.6.3-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 |
6e85068a224eba019e4fc99e0918d7b52917b8c166e72c00c0ef59a6e6c89d14
|
|
BLAKE2b-256 checksum How to use checksums |
664574b2714f82d3142cb74265ef7cefc696d353c43089357cd3da68316abcff
|
| 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.6.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.6.3-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 |
4c8f633eee012cfcac9ab743b1ce99c1a539593cebdb930325a2110d69978d6b
|
|
BLAKE2b-256 checksum How to use checksums |
845e3913a208f1e184eef37b6ffd470a3460eb77dfbe69c4deff8532b9e538ad
|
| 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.6.3-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.6.3-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d1a3770dc425d44fece566c5e8c1f59aa172563685c0dabfd2e23ce2745241f5
|
|
BLAKE2b-256 checksum How to use checksums |
b503ee2e4ee76b9b91898764cceb1c46e7a157e49ce8700ad9d95140959d4c00
|
| 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.6.3-cp312-cp312-win_amd64.whl
| Download URL | aria_engine-1.6.3-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c848c6e60ca134a9872c4c02b6926b3affee33beb0e07e829477093978b4e277
|
|
BLAKE2b-256 checksum How to use checksums |
3881755a78f93442668ea33b68e3bff0c385122dce327fd4dfdab8cd1ad90867
|
| 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.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.6.3-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 |
53631d1e4230081491260e2ffa718e1c9700247583d34a2ece25a1576b8ad983
|
|
BLAKE2b-256 checksum How to use checksums |
b7281eb1d9c7844f9beddba25c7169acce62dc50208d95530228b2b33a7d1457
|
| 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.6.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.6.3-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 |
ce4a1939224235a6dc8f4bad5adb35463fe6488120ba684a0a7a55eed79dc6b3
|
|
BLAKE2b-256 checksum How to use checksums |
6564a372922572070dd99b772095bd4b97ff27bce0bc69e5f04155c00711eaaf
|
| 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.6.3-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.6.3-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
acc897562e2db0c478f78b53e270788de79d6846dfe7669150184df6e4bb67b1
|
|
BLAKE2b-256 checksum How to use checksums |
f235a8df06ef1fb0709acaa2c145e8ff774e2a0743229aaa00786576323916e0
|
| 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.6.3-cp311-cp311-win_amd64.whl
| Download URL | aria_engine-1.6.3-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
60ca9b0d4f83f8cbf1232b91f3ccbd58309b8cc023ebb6abb7a1e2a4e28fdcd7
|
|
BLAKE2b-256 checksum How to use checksums |
02edba2e31f08baea2058e1b7ca1856aefcfe8adcd69b4b2a8f6dc830396344e
|
| 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.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.6.3-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 |
64bbf8b2ad0adc326b57e7b00de653b0a1d26b702acf38d730003e0a38e233b2
|
|
BLAKE2b-256 checksum How to use checksums |
0925eda932e256022c64261f90603ceb3ccd3499886e4683949f603a50825e17
|
| 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.6.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.6.3-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 |
b9b1911614b5b33e8469487dc3e3896f429d49d7f90abc0425cc04d46d1a62c3
|
|
BLAKE2b-256 checksum How to use checksums |
473e547a6854827b6acc316d337adde74a99e75f017e3318fc9a4ce81643520d
|
| 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.6.3-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.6.3-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
60a19371a93925e650a6af6300276465ec2f2db3ad317b49d147f0f7f9055e85
|
|
BLAKE2b-256 checksum How to use checksums |
f8cfc97797170a4999da669d22b2593d0207c3ef6d5723b86f14a139d17e8fea
|
| 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.6.3-cp310-cp310-win_amd64.whl
| Download URL | aria_engine-1.6.3-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2d08b0ed2d8086a7e0916ccf1436d270c5805fd5dd57e7c65e6980621ce2a21b
|
|
BLAKE2b-256 checksum How to use checksums |
c0ca4fc79dc4b472f540b7ac71cb5878a30b0a90d993ea9d51159ad1cd9ba8e9
|
| 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.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.6.3-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 |
0c58577edfe6cda299bdc5e7b1189d6055dbe470720b4daa3ea4b64f6a582f13
|
|
BLAKE2b-256 checksum How to use checksums |
d3f8ac10cc50f26151ba1be00170eb9d81dd0281faf238e0396c8fa97279ee49
|
| 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.6.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.6.3-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 |
5d8b88a745a3577cd1bcd87813316734927a70d461161e7d80fb0d66a5710d3f
|
|
BLAKE2b-256 checksum How to use checksums |
3a9da5525c6b328e166e7896a8ebec37c731f1e0e67854173922ce365dc50175
|
| 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.6.3-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.6.3-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a9c6c8cb4c33416fd3a18a19be5c36158bb9ec278e9dbd902020cee2a18fb68c
|
|
BLAKE2b-256 checksum How to use checksums |
3fac2a8f0cb756cba5d9b6c0f49459f39a584442e4f88db427499032b2096549
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|