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="DASHBOARD_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.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: 29.7 MB
Release files / aria_engine-1.6.0-cp313-cp313-win_amd64.whl
| Download URL | aria_engine-1.6.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
375d953cc170acf7d50702c3a4a6c61dd6e062550c8f95f2fc97512f8619ef9a
|
|
BLAKE2b-256 checksum How to use checksums |
e555f55c463d0e7a3fcaaedb0da06ca332939b923136ade07ccc41ae10ef0a06
|
| 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.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.6.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 |
74397f03c72d31211aefdc80610d2c8ae28ad0b7835fde71caa96b93f607e418
|
|
BLAKE2b-256 checksum How to use checksums |
eb8f80645a21335450d8b12772c7ecf382c0f0033a509cee31de0bd45b3142ed
|
| 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.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.6.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 |
0d5b7499691252f80574813343e55a79ccbc2b6491a5d03e40f42d1b5eedd2ef
|
|
BLAKE2b-256 checksum How to use checksums |
b8925f6306912019352489d6f1482b5d9e2823908e488b45ae45c65ca6255c0d
|
| 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.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.6.0-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 |
ff5d43bd8652fe97dec6201ea6f13dbe950eae316f32977b4aa98801857721e7
|
|
BLAKE2b-256 checksum How to use checksums |
593ec5d0a6e5b98a07dd57d739d2e21b2639b4525d8bbc8268753c645ad971f1
|
| 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.0-cp312-cp312-win_amd64.whl
| Download URL | aria_engine-1.6.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
aae0d0d78b1a15147300b892eb65192557ba10373bbc400743b99f0c9478ebe1
|
|
BLAKE2b-256 checksum How to use checksums |
e45450c3dec30633d09db80e156631597dd3481755df0f1463ba91e92c86b909
|
| 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.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.6.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 |
6c4e3350f78add25f616a48f56ce082e0bf52e982ea391471cd3b7bfc454c3d7
|
|
BLAKE2b-256 checksum How to use checksums |
d801454e3f93e8f745d45bc088ee8696f95b1013888d3a29e6796f40e17ea10b
|
| 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.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.6.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 |
6e60d68c44abe83da9e9ec7383b164cc5b73e94b9b323a3543318382ce6579ba
|
|
BLAKE2b-256 checksum How to use checksums |
97e41c54f18de1d5a28c0ed52e9c4d6e6eed0186f2079ee838125506fca6754b
|
| 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.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.6.0-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 |
dee986f5bbd42a51d3bcbfa3db08bf94123321c7cf3e35383a11a1dc217b8f4c
|
|
BLAKE2b-256 checksum How to use checksums |
91184e26275123f0580328dd9ddf0dc75275387c2d53a0eb47705f2a5d257ef4
|
| 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.0-cp311-cp311-win_amd64.whl
| Download URL | aria_engine-1.6.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4e2989403c2a33aaa5add2472bbe79afe0a05ff28e18b2ce438c9caeda46286b
|
|
BLAKE2b-256 checksum How to use checksums |
02f18abf4940a0d3ba4ec79d61fa035947293510a89d7a3eee6912cb3cae1ff2
|
| 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.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.6.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 |
45476f4433e6ffe43504125e7c2576de78018a7b7b8bb4fca53e14653676091c
|
|
BLAKE2b-256 checksum How to use checksums |
63b2dabd1f12051f032da17c04d010a4cc9bbafb39c474bedaed7034b318dc49
|
| 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.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.6.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 |
0af68870a8019f67d34c5eae2fa7501ff698461885340edd9723fef20f86ea0f
|
|
BLAKE2b-256 checksum How to use checksums |
4fe5fd849b3c6414561a4763fe56934492e8e6060badef7ab9128719e90fcf23
|
| 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.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.6.0-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 |
5c920fa8086ee04be7891e3195ac3551f5378b2217fb1ba1bfcdf17b1fe6f325
|
|
BLAKE2b-256 checksum How to use checksums |
f29e3d851c4f1f55e88a1df72bacfdf170a999b853c5a9cdacac8d6f5fa78075
|
| 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.0-cp310-cp310-win_amd64.whl
| Download URL | aria_engine-1.6.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6ea348c3df0b6c349c5f44eb59002d5e03f5be0ca1ad5d2aff54abd04a804bae
|
|
BLAKE2b-256 checksum How to use checksums |
83c9593619609cc35a3cb082ce9e5c6c38b1dac907bc4081e48706af5d542d05
|
| 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.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.6.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 |
a846d6e42fd0f59c6f7d6d8358f0b64a6eace96c18bf55d6cc20a45222918059
|
|
BLAKE2b-256 checksum How to use checksums |
859bda62d9643b23ca9fedd1b8b21654dc798dded577b600f1e8f9345dedcd58
|
| 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.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.6.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 |
da35f1b775d4a5e7cb4eca5326456340e342d8b18160c14c2e19a76443a942f5
|
|
BLAKE2b-256 checksum How to use checksums |
28ad59142591cd46b482d1ed89b3a07b7058b72b1eb36dd60014c73a7bef6d84
|
| 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.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.6.0-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 |
e30fff6c0f66192703753f18f432f9fc52c7435aaf91ae9f76b9bf726699a6b5
|
|
BLAKE2b-256 checksum How to use checksums |
5deecaa7fc37e3be2a5adbb787bd1b0d3bf94715b8806871fa0cc21603ac9460
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|