ZH-RESEARCH-002 · Mobile engineering · Artificial intelligence

Running AI on Budget Android Phones: Rust vs JavaScript Benchmark

Status: PlannedPlan published By Zubair Hussain

Experiment design: one quantized model run through a JavaScript path and a Rust native path on 4 GB and 8 GB Android phones, measuring latency, memory, heat, battery and crashes.
Experiment design. No results are shown until they have been measured.

The question

Can affordable smartphones run AI models locally without cloud costs, heavy battery drain or a poor user experience?

Abstract

Most AI features in mobile apps send every request to a paid cloud API. For users on budget phones and patchy connections, that means cost, latency and no offline mode. This benchmark runs the same quantized models through a React Native JavaScript path and a Rust native path on 4 GB and 8 GB Android devices, starting with text and voice generation before trying anything as heavy as video.

Hypothesis

A Rust native path cuts latency and memory use enough to make small quantized text and voice models usable offline on a 4 GB phone, while the JavaScript path is only practical on 8 GB devices.

Experimental setup

  • One quantized text model and one voice model, identical weights and settings in both runtimes.
  • Two Android test devices: a 4 GB RAM budget phone and an 8 GB RAM mid-range phone.
  • A React Native app with two interchangeable inference back ends: JavaScript and Rust via a native module.
  • Battery, temperature and memory sampled during every run; airplane mode for the offline tests.

Method

  1. Warm up each model, then run a fixed prompt set 50 times per runtime and device.
  2. Record time to first token, tokens per second, peak memory and crashes.
  3. Run 20 minutes of continuous inference to measure thermal throttling.
  4. Compare cost per generation against an equivalent cloud API call.
  5. Publish the app, the prompts and the raw measurements.

Test cases

IDExperimentMeasurementResult
TC-011JavaScript vs native integrationExecution latencyPending
TC-012Rust native inferenceMemory consumptionPending
TC-013Quantized AI modelsQuality vs model sizePending
TC-0144 GB RAM AndroidStability and crashesPending
TC-0158 GB RAM AndroidGeneration throughputPending
TC-016Offline generationCompletion ratePending
TC-017Continuous inferenceThermal throttlingPending
TC-018Local vs cloud AICost per generationPending
TC-019Adaptive model selectionResource efficiencyPending
TC-020Low-battery operationEnergy consumptionPending

Results

Not measured yet. Results, the raw data as CSV and the source code will be published here once the experiment has run, including any test case that fails.

Work with me

Schedule a technical consultation

Facing the same problem in your own product? I can run the same tests on your stack and fix what they find.

All research