amv-runtime
GPU acceleration for on-device AI on Android phones. amv-runtime detects the SoC and GPU driver of a Termux / ARM64
device, installs the matching native engines (llama.cpp, whisper.cpp, Sherpa-NCNN, stable-diffusion.cpp, BitNet) in
isolated bundles, and runs them on the GPU through the AMEVA compute backend (ggml-ameva on ac_runtime, Vulkan or
OpenCL). When an operation or a device is not supported it stops with an explicit error; it does not fall back to the
CPU without saying so.
Renamed. Up to 2.8.1 this package was published as
ameva-runtime(PyPI) and@ameva/runtime(npm). From 2.9.0 the name isamv-runtimeon PyPI, npm and GitHub, in line with the otheramv-*packages. The import package (ameva_runtime) and the commands (ameva,ameva-run,ameva-gpu) are unchanged. See Upgrading fromameva-runtime.
What it does
| Modality | Engine in the bundle | GPU route |
|---|---|---|
| LLM | llama.cpp (llama-cli, llama-completion, llama-server) |
ggml-ameva backend, device AMEVA0 |
| Speech to text | whisper.cpp (whisper-cli) |
Vulkan; ggml-ameva with repacked weights |
| Text to speech | Sherpa-NCNN (sherpa-ncnn-offline-tts) |
Vulkan |
| Image generation | stable-diffusion.cpp (sd-cli) |
Vulkan |
| BitNet 1.58-bit | termux-bitnet-cli |
ARM NEON dot product on the CPU; Vulkan compute path |
| Vision (VLM) | llama.cpp multimodal | as LLM |
- One GPU API per device. The same kernels run on Vulkan or OpenCL. With
AMEVA_BACKENDunset (orauto), Mali-G68 (Galaxy A35, A53) runs OpenCL and every other GPU runs Vulkan; the choice is printed.AMEVA_BACKEND=vulkan|openclforces one. - Default route per device. GPU on Galaxy S25, S20 and A35; CPU on S21 and A53, where the GPU did not beat the CPU
in token generation.
-b cpu|vulkan|opencloverrides the choice. - Isolated bundles. Each engine lives under
~/.local/share/ameva/releases/<modality>/<release>/.$PREFIX/binholds links only; nothing is copied into$PREFIX/lib. Archives are checked against SHA-256 pins in the installed package. - Resident runtime.
ameva-run servekeeps a model loaded between requests;ameva-run exechas a memory guard that refuses a run which would take available memory below a floor.
Install
pip install amv-runtime # Python 3.8+, Termux / ARM64 Linux
# or
npm install amv-runtime # Node.js bindings and the same CLI
Download the engine bundles (one modality at a time, or all):
ameva-run install --modality llamacpp # also: stt, tts, diffusion, bitnet, all
ameva-run doctor # 12-stage hardware diagnostic
Bundles come from the public release repository
uno-km/amv-runtime-releases; no token is needed.
Use
ameva-run profile # SoC, GPU, driver, memory
ameva-run plan -m qwen2.5-0.5b-instruct-q4_k_m.gguf # dry run: which route would be chosen
ameva-run exec -m qwen2.5-0.5b-instruct-q4_k_m.gguf -p "Explain Vulkan in one sentence." -n 64
ameva-run exec -b opencl -m <model.gguf> -p "..." # force a GPU API
ameva-run serve --llm <model.gguf> --detach # keep the model loaded
ameva-run call llm -p "Hello" -n 32 # request to the resident worker
ameva-run resident status
import ameva_runtime as ameva
from ameva_runtime import vulkan
profile = ameva.detect_hardware()
print(profile.soc_name, profile.gpu_vendor)
report = vulkan.Doctor().run_self_test()
print(report.device_name, report.passed_stages, "/", report.total_stages)
const { Doctor } = require('amv-runtime');
const report = await new Doctor().runSelfTest();
console.log(report.deviceName);
Measured performance (release 2.9.0)
Qwen2.5-0.5B-Instruct Q4_K_M, median tokens per second of five rotated rounds in one session, prompt of about 370 tokens, 64 tokens generated. The Galaxy A35 and A53 were measured over ssh on cores 0-2.
| Device (GPU) | Phase | 2.8.1 Vulkan | 2.9.0 Vulkan | 2.9.0 OpenCL | CPU (same cores) |
|---|---|---|---|---|---|
| Galaxy A35 (Mali-G68 r38), final build | prompt | 189.2 | 176.1 | 182.0 | 14.5 |
| Galaxy A35 (Mali-G68 r38), final build | generation | 14.6 | 14.8 | 18.0 | 5.6 |
| Galaxy A53 (Mali-G68 r32), first candidate | prompt | 66.9 | 73.9 | 75.5 | 14.6 |
| Galaxy A53 (Mali-G68 r32), first candidate | generation | 10.8 | 11.0 | 14.4 | 4.6 |
| Galaxy S20 (Adreno 650), first candidate | prompt | 240.9 | 236.4 | n/a | 86.2 |
| Galaxy S20 (Adreno 650), first candidate | generation | 24.3 | 23.0 | n/a | 28.6 |
The A53 and S20 rows are from the first 2.9.0 candidate build; the Galaxy A53 was not reachable for the final build, so the final build is not verified there. The A35 and A53 CPU figures come from three little cores and are not a reference for the phones' full CPU. On the S20, generation on the CPU (28.6 t/s) is faster than on the GPU; the GPU route is not the faster one for token generation on every device, because generation is limited by memory bandwidth on both. Full conditions, KL-divergence results and known issues: release notes of v2.9.0.
Verification
Each release is checked on real phones (Galaxy S25, S21, S20, A35, A53) over ssh: ameva_qmm_check (516 MUL_MAT
cases), ggml test-backend-ops for AMEVA0 (4430 cases on the A35), KL divergence against the CPU with a gate of 0.01,
and text comparison with the CPU. A zero exit code is not accepted as evidence of GPU execution.
Upgrading from ameva-runtime
amv-runtime ships the same import package as ameva-runtime, so the two distributions must not be installed together.
Remove the old one first:
pip uninstall -y ameva-runtime
pip install amv-runtime
ameva-run doctor
Bundles already installed under ~/.local/share/ameva/ are kept. Versions 2.8.1 and earlier remain available under the
old names; the old PyPI project and the npm package @ameva/runtime receive no further releases.
Repositories
- Source:
uno-km/amv-runtime(private) - Public releases and engine bundles:
uno-km/amv-runtime-releases - Compute library and GPU backend (public):
uno-km/ameva-compute
License
Free for noncommercial use under the PolyForm Noncommercial License 1.0.0 (file LICENSE). Commercial use needs a
separate commercial license (file LICENSE-COMMERCIAL.md; amv.foundation.kr@gmail.com). Versions
published before 2.9.0 keep the Apache-2.0 license they were released under. Third-party components keep their own
licenses (file THIRD_PARTY_NOTICES.md).
Metadata
Release files for amv-runtime 2.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| amv_runtime-2.9.0.tar.gz | 129.3 kB | Without provenance | Details for amv_runtime-2.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| amv_runtime-2.9.0-py3-none-any.whl | Python 3 | none | any | Details for amv_runtime-2.9.0-py3-none-any.whl |
Total release size: 276.3 kB
Release files / amv_runtime-2.9.0.tar.gz
| Download URL | amv_runtime-2.9.0.tar.gz |
|---|---|
| Size | 129.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3460d4e2b35b06f06cc476fb73f129bb4e124aac5f7032af7c549064caf2fdd6
|
|
BLAKE2b-256 checksum How to use checksums |
4944f508581ca14c19b5e1e51f95a663e52b79b7043676c9528fdb081eb3daa2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.0
|
Release files / amv_runtime-2.9.0-py3-none-any.whl
| Download URL | amv_runtime-2.9.0-py3-none-any.whl |
|---|---|
| Size | 147.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb128b4a7c9f783037d645fcb03ff322823e78400e9eca730552092b7bbb0f44
|
|
BLAKE2b-256 checksum How to use checksums |
209aa6359a53f0ece01d92c458dd287274ba841fcd297863e6a492e939eb3481
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.0
|
Security for amv-runtime 2.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.