Skip to main content

Mobile Clients

LA Router supports mobile applications with a flexible deployment model — run AI locally on the device for privacy and offline access, or connect to a remote LA Router server for cloud-scale models. Mobile clients get the same intelligent routing, token tracking, and OpenAI-compatible API as desktop and web.

Deployment Modes

Mobile clients can operate in three modes, and LA Router handles all of them:

Mode 1: Local AI on Device

Modern phones (iPhone 15 Pro+, Pixel 8+, Samsung Galaxy S24+) can run small LLMs directly on-device:

Architecture

Supported Models for Mobile

ModelSizeRAM RequiredPlatforms
SureCentric LLM2B2.3 GB (Q8_0)4 GBiPhone 15 Pro+, flagship Android
SureCentric LLM4B4.3 GB (Q8_0)6 GBiPhone 16 Pro, high-end Android
Device Requirements

On-device inference requires devices with Neural Engine (Apple) or GPU delegate (Android) support. Older devices should use Remote mode.

React Native Integration

// services/ai.ts — Mobile AI client
import { NativeModules } from 'react-native';

const AI_BASE_URL = __DEV__
? 'http://localhost:18790'
: NativeModules.LARouter.getBaseUrl(); // embedded sidecar

export async function askAI(prompt: string) {
const response = await fetch(`${AI_BASE_URL}/v1/chat/completions`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'auto',
messages: [{ role: 'user', content: prompt }],
}),
});

return response.json();
}

Tauri Mobile Integration

Tauri 2.0 supports iOS and Android with the same sidecar pattern as desktop:

// src-tauri/src/mobile.rs
use tauri::api::process::Command;

pub fn start_router() {
let (mut rx, _child) = Command::new_sidecar("larouter")
.expect("failed to find larouter binary")
.args(["serve", "--port", "18790", "--models-dir", "/data/models"])
.spawn()
.expect("failed to spawn larouter");
}

Mode 2: Remote Server

For devices without enough resources for local inference, or when cloud-scale models are needed, the mobile app connects to a remote LA Router instance:

Architecture

Mobile App  ──(HTTPS)──▶  LA Router (cloud VPS)  ──▶  Cloud LLMs
(Docker on server) (Gemini / Claude / OpenAI)

This is identical to the Web Client deployment. The mobile app simply points to the server URL:

// config.ts
export const AI_CONFIG = {
// Remote LA Router server
baseUrl: 'https://api.yourapp.com',
projectToken: 'lr_mobile_project_xxx',
};

Advantages

  • No model download required (saves device storage)
  • Access to all model tiers including Complex and Frontier
  • Works on any device regardless of hardware
  • Shared usage tracking and billing across all clients

The hybrid mode combines the best of both — local models for fast, private tasks and cloud fallback for complex ones:

Configuration

// Hybrid mode: local for simple, remote for complex
export const AI_CONFIG = {
localUrl: 'http://localhost:18790', // on-device LA Router
remoteUrl: 'https://api.yourapp.com', // cloud LA Router
useLocalFor: ['heartbeat', 'simple'], // tiers to handle locally
useRemoteFor: ['moderate', 'complex', 'frontier'],
};

Offline Support

The mobile deployment excels at offline operation:

ScenarioBehavior
Fully offline + local modelAll Heartbeat/Simple tasks work normally
Fully offline + no local modelRequests queued until connectivity restored
Slow connectionLocal model handles quick tasks; complex queued
Full connectivityHybrid routing — local for simple, cloud for complex

Platform Comparison

FeatureiOSAndroid
Local inference✅ Core ML + Metal✅ GPU delegate + NNAPI
Supported models2B, 4B (on Pro devices)2B, 4B (flagship devices)
Background inference⚠️ Limited by iOS✅ Foreground service
Model storageApp containerApp internal storage
Min deviceiPhone 15 Pro (A17 Pro)Pixel 8 / Snapdragon 8 Gen 2

Data Flow Summary

┌─────────────────────────────────────────────────────────┐
│ Mobile Client │
│ │
│ Simple task ──▶ Local LA Router ──▶ On-device LLM │
│ (free, private, offline) │
│ │
│ Complex task ──▶ Remote LA Router ──▶ Cloud API │
│ (paid, powerful, requires network) │
│ │
│ LA Router automatically classifies and routes. │
│ The app developer just calls /v1/chat/completions. │
└─────────────────────────────────────────────────────────┘