Logotipo de Localrouter

Localrouter

Comunidad
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)

Editorjayleaton
Repositoriolocalrouter
IdiomaZig
Forks
5
Estrellas
50
Herramientas disponibles
0
Tipo de transportestdio, streamable-http
Categorías
LicenciaApache-2.0
Enlaces
  • Conecta herramientas a flujos de trabajo con IA

    Localrouter ofrece funciones MCP que pueden usar los clientes y agentes de IA compatibles.

  • 0 herramientas disponibles

    Explora a continuación las acciones que se pueden invocar, con sus nombres y descripciones cuando el servidor los proporcione.

  • Configuración lista para copiar

    Usa los ejemplos de instalación para configurar este servidor en tu cliente MCP preferido.

  • Indicadores de interés en el código abierto

    50 estrellas y 5 forks en el repositorio enlazado.

[!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.

Instalación

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

Usa el MCP de Localrouter con varios modelos de IA

TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que, una vez conectado Localrouter, puedes usarlo con distintos modelos de IA en TypingMind sin tener que configurarlo por separado para cada modelo. Puedes ejecutar MCP localmente en tu dispositivo o conectarte a la URL de un servidor MCP remoto.

Opción 1: Usa el conector local

Usa esta opción si el servidor MCP necesita acceder a archivos locales, aplicaciones o recursos privados de tu ordenador.

1

Abre los ajustes de MCP

En TypingMind, ve a Ajustes, luego a Ajustes avanzados y a Model Context Protocol, y elige Configurar conector.

  1. Abre TypingMind en tu navegador.
  2. Haz clic en el icono de Ajustes.
  3. Ve a Ajustes avanzados.
  4. Abre la sección Model Context Protocol.
  5. Haz clic en Configurar conector y elige Este dispositivo.
Pantalla de configuración del conector MCP de TypingMind con «Este dispositivo» seleccionado
2

Ejecuta el comando del conector

Elige Este dispositivo, copia el comando de TypingMind y ejecútalo en Terminal. Mantén el proceso en ejecución mientras uses MCP.

  1. Copia el comando de configuración que muestra TypingMind.
  2. Abre Terminal en macOS o Windows Terminal en Windows.
  3. Pega y ejecuta el comando.
  4. Acepta la instalación del paquete si Terminal te pide confirmación para continuar.
  5. Mantén el proceso en ejecución en la ventana de Terminal mientras uses las herramientas MCP.
3

Añade Localrouter como servidor

Cuando el estado del conector sea «Listo», haz clic en «Edita servidores» y pega la configuración del servidor MCP.

  1. Espera hasta que el estado del conector indique «Listo».
  2. Haz clic en Edita servidores.
  3. Pega la configuración del servidor MCP de Localrouter.
  4. Guarda la lista de servidores.
  5. Actualiza para comprobar que el conector sigue listo.
Ajustes de MCP de TypingMind con un servidor activo y el botón «Edita servidores»
{
  "mcpServers": {
    "localrouter": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Úsala con distintos modelos

Guarda la lista de servidores, abre Plugins, activa las herramientas MCP de Localrouter y selecciona cualquier modelo de IA compatible en TypingMind para usar las herramientas en el chat o asignárselas a un agente de IA.

  1. Abre la página Plugins en TypingMind.
  2. Activa las herramientas MCP de Localrouter.
  3. Inicia un chat y elige el modelo de IA que quieras usar.
  4. Usa las herramientas MCP en el chat o asígnalas a un agente de IA.
  5. Cambia a otro modelo de IA cuando lo necesites sin volver a conectar MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar Localrouter para ayudarme con esta tarea?
Localrouter
Claro. Lo he leído.
Esto he encontrado usando Localrouter.

Opción 2: Añade la URL de un servidor MCP

Usa esta opción si Localrouter ya está alojado en un servidor remoto o si tu equipo quiere un conector compartido al que puedan acceder varios usuarios.

1

Abre Conectores MCP

En TypingMind, ve a Plugins, abre Conectores MCP y elige Añadir URL.

  1. Abre TypingMind en tu navegador.
  2. Ve a Plugins.
  3. Abre Conectores MCP.
  4. Haz clic en Añadir URL.
Formulario de TypingMind para añadir la URL de un servidor MCP personalizado
2

Pega la URL del servidor

Introduce http://{{config.HOST}}:{{config.PORT}} en el campo URL del servidor. Añade un nombre de conexión, una descripción, un icono, cabeceras HTTP personalizadas o la configuración del cliente OAuth si el servidor los requiere.

  1. Pega http://{{config.HOST}}:{{config.PORT}} en el campo URL del servidor.
  2. Introduce un nombre para la conexión de Localrouter.
  3. Añade una descripción y un icono si quieres que sea más fácil de identificar.
  4. Añade cabeceras HTTP personalizadas o los datos del cliente OAuth si el servidor requiere autenticación.
3

Crea la conexión

Haz clic en Crear conexión, vuelve a la lista de plugins y comprueba que la nueva conexión MCP esté activa.

  1. Haz clic en Crear conexión.
  2. Vuelve a la lista de conectores MCP.
  3. Comprueba que la conexión de Localrouter aparezca como activa.
  4. Actualiza la lista de plugins si la conexión no aparece de inmediato.
4

Cambia de modelo sin volver a conectar

Inicia un chat con tu modelo preferido, activa las herramientas de Localrouter desde Plugins y cambia de modelo cuando lo necesites. La conexión MCP seguirá disponible en el espacio de trabajo de TypingMind.

  1. Inicia un nuevo chat en TypingMind.
  2. Selecciona el modelo de IA que quieras usar.
  3. Activa las herramientas de Localrouter desde Plugins.
  4. Pide al modelo que use la herramienta cuando sea necesario.
  5. Cambia a otro modelo de IA y reutiliza la misma conexión MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar Localrouter para ayudarme con esta tarea?
Localrouter
Claro. Lo he leído.
Esto he encontrado usando Localrouter.

Preguntas frecuentes

¿Para qué sirve el servidor MCP Localrouter?

Localrouter es un servidor MCP que permite a los clientes de IA compatibles conectarse a herramientas y contexto externos. En TypingMind, basta con añadir este servidor MCP una vez para que sus herramientas estén disponibles en tu espacio de trabajo de IA.

¿Puedo usar el servidor MCP Localrouter con varios modelos de IA en TypingMind?

Sí. TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que puedes usar Localrouter con distintos modelos de IA, como Claude, ChatGPT, Gemini u otros que hayas configurado en TypingMind, sin configurar el servidor MCP por separado para cada modelo.

¿Por qué usar el conector MCP de Localrouter con TypingMind?

TypingMind es una de las mejores interfaces de chat con LLM porque reúne varios modelos de IA, prompts, plugins, agentes de IA, claves de API y herramientas MCP en un solo espacio de trabajo. Con Localrouter conectado, puedes usar sus herramientas MCP con tus modelos preferidos y mantener organizado tu flujo de trabajo de chat en TypingMind.

¿Cómo conecto el servidor MCP Localrouter a TypingMind?

Puedes conectar Localrouter en TypingMind con el conector MCP local o añadiendo la URL de un servidor MCP remoto. Usa el conector local cuando el servidor necesite acceder a archivos, aplicaciones o recursos privados de tu dispositivo, y una URL de servidor cuando el servidor MCP esté alojado de forma remota.

¿Qué herramientas ofrece el servidor MCP Localrouter en TypingMind?

Localrouter ofrece funciones MCP que puedes activar desde la página Plugins de TypingMind y usar en el chat o asignar a agentes de IA.

¿Tengo que compartir mis claves de API con TypingMind para usar el servidor MCP Localrouter?

No. TypingMind prioriza el funcionamiento local y te permite mantener el control de tus proveedores de modelos, claves de API, prompts y configuración MCP. Si Localrouter requiere autenticación, añade las cabeceras, los ajustes de OAuth o la configuración local necesarios para ese servidor MCP al crear la conexión.

Servidores MCP relacionados

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇