Low-resource Device Virtual Emulator — A benchmarking harness for evaluating compressed PyTorch models against simulated low-cost Android device profiles, without requiring physical target hardware.
# lodevem
> **Lo**w-resource **De**vice **V**irtual **Em**ulator — benchmark PyTorch models against simulated low-cost Android device profiles, without physical target hardware.
---
## What It Does
`lodevem` answers the question: *"If a farmer in rural Ghana with a Nokia C1 (1GB RAM) runs my cocoa disease model, will it work? How fast? Will it crash?"* Or, *"Can this $100 budget Android phone generate tokens from a quantized 2B parameter LLM without running out of memory?"*
You bring your model files (already compressed however you like). lodevem benchmarks each one against a library of 16 real device profiles spanning budget Android phones, Android Go devices, and KaiOS feature phones — and produces a results table ready for your paper.
**lodevem does not compress your model.** That is your responsibility as the researcher.
---
## How It Works
```
Your .pt model files (cocoa_fp32.pt, cocoa_int8.pt, tiny_llm.pt ...)
│
▼
┌─────────────────┐
│ lodevem │ benchmarks each model against each device profile
└────────┬────────┘
│
┌────────┴─────────┐
▼ ▼
nn-Meter psutil / Docker
Latency Prediction RAM Measurement
(per device SoC) (per device profile)
│ │
└────────┬─────────┘
▼
Results Table
(console + CSV file)
```
**New in 0.2.0:** Full support for Large Language Models (LLMs) via Hugging Face. Automatically measures Time-To-First-Token (TTFT) and Tokens-Per-Second (TPS) on simulated budget devices.
### Two measurement modes — selected automatically
| Environment | Mode | What it does |
|---|---|---|
| Kaggle, Colab, any machine | **Lite** (default) | Uses `psutil` to measure real peak RAM. No containers needed. |
| Linux with Docker running | **Full** | Spins up a RAM-capped container. Hard OOM detection enforced by the kernel. |
You don't choose the mode — lodevem detects Docker automatically and uses whichever is appropriate.
---
## Installation
```bash
pip install lodevem
```
**Note:* …