⚡ litrun
Deploy any LLM to any embedded Linux device in one command.
A lightweight, universal open-source runtime that eliminates hardware fragmentation for on-device AI across Raspberry Pi, Orange Pi, industrial SoCs, and ARM64 / RISC-V edge boards.
🚀 Quickstart: The One Working Moment
1. Instant POSIX Bootstrap (No toolchains, no cmake)
curl -sSL https://raw.githubusercontent.com/assassinaj602/litrun/main/scripts/install.sh | sh
Or via pip:
pip install litrun
2. Inspect Hardware Vector Capabilities (<5ms)
litrun inspect
3. Run Your First Model With Zero Guesswork
litrun run qwen2.5-0.5b
→ Detected: Raspberry Pi 5 Model B (BCM2712 Cortex-A76, 8192 MB RAM)
→ Selected: qwen2.5-0.5b-Q4_K_M (optimal RAM envelope: 900MB required / 6800MB free)
→ Binary: pulling precompiled ARM64 a76+dotprod build... done [cached]
→ Model: streaming weights from HuggingFace (397MB)... done
→ Warmup complete. Running at 14.2 tokens/sec on 4 threads. Type to interact.
> Hello litrun! How do you prevent out-of-memory crashes on embedded devices?
litrun: I integrate a dedicated C resource governor that inspects Linux memory
cgroups and /proc/meminfo before model allocation, preventing kernel OOM-killer panics.
🧠 Why Litrun Exists
| The Amateur Edge AI Struggle | The Litrun Way |
|---|---|
| 45-minute on-device compilation on Pi 4 that thermal throttles and crashes during linking. | Instant prebuilt binaries cross-compiled per microarchitecture (Cortex-A72 NEON, Cortex-A76 DotProd). |
| Quantization guesswork: Devs guess between Q4_K_M, Q5_K_S, IQ3_XS without knowing if RAM + KV cache fits. | Hardware-aware envelope: Evaluates free RAM + KV cache before launch, picking optimal accuracy safely. |
| Silent kernel panics: Linux OOM-killer randomly terminates services or hangs the board. | Active Resource Governor: Hard memory ceilings and dynamic thermal throttling. |
| Disjoint vendor APIs: llama.cpp, ONNX Runtime, and RKNN share zero API commonality. | Unified Interface: One CLI, Python SDK (from litrun import Model), and drop-in OpenAI REST API. |
🏛️ System Architecture
Litrun is architected in 5 decoupled layers:
┌────────────────────────────────────────────────────────┐
│ LAYER 1: User Surface (CLI, Python SDK, REST Server) │
│ litrun run/pull/list/inspect/serve • from litrun import Model │
└──────────────────────────┬─────────────────────────────┘
│
┌──────────────────────────▼─────────────────────────────┐
│ LAYER 2: Orchestration & Active Resource Governor │
│ RAM Safety Ceiling (85%) • Cgroup v1/v2 • Thermal Monitor│
└──────────────────────────┬─────────────────────────────┘
│
┌──────────────────────────▼─────────────────────────────┐
│ LAYER 3: Hardware Abstraction Native Engine (Pure C99) │
│ Devicetree • Aux Vector (NEON, DotProd, i8mm) • <5ms │
└──────────────────────────┬─────────────────────────────┘
│
┌──────────────────────────▼─────────────────────────────┐
│ LAYER 4: Pluggable Inference Backends │
│ llama.cpp (ARM DotProd) • RKNN NPU • ONNX Runtime │
└──────────────────────────┬─────────────────────────────┘
│
┌──────────────────────────▼─────────────────────────────┐
│ LAYER 5: Distributed Metadata Registries (Flat YAML) │
│ models.yaml • hardware.yaml • binaries.yaml (GitHub CDN) │
└────────────────────────────────────────────────────────┘
💻 Python SDK Usage
from litrun import Model, probe_hardware, poll_governor
# 1. Inspect hardware and active memory governor
hw = probe_hardware()
print(f"Board: {hw.board_name} | Profile: {hw.profile_id}")
print(f"Vector Acceleration: NEON={hw.has_neon}, DotProd={hw.has_dotprod}")
# 2. Automatically resolves hardware, checks RAM envelope, pulls weights
model = Model.load("qwen2.5-0.5b")
# 3. Stream tokens in real time
for chunk in model.stream("Summarize industrial sensor telemetry:"):
print(chunk, end="", flush=True)
# 4. Or launch the local OpenAI-compatible REST server
# model.serve(host="0.0.0.0", port=8080)
🌐 OpenAI-Compatible REST Server
Drop Litrun directly into LangChain, LlamaIndex, AutoGen, or web frontends:
litrun serve --port 8080 qwen2.5-0.5b
Send standard OpenAI completions:
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen2.5-0.5b",
"messages": [{"role": "user", "content": "Explain edge computing in one sentence."}],
"stream": true
}'
Query live hardware and thermal telemetry via REST:
curl http://localhost:8080/v1/hardware
📐 Deterministic JSON Mode & GBNF Schema Enforcement
Small models (0.5B – 1.5B) often hallucinate syntax errors when asked for JSON. Litrun compiles JSON schemas directly into GGML BNF (GBNF) grammars, forcing output tokens to adhere strictly to your schema:
Via CLI:
# Standard valid JSON:
litrun run qwen2.5-0.5b --json -p "Extract sensor telemetry: temperature is 24.2C and status is nominal"
# Or with strict schema:
litrun run qwen2.5-0.5b --schema '{"type":"object","properties":{"temp":{"type":"number"},"status":{"type":"string"}},"required":["temp","status"]}'
Via OpenAI REST API:
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen2.5-0.5b",
"messages": [{"role": "user", "content": "Return room telemetry"}],
"response_format": {"type": "json_object"}
}'
🏠 Home Assistant & Edge Robotics Integration
Run offline, zero-cloud automations directly on your Raspberry Pi 4 / 5 or Home Assistant Yellow:
- See the complete Home Assistant Integration Guide & Docker Compose.
- Try the interactive Edge Memory Calculator to test hardware envelopes before deployment.
📊 Hardware Support Matrix
| Board / SBC | SoC Architecture | Vector Extensions / NPU | Default Speed | Phase |
|---|---|---|---|---|
| Raspberry Pi 5 | BCM2712 (Cortex-A76) | ARM NEON + DotProd (ASIMDDP) | 14.2 tok/s | Phase 1 (GA) |
| Raspberry Pi 4 Model B | BCM2711 (Cortex-A72) | ARM NEON (ASIMD) | 8.2 tok/s | Phase 1 (GA) |
| Raspberry Pi 3 / Zero 2 W | BCM2837 (Cortex-A53) | ARM NEON Baseline | 14.5 tok/s (135M) | Phase 1 (GA) |
| Orange Pi 5 / 5 Plus | Rockchip RK3588 | 6 TOPS NPU (RKNN) + A76/A55 | 18.5 tok/s | Phase 2 |
| NVIDIA Jetson Orin Nano | Tegra Orin (Cortex-A78AE) | Ampere GPU + NVDLA | 28.0 tok/s | Phase 2 |
| Generic x86_64 Edge Host | Intel Core / AMD Ryzen | AVX2 + FMA | 32.0 tok/s | Phase 1 (GA) |
🛠️ Building & Testing from Source
# Clone the repository
git clone https://github.com/assassinaj602/litrun.git
cd litrun
# Build C Native Core and Shared Library
make all
# Run complete test suite (C99 unit tests + Python test suite)
make test
# Install locally in editable development mode
make install-dev
📄 License
Litrun is 100% open-source software licensed under the MIT License. Built with ❤️ for the embedded Linux and robotics community.
Metadata
Release files for litrun 0.2.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 |
|---|---|---|---|---|
| litrun-0.2.0.tar.gz | 51.8 kB | Without provenance | Details for litrun-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| litrun-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for litrun-0.2.0-py3-none-any.whl |
Total release size: 105.4 kB
Release files / litrun-0.2.0.tar.gz
| Download URL | litrun-0.2.0.tar.gz |
|---|---|
| Size | 51.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5df06dabe05f8fa62ebd985883aeebd234b6b8f7d807d11505d340942245ab1
|
|
BLAKE2b-256 checksum How to use checksums |
e4bcc531fe36f7084c9887dd5f269fe1056a73a9e847bc77f50c92eeabf642ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.0rc3
|
Release files / litrun-0.2.0-py3-none-any.whl
| Download URL | litrun-0.2.0-py3-none-any.whl |
|---|---|
| Size | 53.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a10bccb74aad556fcdb3df7afdf3056e4c0cca6852ff07c0250b6e4d9866bafb
|
|
BLAKE2b-256 checksum How to use checksums |
c07c1485e0be8b99f4787d96f1feda8bc3f2c3d05fcd20541542a7cfea228689
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.0rc3
|
Security for litrun 0.2.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.