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}))
动态库查找顺序
_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.2.2
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.5 MB
Release files / aria_engine-1.2.2-cp313-cp313-win_amd64.whl
| Download URL | aria_engine-1.2.2-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8e418cc46f4c21bf727c29edcd9000a94b81638b1be83d22318ef1be9d8e0566
|
|
BLAKE2b-256 checksum How to use checksums |
e3c792b0110d0c27f3bf025a1640e3d72fa8f5bbcf63eb1230a2bba1639e6f5a
|
| 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.2.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.2.2-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 |
19e05eeba9e12e10158af0240ef31cf5118ba4c8f1027295f1ac78396a0bfca6
|
|
BLAKE2b-256 checksum How to use checksums |
814d9aab6362d4bbd4f74486d83dd0acf4ecfb5ad8bf846fbfd38bf8ecece677
|
| 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.2.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.2.2-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 |
c2bbdfcbb8c50b4911ca66fb1ec6b25874db7a5af4b38d01d0ffc5c620ee09c8
|
|
BLAKE2b-256 checksum How to use checksums |
a5fd0b9549b90d3bf8d1c7bb2977776046f76d4a5d583bbecf1e6e41beb528c6
|
| 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.2.2-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.2.2-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 |
bd25668978f31b67f2bd81f69a1cebcd24c3af25e8d48e5b6d5ff3660083e604
|
|
BLAKE2b-256 checksum How to use checksums |
95cfc66ad8511cb49b3456cc3d03210bd946583430ced04b81e94923a030add6
|
| 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.2.2-cp312-cp312-win_amd64.whl
| Download URL | aria_engine-1.2.2-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f4842926d9c721b38e82b44a5d843393775dc619fea833ce850049dc7f61c3d8
|
|
BLAKE2b-256 checksum How to use checksums |
3624a77bdecca0d411877d6141759f63e2ee5a06676e5338afc7f29872203a66
|
| 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.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.2.2-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 |
11da1aa894182a58ee7e0f22fabf03cde81783a8145a1778d0697edda6bf1307
|
|
BLAKE2b-256 checksum How to use checksums |
8edf2f701da813be129010cd1256231317cb0e4e125b477d7d0875d685038cfb
|
| 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.2.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.2.2-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 |
7f678da9aa10f26533936c338ce750bed2af0fe88ab2ceeb22a47e646eb0ab72
|
|
BLAKE2b-256 checksum How to use checksums |
0d7127aeb8ca798df01943ec4728514168f834ce7ea20cb800e3f8725cdc7e48
|
| 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.2.2-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.2.2-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 |
f44c98ebec8f3a27b8acf530d59907bac96dd9de81ae50bb11e88d85ea6f2a09
|
|
BLAKE2b-256 checksum How to use checksums |
4c4a81ffd3018207e887b8f066230d61993b9a467554d1eda36a322d1baaa490
|
| 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.2.2-cp311-cp311-win_amd64.whl
| Download URL | aria_engine-1.2.2-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
847ffb7bf5a6e42798bea548eff6dc43387d0f1da36ffb72491ac9bf834bd4c0
|
|
BLAKE2b-256 checksum How to use checksums |
4b859344a8325b0b831ff15c0d71e9f7c34ebbaa2cbf523274e4a6ed028e7072
|
| 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.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.2.2-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 |
f617e0705b633b4e82313da4c4cb06c37a8369e16b391d53246190608326c1ed
|
|
BLAKE2b-256 checksum How to use checksums |
f49454105af525ade2bd69c7a3ef52b8a4e197198fe4fd929a681ada579c71f0
|
| 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.2.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.2.2-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 |
18326ebc000d5a882e3eb3fd0b430651b68c386b43cdece89b0281b166f21e3a
|
|
BLAKE2b-256 checksum How to use checksums |
45f8c0632378025cbffe9b3e764a767f81bbddcbc134a44badefeb32ece9b44c
|
| 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.2.2-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.2.2-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 |
3178e99c3fc2db4fb928256b6d374833ab3f68229c1cf6bb90bfda1a27ab516c
|
|
BLAKE2b-256 checksum How to use checksums |
a1b833be6aa5512ed7b4967fe833808d988cefedb74dcdce9f96d2287439b4a2
|
| 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.2.2-cp310-cp310-win_amd64.whl
| Download URL | aria_engine-1.2.2-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f8e0bcf259f680d0ce5bf775989037e13f04661865501d266aa1e4a7a7dc421b
|
|
BLAKE2b-256 checksum How to use checksums |
6accd326b2d2e8c25ed0376e441f2942188739dddfb2a58cc6e6b62fd9583931
|
| 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.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.2.2-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 |
e656aff78b5cb4c8ded9dce051bbaadbd7cb410232656a8b54d7970336155bea
|
|
BLAKE2b-256 checksum How to use checksums |
f72bb58c328bb71659becc167a1e0a1dfbf53c6312781f288bee7f8e48d70f5f
|
| 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.2.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.2.2-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 |
ec75280cdca5e6b9a088d80be95daa1988310ae61825236fe235604d771d8680
|
|
BLAKE2b-256 checksum How to use checksums |
0e90b9ae450c18c95695938b7dcfb7843706a11a5e0a81c5ca87b61e6c61f84f
|
| 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.2.2-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.2.2-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 |
df1fac3f7df9cfdce219b76db5d0aad22845f602de9c888bc46c363d6a4334d3
|
|
BLAKE2b-256 checksum How to use checksums |
0dc44c0462ba1218fc718617fcbe3ea60131d09fce26bc6284e13de614c99241
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|