DEV Community

Cover image for OlliteRT: Android LLM Server in 3 Steps
KAMAL KISHOR
KAMAL KISHOR

Posted on

OlliteRT: Android LLM Server in 3 Steps

TL;DR: This guide shows you how to set up OlliteRT, a free and open-source Android application that runs LLMs directly on your phone. You'll learn to turn an old Android device into a private, OpenAI-compatible AI server for local development and automation.

When you're prototyping AI features or building automation, relying on cloud-based LLMs often means constant API costs, data privacy concerns, and internet dependency. Imagine being able to run a capable LLM entirely offline, with your data never leaving your device. I've found that local-first AI tools, when good enough, are preferable to paid subscriptions, and I even wrote about replacing Cursor with a free local AI coding assistant. For those who want to extend this privacy and control to mobile, OlliteRT offers a compelling solution.

OlliteRT is an Android application that transforms your phone into a fully local, OpenAI-compatible LLM inference server. It leverages Google's LiteRT-LM runtime to run models directly on your mobile device's CPU/GPU, exposing them via a standard HTTP API on your local network. This means any application or script that can talk to the OpenAI API can instead talk to your Android phone, without external API keys or cloud services. It's a game-changer for privacy-focused AI experiments, mobile-first agentic workflows, or integrating AI into local automation where data absolutely needs to stay on-device. If you've been curious about running LLMs on Android, my guide on Llama 3.2 on Android: Run It Locally with Ollama is my most popular article, and OlliteRT takes this concept further by providing an API server.

What You'll Build and What You Need

You'll be setting up an Android device as a dedicated LLM server. This server will host one or more large language models and respond to HTTP requests from other devices on your local network, mimicking the OpenAI API. It's essentially "Ollama for Android".

Here's what you need:

  • An Android phone running Android 12 (API 31) or later.
  • The device must have an arm64-v8a architecture. Most Android phones from 2017 onwards meet this requirement.
  • Minimum 6 GB RAM; 8 GB+ recommended, especially for larger or multimodal models like Gemma 4 E4B, which may require 12 GB or more.
  • A stable Wi-Fi connection for client devices to access the server.
  • (Optional but recommended) ADB (Android Debug Bridge) installed on your development machine for advanced debugging.

OlliteRT works exclusively with .litertlm model files, not GGUF models typically used by llama.cpp-based tools. These .litertlm models are optimized for Google's LiteRT-LM runtime.

Setting up OlliteRT

The setup process is straightforward, focusing on getting the app and a model running.

  1. Download and Install the APK:
    Navigate to the official OlliteRT GitHub repository and download the latest APK from the releases section.
    Install it on your Android phone. You might need to enable "install from unknown sources" in your Android settings.

  2. Download a Model:
    Open the OlliteRT app. From within the app, you can download supported models directly from HuggingFace.
    Gemma 4 E2B is recommended for most devices (2.4 GB, runs on 8 GB RAM).

  3. Start the Server:
    Once a model is downloaded and selected, tap the Start Server button on the model card.
    The app will display the local IP address and port (e.g., http://PHONE_IP:8000/v1) that your client applications will use to connect.

Running a Quick Example

After the server starts, you can interact with it using any OpenAI-compatible client. This includes curl, Python's OpenAI SDK, Open WebUI, or even Home Assistant.

First, get your phone's IP address and the server's port from the OlliteRT app's "Status" screen. Let's assume your phone's IP is 192.168.1.100 and the server is on the default port 8000.

Here’s a curl example to send a chat completion request:

curl http://192.168.1.100:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Gemma-4-E2B-it",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Explain the concept of reactive programming simply."}
    ],
    "max_tokens": 150,
    "temperature": 0.7
  }'
Enter fullscreen mode Exit fullscreen mode

Replace 192.168.1.100 with your phone's actual IP address and Gemma-4-E2B-it with the name of the model you have loaded.

You can also use the Python openai library:

from openai import OpenAI

# Point to the OlliteRT server
client = OpenAI(
    base_url="http://192.168.1.100:8000/v1",
    api_key="sk-no-key-required" # A dummy key is fine if auth is not enabled
)

response = client.chat.completions.create(
    model="Gemma-4-E2B-it",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "What is the capital of France?"}
    ],
    max_tokens=50,
    temperature=0.7
)

print(response.choices[0].message.content)
Enter fullscreen mode Exit fullscreen mode

Ensure that if you've enabled bearer token authentication in OlliteRT's settings, you provide the correct api_key in your client requests.

Common Problems and Limitations

While OlliteRT provides a powerful local LLM server, there are a few things to keep in mind.

  • Model Format: As mentioned, OlliteRT exclusively supports .litertlm models. You cannot directly load GGUF models. Advanced users can convert HuggingFace models to .litertlm using Google's litert-torch tooling, but this requires a Linux environment and significant RAM (32GB+).
  • No Chat Interface: OlliteRT is a headless server, meaning it doesn't have its own chat UI. You interact with it programmatically via its HTTP API from another device.
  • Performance: While efficient for on-device inference, a phone's hardware is not equivalent to a dedicated GPU server. Expect acceptable latency for conversational AI and text generation, but real-time, heavy-duty tasks (like continuous video analysis) are better suited for dedicated AI hardware.
  • Battery and Heat: Running an LLM puts the phone's GPU under load, similar to a demanding game. For continuous use, it's advisable to keep the phone plugged in, remove its case for better heat dissipation, and place it on a cool surface.
  • Android Doze: Android's aggressive battery optimizations can kill background processes. To prevent OlliteRT from being killed, you should disable battery optimization for the app in Android settings (App info -> Battery -> Unrestricted). For a truly "always-on" server, some users have implemented external watchdog automation scripts to detect and relaunch OlliteRT if Android Doze kills it.

One honest limitation is that while OlliteRT supports multimodal capabilities and tool calling, these features are model-dependent and can be experimental. Models like Gemma 4 are better suited for these tasks, but sometimes specific integrations (like Claude Code) might push the context window too far, leading to errors or long prefill times.

Sources


Written by **Kamal Kishor* (@koolkamalkishor) — Sr. Frontend Developer building AI agents (React, TypeScript, LangChain). LinkedIn · GitHub · Portfolio*

Published: 25 Nov 2026. This article was generated with AI (Google Gemini + web search). Please check important details against the sources above.

Top comments (1)

Collapse
 
userxnom profile image
Abdullah Naseer •

The Doze point is the one that decides whether this is a real server or a demo — 'Unrestricted' battery plus an external watchdog is honest, but it also means the phone isn't really always-on by itself. Did you run Gemma 4 E2B long enough to see what actually happens to an in-flight request when Doze kicks in or the Wi-Fi drops — does the client get a clean error, or does the connection just hang until timeout? And on the .litertlm lock-in: conversion needing Linux and 32GB+ RAM seems to undercut the 'old phone' pitch for anyone with a custom model — did you find any model worth running that isn't already in OlliteRT's Hugging Face list?