Termux and llama.cpp on Android: the command-line route
VDF AI reports that Termux's package repository carries llama.cpp, with optional Vulkan and OpenCL backends as separate packages.
The steps VDF AI gives
- Install the package:
pkg update && pkg install llama-cpp. - Start the server on a small model:
llama-server -hf LiquidAI/LFM3-1.7B-GGUF:Q4_K_M -c 4096. The-hfflag downloads the named quantization from Hugging Face. - Open
http://127.0.0.1:9931in the phone's browser. VDF AI says current llama.cpp builds, including Termux's v1.0.0 package, listen on port 9931 by default, not the older 8080.
Trade-offs
You get the newest llama.cpp features and an OpenAI-style API on the phone, at the cost of typing on a touch keyboard, per VDF AI. For an app route instead, see PocketPal AI. The LFM3 model is covered in LFM3-1.7B.
We did not run these commands.
Sources
Checked: 27 Nov 2026. Figures change; confirm on the source before you rely on them.
Keep reading
- 8 GB vs 12 GB vs 16 GB phone for AI: which one should you buy?What each RAM tier lets you run, with the models, file sizes and the one-sentence verdict for each.
- AI-Benchmark ranking: what the columns mean, and what the top phones showReading the AI-Benchmark phone table: the score columns, five phones with their chip, RAM and AI Score as listed, and what the numbers cannot tell you about chat models.
- The airplane mode test: how to check a phone model is really offlineLoad a model on Wi-Fi, switch on airplane mode, send a prompt. The check VDF AI recommends and what it does and does not prove.
- Android local AI runtimes explained: MLC LLM, llama.cpp, ExecuTorch and moreA May 2026 guide lists five ways to run models on Android and warns about NNAPI deprecation, aggressive background killing and vendor-locked NPU tools. A secondary source, with caveats.