Skip to main content

amv-device-sdk

Authoritative on-device telemetry, capability probing, and shared storage foundation for the AMEVA & Android Termux ecosystem.

License Python Node.js


Architecture & Purpose

amv-device-sdk serves as the Single Source of Truth (SSOT) foundation across all submodules in the uno-km/termux and uno-km/ameva ecosystems (including termux-llamacpp, termux-vision, termux-diffusion, termux-tts, termux-stt, termux-bitnet, and termux-playwright).

It eliminates cross-project fragmentation (AST drift) by unifying:

  1. Environment Diagnostics: Authoritative is_termux(), is_android(), is_proot().
  2. Hardware Telemetry: Direct /proc/meminfo RAM detection, ARM64 feature flags (neon, fp16, dotprod), Vulkan ICD discovery, and thermal/compute thread heuristics.
  3. Storage & Verification: Multi-tier directory resolution according to the AMEVA Shared Storage Specification, streaming SHA-256 integrity checks, and atomic file replacements.
  4. Dual-Engine ABI: 100% functional parity between Python (ameva_device) and Node.js (ameva-device-sdk).

Installation

Python

pip install amv-device-sdk
# or within editable development mode:
pip install -e ./dev/ameva/ameva-device-sdk

Node.js

npm install amv-device-sdk
# or link locally:
npm link ./dev/ameva/ameva-device-sdk

API Specification

1. Python API (import ameva_device as dev)

import ameva_device as dev

# Environment
is_termux: bool = dev.is_termux()
is_android: bool = dev.is_android()
is_proot: bool = dev.is_proot()

# Hardware Telemetry
total_mb, avail_mb = dev.get_memory_info()
features: dict[str, bool] = dev.read_cpu_features()  # {'neon': bool, 'fp16': bool, 'dotprod': bool}
threads: int = dev.get_optimal_threads()
has_vulkan, desc = dev.probe_vulkan_driver()

# Storage & Cryptographic Verification
search_dirs = dev.get_unified_model_search_dirs(submodule="vision")
is_valid = dev.verify_file_sha256("model.bin", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")
dev.atomic_replace("model.bin.tmp", "model.bin")

2. JavaScript / TypeScript API (const dev = require('amv-device-sdk'))

import {
  isTermux,
  isAndroid,
  isProot,
  getMemoryInfo,
  readCpuFeatures,
  getOptimalThreads,
  probeVulkanDriver,
  getUnifiedModelSearchDirs,
  verifyFileSha256,
  verifyFileSha256Sync,
  atomicReplace,
} from 'amv-device-sdk';

// Hardware Telemetry
const { totalMb, availableMb } = getMemoryInfo();
const { neon, fp16, dotprod } = readCpuFeatures();
const optimalThreads = getOptimalThreads();

// Storage Resolution
const searchDirs: string[] = getUnifiedModelSearchDirs('llamacpp');

// Cryptographic Verification
const valid = await verifyFileSha256('model.gguf', '<sha256_hash>');

GPU runtime guard (0.2.0)

The termux-* packages run on the CPU by themselves. GPU execution comes from amv-runtime (AMUDA). Call the guard at the start of every code path that was asked to use the GPU. If the runtime is missing or too old, it stops with AMU_ERR_RUNTIME_REQUIRED, explains what AMUDA is, and prints how to install it. It never falls back to the CPU.

from ameva_device import require_ameva_runtime, exit_if_runtime_missing

version = require_ameva_runtime("termux-bitnet", "GPU inference", min_version="2.8.0")  # raises
exit_if_runtime_missing("termux-bitnet", "GPU inference")  # CLI: message on stderr, exit status 69
const { requireAmevaRuntime, exitIfRuntimeMissing } = require('amv-device-sdk');
requireAmevaRuntime('termux-bitnet', 'GPU inference', { minVersion: '2.8.0' }); // throws AmevaRuntimeRequiredError
exitIfRuntimeMissing('termux-bitnet', 'GPU inference'); // CLI: message on stderr, exit status 69

The check confirms that the package is installed at the requested version. It does not prove that a GPU works; run ameva-run doctor for that.


Verification & Compliance

All interfaces are strictly validated against:

  • Automated regression test suites (python tests/test_device.py, node tests/test_device.js).
  • OpenSSF best practices, zero synthetic stubs, and strict Linux ABI specifications.

License

Apache License 2.0. Copyright (c) 2026 uno-km / AMEVA Systems Team.

Metadata

Release files for amv-device-sdk 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amv-device-sdk 0.2.1
File Size Uploaded Provenance Actions
amv_device_sdk-0.2.1.tar.gz 18.9 kB Without provenance Details for amv_device_sdk-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for amv-device-sdk 0.2.1
File Interpreter ABI Platform Actions
amv_device_sdk-0.2.1-py3-none-any.whl Python 3 none any Details for amv_device_sdk-0.2.1-py3-none-any.whl

Total release size: 36.2 kB

Release files / amv_device_sdk-0.2.1.tar.gz

Download URL amv_device_sdk-0.2.1.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
72691464f67d26a0aae7a1486a4043a43b1457fcb71031c19af2c7e3458608be
BLAKE2b-256 checksum
How to use checksums
2fd2b4c07909669044e771d0506c0aaf709e821163388b8d815ebb5395cac464
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Release files / amv_device_sdk-0.2.1-py3-none-any.whl

Download URL amv_device_sdk-0.2.1-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95a309bd2b2d01207f50af704b6b1e45437f5c22eb9f7b71bfbeef1a0f1af4e0
BLAKE2b-256 checksum
How to use checksums
b62bd1e25b5bc6758e521005ee0de93f7f7e545a2e605f01c4a9cafbca203e26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Security for amv-device-sdk 0.2.1

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.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page