Skip to content

Repository files navigation

LM Router

Chat with free models through your own local gateway — OpenAI compatible, no account, no API key

Download APK Windows Linux Flet Python


Download

Platform Download Notes
🤖 Android Android APK Most phones — see the split table below for other architectures
🪟 Windows Windows Release Automated standalone setup installer with desktop shortcut integration
🐧 Linux (Debian/Ubuntu) Linux DEB Desktop package tailored for Ubuntu, Debian, Linux Mint & Pop!_OS
🎩 Linux (Fedora/RHEL) Linux RPM Desktop package tailored for Fedora, openSUSE, RHEL & CentOS
📦 Linux (Universal Portable) Linux TAR.GZ Universal standalone portable archive for Arch, Alpine, Steam Deck & all distros

Android Architecture Build Splits

Variant Download Notes
📱 ARM64 (most phones) lm-router-arm64-v8a.apk Modern 64-bit Android devices
📱 ARMv7 (older phones) lm-router-armeabi-v7a.apk Legacy 32-bit Android devices
💻 x86_64 (emulators) lm-router-x86_64.apk Chromebooks & Android emulators

Core Capabilities

Capability Description
Local Gateway An OpenAI-compatible gateway runs on your own machine at 127.0.0.1 — no account, no API key, no server in between. Your OpenAI-compatible clients point straight at it.
The auto Model One model that rotates across healthy free models for you, preferring ones that can call tools — so a dead or rate-limited model never ends your chat.
Streaming Chat Token-by-token replies with visible reasoning (collapsible while it thinks), expandable tool calls, per-message token usage, stop-and-keep-partial.
Web Search Built-in search tool with automatic fallback to keyless sources, so a capped provider never kills an answer.
MCP Servers Add your own MCP servers; enable, disable and test their tools from Settings.
Multi-Provider Route chat through any OpenAI-compatible endpoint with an optional key stored only on your device.
Share Publish your gateway through a public tunnel with an optional API key, and hand out the full model catalog to other clients.
History & Export Conversations stay on your device; open, search, copy and export them as Markdown.

Screenshots

Chat

Chat (light) Chat (dark)
Web search with tool cards and an expandable reasoning block (light). The same thread in dark, with the gateway's base URL in the answer.
Chat with MCP tools Model picker
MCP tools run mid-conversation: library lookups, reasoning and code in one thread. Every model with its endpoint type and the gateway's own rate hint.

Server

Model catalog Sharing
Model catalog with per-row test actions, rate hints, retest sweeps and the activity log. Share the gateway on a public URL any OpenAI client can use, with an optional key.

Settings

Settings MCP servers
System prompt, gateway behaviour and generation controls. Connected MCP servers with per-tool switches, Test and Disable.

Features

  • Streaming Chat — token-by-token replies with markdown tables and code highlighting, visible reasoning blocks, expandable tool calls, and per-message token usage.
  • Regenerate & Edit — long-press or right-click any message to copy it, re-run the last reply, or edit-and-resend the last question.
  • Server Console — gateway status, start/stop, live logs with level filters, refresh model catalog, and the full catalog with per-model rate limits and endpoint types.
  • Settings — theme, generation parameters, gateway port and autostart, providers, MCP servers, search toggle, About.
  • Onboarding — terms gate and consent flow before first use.
  • Updates — silent version check with release notes, plus a manual check from Settings.
  • Desktop — closing the window keeps the gateway running in the background; Quit is always one click away.

Architecture

Layer Technology Purpose
Frontend Flet 1.0.3 on Python 3.14 Cross-platform UI — components, contexts, observable state, Markdown, services
Chat Core kani (OpenAI engine) on an anyio portal Streaming turns, tool calling, reasoning capture, token budgeting
Gateway router.kiri.ng fetched at startup Local OpenAI-compatible endpoint with model discovery, health and rate hints
Tools Official mcp SDK Remote/local MCP servers; built-in Exa + Parallel search (MCP-only, vendor failover)
Sharing Stdlib auth proxy + public tunnel Optional key-protected exposure of the local gateway to another OpenAI client

Visual Flow

graph TB
    subgraph LMROUTER_CLIENT ["LM ROUTER CLIENT (Local-First Chat Client)"]
        UI["Flet 1.0.1 UI: Chat | Server | Settings | History"]
        Chat["kani Streaming Turns (anyio portal)"]
        Tools["MCP Servers + Web Search"]
        Gateway["Kiri Router Gateway (local thread)"]
        Storage[".flet Storage: settings, history, logs"]
        UI --> Chat
        Chat --> Tools
        UI --> Gateway
        UI --> Storage
    end

    subgraph MODELS ["FREE MODEL PROVIDERS"]
        Free["Third-party OpenAI-compatible Free Models (HTTPS)"]
    end

    Gateway --> Free
    UI -. "optional share tunnel" .-> Gateway
Loading

Development

uv sync                                   # install venv (dev group included)
uv run ruff check src tests               # lint (same paths CI lints)
uv run ruff format --check src tests      # format gate (same as CI)
uv run pytest -q                          # test suite
uv run flet run -v                        # run desktop app
uv run flet clean                         # delete build/ (Flutter shell + staged python)
uv run flet build apk --split-per-abi -v  # Android (matches CI)

Privacy & Security

  1. On your device: the gateway runs locally, binds only to 127.0.0.1, and conversation history and settings stay on this machine.
  2. No account: no registration, no login, and no user API key is required for the built-in gateway.
  3. Prompts go to third parties: model requests are sent to free providers that may log them and use them for training — we have no control over that.
  4. Keys stay local: any provider key you add is stored on this device only and never logged.
  5. Ad-supported on mobile: mobile builds show Google AdMob ads, with consent managed through Google UMP.

Legal Disclaimer

Free models are provided by third parties under their own terms and rate limits. Your messages are sent to those third parties: they may log your prompts and use them for training. Model availability changes without notice. Ads are served by Google AdMob on mobile builds only.

Open Source Licenses

About

LM Router: chat with free models through your own local gateway. Flet app, OpenAI compatible, no API key.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages