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.4.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.5 MB
Release files / aria_engine-1.4.0-cp313-cp313-win_amd64.whl
| Download URL | aria_engine-1.4.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ad87b3c1e86424012c2e6c986156c32217c9c2e00d7c6c84d0c13834790908bd
|
|
BLAKE2b-256 checksum How to use checksums |
1be4f89002f29090f12349feb1519f5f9fbc675cb620efa4fd11be3556d151bc
|
| 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.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.4.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 |
36896cf0d358be8451210b04e6de4c594b36a4567d95dc04e776554982bfcf53
|
|
BLAKE2b-256 checksum How to use checksums |
14db9ae324ede19b6256cce7feafe1961e5029b251f8e317af93765455951ff6
|
| 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.4.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.4.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 |
db1c70fa58ad68e31e49af7cecd03d9af15df3e1f4efdeec5206680e1b46c7cc
|
|
BLAKE2b-256 checksum How to use checksums |
fb04bdb0c22c31869e18481fe17c0d787e2440051ef84e5334a633281fc150af
|
| 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.4.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.4.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 |
34908fdf09358004e6fb8cf413dfca965a70abc371dd6eb692cc021e4d81323d
|
|
BLAKE2b-256 checksum How to use checksums |
ebe8037a0ff939ed71445d52d0e6053825dd94611c6116b0cffc96b1ba64e6bc
|
| 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.4.0-cp312-cp312-win_amd64.whl
| Download URL | aria_engine-1.4.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6cd2e831cbbebbada998743208356aa6082921fa7e0ce44f7a9d1ad9a1309a47
|
|
BLAKE2b-256 checksum How to use checksums |
e09f66107d810527ab7cc7a879d987c213407ffa90c64d6deaf13f86124e5e48
|
| 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.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.4.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 |
27860ee35bc5ea5672ac2841a5ee897db1a8915f9e82a9621ea15ef027e662d2
|
|
BLAKE2b-256 checksum How to use checksums |
c07a015aadbf2ce816e8c5d10554a1f4b5a2efd3bb55a6ebabb7f51accaffd25
|
| 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.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.4.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 |
aeb6ac90d7301c2547ca147fe0568aba1a0ed6d77ec70981a04d59f4e546392b
|
|
BLAKE2b-256 checksum How to use checksums |
aeb102c34a8df103c0fa384b5bfc98fa46255620f02e6fe53975e8a21377fb2f
|
| 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.4.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.4.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 |
3675312545aa94f8825b09d1fb23d4ce2e8034e8376ddd4fbc9bc5ac19828fa9
|
|
BLAKE2b-256 checksum How to use checksums |
9a5831961b3efe8b4cb67c92eea74abdd9604c5570d408b62723cdeea0cb4a70
|
| 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.4.0-cp311-cp311-win_amd64.whl
| Download URL | aria_engine-1.4.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
958fea0faa7c51c121249d577f6833995169bbc9027e3a18042911fd6ee04256
|
|
BLAKE2b-256 checksum How to use checksums |
faba8f419829e66ed5f59556bed2142ff1104a933dc4dabacb7e60d22f92db1b
|
| 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.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.4.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 |
b476718faaefb0394392467b9d313966c210f19336e0a1faac4c79b2447b2095
|
|
BLAKE2b-256 checksum How to use checksums |
1161575dae617537df6ce6e2afed1d5dd75762b603bf8cb6da695251a5a422cd
|
| 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.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.4.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 |
6fcb0355004a8a7e49f099094765fade5797876d80bf96cbeea2e49430175188
|
|
BLAKE2b-256 checksum How to use checksums |
e734d7b57e71c8dcff9b9e60010d4c801cc13caf4c16a8a8902cc25a58873dfc
|
| 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.4.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.4.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 |
7687bb13591248e1a1650222c7bad0cd4675dc39c07e1f0410698bdd37e7a5fd
|
|
BLAKE2b-256 checksum How to use checksums |
4a94324ff9286d325fc742aeced9ec82590e23cfc04634991dc64053e2bb37b1
|
| 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.4.0-cp310-cp310-win_amd64.whl
| Download URL | aria_engine-1.4.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0874d1307f526dab3995db19c32a7ce49d772fbfcd6bc437ba45117da803cfde
|
|
BLAKE2b-256 checksum How to use checksums |
4fda12c803d1fcd72518f9bf9be8cc562f5041313000c53e63ea94d561053253
|
| 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.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aria_engine-1.4.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 |
0eae0b18d9825f52455130b9511262f6c80c9b197e2602b614deca6551d6ba10
|
|
BLAKE2b-256 checksum How to use checksums |
95d491d4e1829bc806119b647dfe41fa87bd3177ae72ea563147adfadd7d9e18
|
| 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.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | aria_engine-1.4.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 |
028900b3c52dd9769391b9b97a2ba19bc87a180421639fbd2ee6f3a247334fe4
|
|
BLAKE2b-256 checksum How to use checksums |
012e870d826835666939c2ebb478060e4787c348178fb4a3df505c821ead9f0a
|
| 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.4.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | aria_engine-1.4.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 |
ba41c6ba8b80a2989421930771fe62ad25f402f88eb15580940038531f9db3e8
|
|
BLAKE2b-256 checksum How to use checksums |
255bc598bea3ecbd0c1d24f0bdc2cb18655cdd576514c8cb4f3da55290731a18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|