Logo van Localrouter

Localrouter

Community
jayleaton

Fast & opinionated local AI routing: one MCP server that loads local image and video models on demand on your own GPU box (DGX Spark first)

Uitgeverjayleaton
Repositorylocalrouter
TaalZig
Forks
5
Sterren
50
Beschikbare tools
0
Transporttypestdio, streamable-http
Categorieën
LicentieApache-2.0
Links
  • Koppel tools aan AI-workflows

    Localrouter biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    50 sterren en 5 forks in de gekoppelde repository.

[!WARNING] Early preview. LocalRouter is new and under active development: expect bugs and breaking changes. Please open an issue if something doesn't work.

LocalRouter turns one NVIDIA DGX Spark into a full-duplex "Jarvis" box. You talk to it and it talks back. You can interrupt it mid-sentence, and it can make a picture or a video while you talk. Everything runs on the box:

  • Chat: Qwen3.8 27B on TensorFold, with the DFlash2 drafter.
  • Voice: Fish Audio Drama 3, streamed as it speaks, with six fixed voices.
  • Hearing: Whisper large-v3-turbo with the Silero VAD.
  • Images: Qwen-Image 2.1 Turbo.
  • Video with audio: MiniMax H3.

One small Zig daemon owns the machine. It keeps the voice loop and chat warm, loads the other models when asked, makes room for them, and hands every tool to your agents over MCP and an OpenAI-compatible API.

Quick start

Tell your coding agent (Claude Code, Codex, T3, ...):

Read INSTALL.md and set up LocalRouter Jarvis on this box.

INSTALL.md is written for agents. It is a deterministic sequence of commands, with what to check at each step and what to ask you: which licences you accept, and whether the GPU may be used. To run it yourself:

bash
git clone https://github.com/jayleaton/localrouter && cd localrouter
tools/install/bootstrap.sh --profile jarvis-gb10 --dry-run   # the plan: steps, downloads, disk, memory, licences
tools/install/bootstrap.sh --profile jarvis-gb10 --accept    # after reading the licences the plan lists

What it does. It installs every model of deploy/profiles/jarvis-gb10.json, checks every download against its pin and qualifies chat and Drama 3 on the GPU. It leaves one systemd user service on 127.0.0.1:8190, which starts at boot and is reachable on your tailnet through tailscale serve. It is resumable: after a failure, do what it says and run it again. Models already on the box are reused, not downloaded again. tools/install/doctor.sh --profile jarvis-gb10 lists anything missing, with its fix.

A fresh install on DGX-01 (measured 2026-10-22):

PartMeasured
Downloads and builds31.5 min, 175.7 GB downloaded
Chat qualification on the GPU113 s
Drama 3 qualification on the GPU20.5 min
Image and video pack buildsnot yet timed end to end

What you get

WhereWhat
/voiceThe web app. A full-duplex voice conversation: barge-in, spoken picture requests, and a voice picker with previews
/v1OpenAI-compatible API: chat completions (whole or streamed, with tools), audio speech and transcriptions, images, videos, and the Realtime API at /v1/realtime
/mcpEvery tool over MCP: chat, synthesize_speech, transcribe_audio, generate_image, generate_video, list_models, list_voices, jobs. Setup for Claude Code, Codex, Cursor and any client: docs/MCP.md
bash
claude mcp add --transport http localrouter http://127.0.0.1:8190/mcp

Measured on a DGX Spark

DGX-01, NVIDIA GB10, 2026-10-22. Only figures we measured are listed.

WhatMeasured
Voice turn: end of speech to first audioabout 0.9 s median (916 to 959 ms across today's smoke runs); 0.72 to 0.95 s for the first turn after an image or a video
Drama 3: first audio0.14 s p50, 0.18 s p95. Real-time factor 0.68. From its GPU qualification
Chat: first content0.15 s for a short prompt, streamed
"Generate a picture of a dog", spokenpicture done 8.1 to 10.2 s after the end of speech; spoken confirmation 8.8 to 11.4 s
Image: Qwen-Image 2.1 Turbo, 1024x10246.3 s warm
Video: MiniMax H3, 768x448 with audioa 1 s clip in about 24 s; a 5 s clip in 54 s warm
Memory with chat, Drama 3, Whisper and the image model warm24 + 42 + 3.6 + 35.2 GiB resident; 13.7 GiB still available after a start, 11 to 12 GiB in use, of 121.7 GiB

A video job unloads only the image model while it runs, and the image model comes back after it. Chat, Drama 3 and Whisper are never unloaded for an image or a video.

Hardware

Needjarvis-gb10 (the tested profile)
BoxNVIDIA DGX Spark (GB10, aarch64): 128 GB unified memory, at least 110 GiB visible to the OS
SoftwareDGX OS / Ubuntu 24.04, NVIDIA driver 580 or newer, CUDA 13 (nvcc), Docker with the NVIDIA runtime (for the image and video packs), systemd user services
Diskabout 250 GiB free for a fresh install (216 GiB plus a 30 GiB margin). --dry-run prints the exact figure
NetworkHTTPS to huggingface.co, github.com, ziglang.org, pypi.org, download.pytorch.org and nvcr.io during the install

No other profile is tested yet. The chat and Drama 3 engines here are GB10 builds, and their qualification refuses other GPUs.

How it works

  • One door for every agent. Add one MCP server, or point any OpenAI client at /v1.
  • Memory is managed for you. Each model says what it needs before it loads. If it does not fit, idle models of lower priority give way. Kept-warm models (the voice set and chat) come back by themselves, and only with room to spare.
  • Correct. The image and video engines are LocalRouter's own, written in Zig with their own GPU kernels. They are verified operation by operation against a Python reference of each model, then from prompt to pixels and audio samples. Chat and Drama 3 are qualified on the box's own GPU before the service serves them.
  • Small. One Zig binary. Every loaded model is its own process, so unloading returns all of its memory and a crash costs one job.

Image and video only (Docker)

bash tools/spark/install.sh installs just the image and video models as a Docker service. The script's header documents it: MODELS, PRECISIONS (FP8 by default, NVFP4 optional), IMAGE_MODELS, and binding with LOCALROUTER_BIND=localhost|tailscale|all. Prebuilt Qwen-Image 2.1 packs are optional, from Hugging Face, for non-commercial research or evaluation only under the Qwen Research License.

Connect an agent

Any MCP client: {"mcpServers": {"localrouter": {"type": "http", "url": "http://<host>:8190/mcp"}}}. For clients that only speak stdio: localrouter mcp-stdio --url http://<host>:8190.

MCP toolDoes
list_models, list_voicesthe models (what each can do, default_for, state, memory) and the speech voices
reserve_for, unload_model, load_modelmake room for a heavy job (what it unloads comes back after it), unload or load one model; never the chat model. The procedure is a skill: skills/jarvis-model-manager
generate_imagetext to image. Waits up to wait_s, returns the PNGs inline and as links, or a job id; edit inputs are refused by the current engines
generate_videotext to video. Waits up to wait_s, then returns the MP4's link or a job id; image inputs are refused by the current engines
chata chat completion from the chat model: the reply's text (or its tool calls), then the whole completion. reasoning: false answers without thinking
synthesize_speech, transcribe_audiospeech as WAV (inline and a link) in any listed voice; the transcript of a URL, base64 audio or a file on the box
get_job, cancel_jobfollow or stop a long job
release_modelsunload everything now

Config snippets for every client, an example call for every tool and the security note are in docs/MCP.md. The HTTP API, field by field, is in docs/AGENTS.md, and an agent skill is in skill/localrouter.

Configuration

localrouter serve --config tools.json (the installer writes one):

json
{
  "reserve_bytes": 8589934592,
  "defaults": {"text_to_image": "qwen-image-2.1-turbo"},
  "tools": [
    {"id": "qwen-image-2.1-turbo", "kind": "image", "engine": "qwen_image_turbo", "weights": "/models/qwen-image-2.1",
     "priority": 10, "keep_loaded": true, "options": {"precision": "fp8s"}},
    {"id": "qwen-image-2.1", "kind": "image", "engine": "qwen_image", "weights": "/models/qwen-image-2.1",
     "priority": 5, "options": {"precision": "fp8s"}},
    {"id": "qwen-image-2.1-nvfp4", "kind": "image", "engine": "qwen_image", "weights": "/models/qwen-image-2.1",
     "priority": 10, "options": {"precision": "nvfp4"}},
    {"id": "minimax-h3", "kind": "video", "engine": "minimax_h3", "weights": "/models/minimax-h3",
     "idle_ttl_s": 30, "options": {"max_width": 768, "max_height": 448, "max_seconds": 5}}
  ]
}
KeyDefaultMeaning
host, port127.0.0.1, 8190where the API listens. host is an IP, localhost, all (0.0.0.0) or tailscale (this machine's tailnet IPv4); --host takes the same
data_dir/datajob inputs and outputs (jobs/) and worker logs (logs/<tool>.log)
reserve_bytes8 GiBmemory always left free for the OS and other services
budget_bytes0 (none)a cap on what loaded models and running jobs may use
keep_outputs_s86400how long outputs stay
defaultsnonethe model a request that names none gets, per capability: {"text_to_image": "qwen-image-2.1-turbo"}. Unset: the first model (in config order) that can do it. Each must name a configured model with that capability, or serve refuses to start. localrouter models and list_models show the result
gpu_locknonethe host's GPU lock file, the one GPU jobs outside LocalRouter take exclusively. LocalRouter holds it once, shared and without waiting, while any of its models is loaded, and releases it when none is; while someone else holds it nothing loads (503). LocalRouter's own models never take it: they are admitted by memory alone, so chat, speech and transcription stay loaded side by side
allow_private_urlsfalselet input image URLs (edits, image to video) name loopback, private and link-local hosts; by default they are refused, redirects are never followed, and only the daemon's own output URLs are fetched from the machine itself
tools[].engine / cmda compiled-in engine, or any program speaking the worker protocol
tools[].priority0 (chat: 100)higher is unloaded later when memory is needed
tools[].keep_loadedfalse (chat: true)load at start, never unload for idleness, reload as soon as the scheduler is idle (unloading idle tools of lower priority)
tools[].qualificationnonea file the model's qualify script writes on this machine. Until it exists and says "qualified": true the model is listed ("qualified": false in /v1/models) and refused with a 503 saying it is not GPU-qualified on this host
tools[].idle_ttl_s120unload after this long unused (0: right after each job)
tools[].capabilitiesfrom the enginetext_to_image, image_edit, text_to_video, image_to_video, text_to_speech, speech_to_text, chat_completion
tools[].engineqwen_image (Qwen-Image 2.1, 25 steps), qwen_image_turbo (Qwen-Image 2.1 Turbo, its checkpoint's 8 steps; other step counts are refused), minimax_h3, openai_server (a model's own OpenAI-compatible server run as the worker: chat), testpattern
tools[].optionsengine settings (precision: fp8s, the default, or nvfp4; max_side; default steps; the Qwen engines' dit: the DiT pack directory, default <precision> or turbo-<precision>)

There is no authentication: it listens on localhost unless you choose otherwise; use a private network or a tailnet (the Jarvis install puts tailscale serve HTTPS in front of it; --host tailscale binds the tailnet address) and never all on an untrusted network.

Build and test

Zig 0.17.0; ffmpeg for video output. The GPU engines need nvcc and an NVIDIA GPU (sm_120 / sm_121); without -Dnvcc the binary builds without embedded CUDA kernels, and the GPU-free test engine runs the tests. The model engines remain registered but cannot generate without their kernels.

bash
zig build                                    # zig-out/bin/localrouter
zig build test                               # unit + integration tests (a real daemon and real workers)
zig build integration-exe && zig-out/bin/integration-test   # the integration tests one at a time, each named as it runs
zig build -Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=121,120   # with the GPU engines
localrouter check selftest                   # a private daemon, one image and one video, no GPU

How it was built

The engines are ports, not wrappers. Each model was first reproduced in Python on the project's own kernels (the "twin", in tools/twin), measured against the reference implementation, then rewritten in Zig and gated against the twin: every operation alone and chained, then the whole generation, on the target GPU. The measured results and the milestones are in docs/dev.

Credits

LocalRouter stands on the work of these projects and teams:

  • TensorFold by Ash Hart. Its CUDA runtime, NVFP4 kernels and Python model implementations were the baselines our image and video engines were ported from and verified against. Its native server runs the chat model, and Drama 3 runs on it. Thank you, Ash; we expect to contribute parts of the Zig work back upstream.
  • Qwen (Alibaba): Qwen3.8 27B for chat, and Qwen-Image 2.1 and 2.1 Turbo for images.
  • z-lab: the DFlash2 speculative drafter for Qwen3.8 27B.
  • Fish Audio: Drama 3, the voice. Built with Fish Audio.
  • drama-tensorfold by plotarmordev (Apache-2.0), which ports Drama 3 to TensorFold.
  • OpenAI: Whisper large-v3-turbo, for speech to text.
  • Silero VAD: voice activity detection.
  • MiniMax: MiniMax H3, video with audio.
  • NVIDIA: the DGX Spark (GB10) and the NGC PyTorch container the packs are built in. The INT8 attention kernels are SageAttention's, as shipped in NVIDIA's comfy-kitchen.

The weights are downloaded from their publishers under their own licences. Check these terms before installing or using a model:

  • Qwen-Image 2.1 is restricted to non-commercial research or evaluation under its Research License.
  • MiniMax H3's Community License excludes the US, EU, UK and South Korea, and imposes downstream use conditions.
  • Fish Audio Drama 3's weights are under the Fish Audio Community License v1.0. It allows commercial use only under USD 500,000 annual revenue, and no Hosted Service (letting third parties generate speech through an API) without a separate licence from Fish Audio. So keep LocalRouter on loopback or your tailnet for it (details).

The Apache-2.0 licence below covers the software. See NOTICE.

License

Apache License 2.0. See LICENSE and NOTICE.

Installatie

TypingMind
{
  "mcpServers": {
    "localrouter": {
      "command": "localrouter",
      "args": [
        "mcp-stdio",
        "--url",
        "http://{{config.HOST}}:{{config.PORT}}"
      ],
      "env": {
        "HOST": "<HOST>",
        "PORT": "<PORT>"
      }
    }
  }
}

Gebruik Localrouter MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra Localrouter is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Je kunt MCP lokaal op je apparaat uitvoeren of verbinding maken met de URL van een externe MCP-server.

Optie 1: Gebruik de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg Localrouter toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van Localrouter.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "localrouter": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van Localrouter in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van Localrouter in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je Localrouter gebruiken om me hiermee te helpen?
Localrouter
Zeker. Ik heb het gelezen.
Dit vond ik met Localrouter.

Optie 2: Voeg een MCP-server-URL toe

Gebruik dit als Localrouter al extern wordt gehost of als je team één gedeelde connector wil die meerdere gebruikers kunnen gebruiken.

1

Open MCP-connectoren

Ga in TypingMind naar Plug-ins, open MCP-connectoren en kies URL toevoegen.

  1. Open TypingMind in je browser.
  2. Ga naar Plug-ins.
  3. Open MCP-connectoren.
  4. Klik op URL toevoegen.
TypingMind-formulier om een eigen MCP-server-URL toe te voegen
2

Plak de server-URL

Voer http://{{config.HOST}}:{{config.PORT}} in het veld Server-URL in. Voeg een verbindingsnaam, beschrijving, icoon, aangepaste HTTP-headers of OAuth-clientinstellingen toe als de server die vereist.

  1. Plak http://{{config.HOST}}:{{config.PORT}} in het veld Server-URL.
  2. Voer een verbindingsnaam in voor Localrouter.
  3. Voeg een beschrijving en een icoon toe om de verbinding makkelijker te herkennen.
  4. Voeg aangepaste HTTP-headers of OAuth-clientgegevens toe als de server authenticatie vereist.
3

Maak de verbinding

Klik op Verbinding maken, ga terug naar de lijst met plug-ins en controleer of de nieuwe MCP-verbinding actief is.

  1. Klik op Verbinding maken.
  2. Ga terug naar de lijst met MCP-connectoren.
  3. Controleer of de verbinding met Localrouter als actief wordt weergegeven.
  4. Vernieuw de lijst met plug-ins als de verbinding niet meteen verschijnt.
4

Wissel van model zonder opnieuw verbinding te maken

Start een chat met je favoriete model, schakel de tools van Localrouter in via Plug-ins en wissel van model wanneer dat nodig is. De MCP-verbinding blijft beschikbaar in de TypingMind-werkruimte.

  1. Start een nieuwe chat in TypingMind.
  2. Selecteer het AI-model dat je wilt gebruiken.
  3. Schakel de tools van Localrouter in via Plug-ins.
  4. Vraag het model om de tool te gebruiken wanneer dat nodig is.
  5. Schakel over naar een ander AI-model en gebruik dezelfde MCP-verbinding opnieuw.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je Localrouter gebruiken om me hiermee te helpen?
Localrouter
Zeker. Ik heb het gelezen.
Dit vond ik met Localrouter.

Veelgestelde vragen

Waarvoor wordt de MCP-server Localrouter gebruikt?

Localrouter is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik Localrouter MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je Localrouter gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom Localrouter MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als Localrouter verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik Localrouter MCP met TypingMind?

Je kunt Localrouter met TypingMind verbinden via de lokale MCP-connector of door de URL van een externe MCP-server toe te voegen. Gebruik de lokale connector als de server toegang nodig heeft tot bestanden, apps of privébronnen op je apparaat. Gebruik een server-URL als de MCP-server extern wordt gehost.

Welke tools biedt Localrouter MCP in TypingMind?

Localrouter biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om Localrouter MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als Localrouter authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇