OlliteRT

NightMeanApache-2.0活跃维护

把安卓手机变成兼容 OpenAI 接口的本地大模型推理服务器,数据不出设备,可接入 Home Assistant 等应用。

Turn your Android phone into an OpenAI-compatible LLM inference server - Fully local, private and Open Source

v0.9.7-beta.1发布于 2026-09-22 11:04 UTC628star +10 / 7 天95fork同步于 2026-11-10 17:57 UTC

怎么上手

由 README 提炼,执行前请确认
下载并安装 GitHub Releases 中的 APK;在应用内下载模型(推荐 Gemma 4 E2B)后点击 Start Server,客户端使用 http://PHONE_IP:8000/v1
硬件要求按 README 说明

需 Android 12+、arm64-v8a 设备,最低 6 GB RAM,多模态模型建议 8 GB 以上;README 未给出具体显存要求,模型以文件大小和最低 RAM 标注(如 Gemma 4 E2B 为 2.4 GB、需 8 GB RAM)。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

把安卓手机变成本地 OpenAI 兼容 LLM 推理服务器,无需云端和 API Key

把安卓手机变成兼容 OpenAI 接口的本地大模型推理服务器,数据不出设备,可接入 Home Assistant 等应用。

核心能力

  • 基于 LiteRT-LM 在手机 GPU/CPU 上运行 LLM
  • 提供 OpenAI 与 Anthropic 兼容的 HTTP API 端点
  • 支持从 HuggingFace 一键下载或导入 .litertlm 模型
  • 内置模型跑分对比与请求日志查看
  • 支持流式输出、视觉音频多模态与实验性工具调用

容易踩的坑

仅支持 arm64-v8a,其他架构和模拟器不可用;只支持 .litertlm 格式,不支持 GGUF;同一时间只加载一个模型且请求串行排队;导入模型是复制文件而非移动,需自行删除原文件释放空间。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

4 个版本v0.9.7-beta.1
  1. v0.9.7-beta.1OlliteRT v0.9.7-beta.1pre-release最新正式版2026-09-22 · 2026-09-22 11:04 UTC

    Added

    Floating Server Monitor

    • Movable system overlay — optionally keep live OlliteRT status visible while using another app
    • At-a-glance server state — shows server status, active model, request metrics, model capabilities, and the effective thinking budget
    • Quick controls and recovery actions — manage the server and respond to failures without returning to the main app
    • Configurable placement and notifications — position and behavior persist across monitor sessions

    Configurable Network Access

    • Listener scope — bind the server to all interfaces, loopback only, or a specific numeric IPv4/IPv6 address assigned to the phone
    • Client allowlists and blocklists — admit or reject exact IPv4/IPv6 addresses and CIDR networks before authentication, request-body parsing, or inference
    • Live policy updates — client access rules apply without unloading the active model; listener-address changes restart the server
    • Accurate endpoint reporting — Status, Home Assistant setup, and copied URLs reflect the active listener and IPv6 formatting
    • Status visibility — active listener scope and client-policy restrictions are shown in the app

    [!TIP] The configurable listener enables OlliteRT to work over private VPN networks such as Tailscale. Bind to the phone’s Tailscale IP, for example 100.x.y.z, to reach the server from other tailnet devices.

    Native Structured Output and Sampling Controls

    • Native JSON Schema constrained decoding — OpenAI response_format.type=json_schema is enforced by LiteRT-LM instead of relying on a prompt hint
    • Thinking budget control — configure a per-model reasoning-token budget with a logarithmic slider or exact value; Anthropic thinking.budget_tokens overrides it per request
    • Frequency and presence penalties — OpenAI sampler penalties now map to LiteRT-LM repetition controls
    • Exact per-turn output cap — request max_tokens is applied through the native per-message limit
    • Request seed support — OpenAI-compatible requests can supply a seed, and Advanced Settings can define an optional server-wide default seed
    • GPU audio acceleration — optional per-model setting moves the audio executor from CPU to GPU on supported devices
    • Improved Gemma 4 tool calls — native parsing accepts nested JSON and quoted-string delimiter tokens while constrained decoding is active

    Server Configuration API

    • Authenticated GET /v1/server/config — read the active model and server configuration without sending a request body
    • Default seed management — read, set, or clear default_seed through the API
    • Accelerator reporting — configuration responses identify the active cpu, gpu, or npu accelerator
    • Thinking budget management — read or update the configured reasoning-token budget
    • *Atomic validation
  2. v0.9.6-beta.1OlliteRT v0.9.6-beta.1pre-release2026-06-06 · 2026-06-06 13:00 UTC
    查看更新说明

    Added

    Speculative Decoding Support (Multi-Token Prediction, MTP)

    • Per-model toggle — Inference Settings sheet exposes an MTP toggle on capable models, off by default
    • Three-gate activation — allowlist capability, runtime Capabilities API verification, and the user toggle must all agree before MTP is enabled at Engine construction
    • Benchmark integration — MTP toggle on the benchmark screen
    • Import dialog support — user-imported MTP-capable models can declare and toggle the capability
    • Observability — speculative_decoding field on /v1/models, ollitert_model_speculative_decoding_enabled Prometheus gauge, MTP pill on the Status screen, Home Assistant sensor config
    • Gemma 4 E2B / E4B — model files updated to MTP-enabled variants, updatableModelFiles carries existing users forward
    • Documentation — capability rows added to model tables, FAQ entry explaining what speculative decoding is, allowlist schema doc updated
    • See What is speculative decoding / MTP for more information

    [!NOTE] Speculative decoding requires to re-download already downloaded Gemma-4 models from previous version. Update button will automatically appear upon installing this version. Downloading new Gemma-4 models will automatically download latest version with speculative decoding support.

    NPU / TPU Accelerator Support

    • Pixel TPU support for imported models — NPU offered as a selectable accelerator at model import time
    • Pixel device renaming — accelerator labels and descriptions show "TPU" on all Pixel devices via isPixelDevice()

    KV Cache Reuse Across Conversation Turns

    • Incremental dispatch — when consecutive chat-completion requests on the same model share system prompt and tools, only the new user turn is dispatched to the SDK so the LiteRT-LM KV cache is preserved (substantial latency reduction on long multi-turn conversations)
    • Strict invalidation — cache is dropped on any inference error, on tool-use turns, on multimodal turns, on size mismatch, or when the system prompt or tool set changes
    • Auditable decisions — verbose-debug logs every per-request request_incremental decision=EXTEND|RESET reason=… line for diagnostics

    Anthropic Messages API (Experimental)

    • /v1/messages endpoint — non-streaming and streaming, mirrors Anthropic's Messages API including message_start → content_block_* → message_delta → message_stop SSE sequence
    • /v1/messages/count_tokens endpoint — works with no model loaded, uses the same character-based token estimator as the rest of the server
    • x-api-key auth — accepted alongside Authorization: Bearer so Anthropic SDKs work without a server-side proxy
    • Per-request thinking override — Anthropic thinking.type=enabled|disabled overrides the model default, silently downgraded when the model has no thinking capability
    • ping heartbeat events — emitted every 10 s during prefill so SD
  3. v0.9.5-beta.1OlliteRT v0.9.5-beta.1pre-release2026-04-30 · 2026-04-30 18:37 UTC
    查看更新说明

    Added

    Native Tool Calling (Schema Injection)

    • Schema injection mode — tool schemas are registered directly with the LiteRT SDK for structured output, producing significantly more reliable tool calls than prompt-based parsing in 0.9.0-beta.1, see demo with Home Assistant Integration
    • Real-time streaming with tools — stream tokens in real-time even when native tool calling is active
    • Tool call indicator — log cards show a tool badge when the response contains tool calls
    • Tools capability — models with native tool calling support now show tools capability chip in Model Cards
    • Tools filter — filter the Models screen to show only models that support tool calling

    [!NOTE] Native tool calling is currently supported only by Gemma-4 models

    Multi-Repository Model Sources

    Model sources are independently-hosted model lists — similar to how F-Droid repositories work for apps. Each source provides a set of models that OlliteRT refreshes automatically for new models. Once added, new models appear on the Models screen as they're published — no app update required, as long as the bundled SDK supports them. See SDK Compatibility.

    • Multiple model sources — add, enable, disable, and remove custom model sources independently in Model Sources screen
    • Add sources from file or URL — the + button now offers both a local JSON file picker and URL input
    • Repository detail screen — tap any source to see all models it provides, including incompatible ones (greyed out with reason)
    • Incompatible model visibility — sources show "N models · M hidden" when some models require a newer app version
    • Model deduplication — models with same name across sources are shown only once — Official Source takes priority

    Cross-Channel Update Notifications

    • Cross-channel awareness — get notified about beta/dev releases while on stable (or vice versa)
    • Per-channel notification channels — separate Android notification channels for beta and dev releases
    • Dismiss per version — dismiss a notification for a specific version without disabling all notifications

    Model Behaviour Settings Card

    • Dedicated card — thinking token limit, thread pool, inference timeout, idle unload, and tool calling settings grouped together
    • Schema injection toggle — enable/disable native tool calling per preference
    • Reject when busy — optional - return error 503 instead of queueing when inference is running
    • Transcription enabled by default — force transcription prompt is now on by default, with an editable prompt to guide how the model processes audio input

    [!NOTE] The transcription prompt guides the model's behavior but does not guarantee accurate transcription — results depend on model capability and audio quality. Used by clients like Open WebUI and Home Assistant when sending audio input. Home Assistant requires a custom integration — see Voice Transcription (STT) for setup.

    Monitoring & Metrics

    • **Processing
  4. v0.9.0-beta.1OlliteRT v0.9.0-beta.1pre-release2026-04-24 · 2026-04-24 14:28 UTC
    查看更新说明

    [!IMPORTANT] This is a beta release. The beta and stable flavors use different application IDs and install side-by-side — they do not share data. When the first stable release ships, you will need to install the stable APK separately and re-download your models.

    Features

    Core

    • Hardware-accelerated inference — runs on your phone's GPU or CPU via Google's LiteRT LM runtime
    • Streaming — SSE and non-streaming response modes
    • Configurable listen port — default 8000, binds to all interfaces
    • Keep-alive idle timeout — (configurable) auto-unloads model after inactivity, reloads on next request

    Multimodal and Reasoning

    • Vision — send images as base64 data URIs in chat messages
    • Audio — inline audio or Whisper-compatible /v1/audio/transcriptions endpoint with automatic stereo-to-mono downmix
    • Thinking — chain-of-thought mode with <think> tag output (Gemma 4)
    • Tool calling — (experimental) runtime tool schemas injected via system prompt

    Models

    • One-tap download — grab models from HuggingFace, import .litertlm from local storage, or add custom model sources via JSON URL with ~24h auto-refresh
    • Search and sort — filter models by name, sort by size, alphabetical, or default order
    • Per-model inference settings — temperature, top-K, top-P, max tokens, thinking mode, system prompt
    • Accelerator selection — choose GPU or CPU per model
    • Model updates — automatic detection with notifications and per-model update indicators
    • Benchmarking — prefill speed, decode speed, TTFB, init time with shareable results

    Always On

    • Auto-start on boot and app launch — (configurable) server launches automatically with your configured default model
    • Foreground notification — Stop Server and Copy URL quick actions
    • Battery optimization exemption — prompt to prevent Android from killing the service

    Server Configuration

    • Authentication — optional bearer token auth and CORS support
    • Custom system prompts — global and per-model
    • Client sampler override — force server-side temperature/top-k/top-p
    • Context management — (configurable) automatic overflow handling: truncate history, compact tool schemas, trim prompt
    • Log persistence — local database with configurable retention and auto-pruning

    Monitoring and Observability

    • Status screen — model name, uptime, request count, decode speed, TTFB, context utilization
    • Logs screen — per-request cards with timing, token counts, expandable bodies, JSON highlighting, real-time preview, search, filtering, and log export
    • Prometheus metrics — /metrics endpoint with 29 metrics (memory, throughput, latency, errors)
    • Health endpoint — extended metrics for Home Assistant REST sensors
    • Remote server control — REST API endpoints for server control via Home Assistant

    App

    • Automatic update checks — via GitHub Releases
    • HuggingFace OAuth — sign in to download gated models
    • Report Issue — autofills GitHub issue template with relevant device info

    Integrations

    IntegrationSupport
    Home AssistantConversation agent, voice STT, REST sensors and command

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Quick Start | Screenshots | Features | Models | Integrations | API | FAQ | Report a bug

    What is OlliteRT?

    Think of it as Ollama for Android. Pick a model, tap Start, and your phone becomes an LLM server — runs LLMs on your mobile GPU/CPU via Google's LiteRT-LM runtime and serves them as a standard OpenAI-compatible HTTP API on your local network.

    No cloud. No API keys. No subscriptions. Just your phone.

    Features

    • Multi-model Support — One-tap download from HuggingFace, import .litertlm files or model lists from local storage, or add custom model sources via JSON file or URL
    • Multimodal & Reasoning — Vision, audio, thinking, streaming support, and tool calling (experimental) for capable models
    • Benchmark Built-in — Test and compare models on your device to find the best fit for your hardware
    • Activity Logs — Detailed request/response logs with search, filtering, and JSON highlighting
    • Always On, Low Power — Configurable auto-start on boot, sips ~5-10W vs 300W+ for a GPU server — perfect for that old phone in your drawer*
    • Highly Configurable — Per-model inference settings, GPU/CPU accelerator, idle model unload, listener scope, client IP access rules, bearer token auth, and more
    • Model & Server Monitoring — Live stats dashboard, optional movable floating monitor for live background metrics, Prometheus metrics for Grafana, and Home Assistant REST API for remote server control
    • Broad Compatibility — Home Assistant, Open WebUI, OpenClaw, Python, curl — if it talks to OpenAI, it works

    [!NOTE] Home Assistant currently requires a custom integration such as Extended OpenAI Conversation or Local OpenAI LLM and OpenAI STT for voice commands — see the Home Assistant client setup

    * I am not responsible for any swollen batteries, crispy phones, or spontaneous pocket warmers. Please don't run your LLM on your phone while it's under your pillow. You've been warned.

    Screenshots

    Quick Start

    1. Download & install the APK
    2. Download a model — Gemma 4 E2B is recommended for most devices (2.4 GB, runs on 8 GB RAM)
    3. Start the server — Tap the Start Server button on the downloaded model card
    4. Configure your client — Use the endpoint shown on the Status screen (e.g. http://PHONE_IP:8000/v1) with any OpenAI-compatible client — Open WebUI, OpenClaw, Home Assistant, Python, etc. See Client Setup for detailed guides.

    [!IMPORTANT] Requires: Android 12+ · arm64-v8a device · 6 GB RAM minimum · 8 GB+ recommended for multimodal models (see model table)

    Available Models

    ModelSizeMin RAMContextCapabilities
    Gemma 4 E2B ⭐2.4 GB8 GB32KText · Vision · Audio · Thinking · Tools · MTP
    Gemma 4 E4B ⭐3.4 GB12 GB32KText · Vision · Audio · Thinking · Tools · MTP
    Gemma 3n E2B3.4 GB8 GB4KText · Vision · Audio
    Gemma 3n E4B4.6 GB12 GB4KText · Vision · Audio
    Gemma 3 1B0.5 GB6 GB1KText
    Qwen 2.5 1.5B1.5 GB6 GB4KText
    DeepSeek-R1 1.5B1.7 GB6 GB4KText

    ⭐ Recommended — E2B for most devices, E4B for high-end

    [!NOTE] Tool calling is experimental and may not always be reliable due to model limitations.

    See the Model Guide for recommendations, capability details, and import instructions.

    Integrations

    API Endpoints

    MethodEndpointDescription
    POST/v1/chat/completionsOpenAI Chat Completions API (streaming + non-streaming)
    POST/v1/completionsOpenAI Completions API
    POST/v1/responsesOpenAI Responses API
    POST/v1/messagesAnthropic Messages API (streaming + non-streaming)
    POST/v1/messages/count_tokensAnthropic input-token estimator
    POST/v1/audio/transcriptionsAudio transcription
    GET/v1/modelsList available models
    GET/v1/models/{id}Get detail for a specific model
    GET/ or /v1Server info (version, status, endpoints)
    GET/healthHealth check (with optional ?metrics=true)
    GET/metricsPrometheus metrics
    GET/pingSimple liveness check
    GET/v1/server/configRead model and server configuration
    POST/v1/server/configUpdate model and server configuration

    Full API docs and examples: docs/api/API.md

    Limitations

    • arm64-v8a only — other architectures (armeabi-v7a, x86, x86_64) are not supported. The LiteRT runtime ships native libraries for x86_64 but they crash on Android emulators due to unsupported CPU instructions. Nearly all Android devices from 2017+ are arm64-v8a.
    • Single model, single request — one model loaded at a time, requests queue sequentially (LiteRT SDK limitation). On-demand model loading via client requests is planned for a future release.
    • Tool calling is model-dependent — Native tool calling requires models trained for function calling (such as Gemma 4). For models that don't support native tool calling, you can disable Tool Schema Injection in settings to use prompt-based fallback parsing instead.
    • Token counts are estimated — the LiteRT runtime doesn't expose a tokenizer API, so counts are approximated using character length ÷ 4. Reasonably accurate for English text, less so for code or multilingual content.
    • Imported models are copied to app storage — when importing a model from your device, the file is copied rather than moved. You can delete the original after import to reclaim space.
    • No GGUF support — only .litertlm models are supported (LiteRT runtime limitation). Models are available from the LiteRT Community on HuggingFace. Advanced users can convert HuggingFace models to .litertlm using Google's litert-torch tooling (Linux, 32GB+ RAM required).
    • LiteRT runtime constraints — OlliteRT is built on Google's LiteRT-LM runtime, optimized for mobile. Features like logprobs, grammar-based output constraints, repetition penalties, and LoRA adapters are not available.

    FAQ & Troubleshooting

    • FAQ — Model support, privacy, battery, architecture, tool calling
    • Troubleshooting — Connection issues, performance, crashes, auto-start, storage

    Privacy & Security

    • Privacy Policy — no data is collected, no telemetry, no analytics
    • Security Guide — bearer token auth, network exposure, HTTPS, securing your server

    Contributing

    Building from Source

    • Building — build instructions, signing setup, lint, and tests
    • Architecture — package structure, request flow, and dependency list

    Product flavors — all installable side-by-side:

    FlavorIconPurpose
    stableStable release
    betaBeta testing
    devLocal development

    Support the Project

    What happens on your phone stays on your phone. If that matters to you, consider supporting OlliteRT.

    Credits

    License

    Licensed under the Apache License 2.0.