Логотип Localrouter

Localrouter

Сообщество
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)

Издательjayleaton
Репозиторийlocalrouter
ЯзыкZig
Форки
5
Звёзды
50
Доступные инструменты
0
Тип транспортаstdio, streamable-http
Категории
ЛицензияApache-2.0
Ссылки
  • Подключайте инструменты к рабочим процессам с ИИ

    Localrouter предоставляет возможности MCP, доступные совместимым ИИ-клиентам и агентам.

  • Доступные инструменты: 0

    Ниже представлены доступные для вызова действия с названиями и описаниями, если сервер их предоставляет.

  • Готовая конфигурация для копирования

    Используйте примеры конфигурации, чтобы настроить этот сервер в предпочитаемом MCP-клиенте.

  • Показатели интереса к открытому проекту

    Звёзды: 50, форки: 5 — в связанном репозитории.

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

Установка

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

Используйте MCP Localrouter с разными ИИ-моделями

TypingMind подключает инструменты MCP на уровне рабочего пространства, поэтому после подключения Localrouter вы можете использовать их с разными моделями ИИ в TypingMind, не настраивая подключение отдельно для каждой модели. Вы можете запустить MCP локально на своём устройстве или подключиться к удалённому серверу MCP по URL.

Вариант 1: используйте локальный коннектор

Выберите этот способ, если серверу MCP нужен доступ к локальным файлам, приложениям или закрытым ресурсам на вашем компьютере.

1

Откройте настройки MCP

В TypingMind откройте «Настройки», затем «Расширенные настройки», перейдите в раздел «Протокол контекста модели» и выберите «Настроить коннектор».

  1. Откройте TypingMind в браузере.
  2. Нажмите значок настроек.
  3. Перейдите в «Расширенные настройки».
  4. Откройте раздел «Протокол контекста модели».
  5. Нажмите «Настроить коннектор» и выберите «Это устройство».
Экран настройки коннектора MCP в TypingMind с выбранным вариантом «Это устройство»
2

Выполните команду коннектора

Выберите «Это устройство», скопируйте команду из TypingMind и выполните её в терминале. Не останавливайте процесс, пока используете MCP.

  1. Скопируйте команду настройки, показанную в TypingMind.
  2. Откройте «Терминал» в macOS или Windows Terminal в Windows.
  3. Вставьте и выполните команду.
  4. Подтвердите установку пакета, если терминал запросит разрешение продолжить.
  5. Не закрывайте окно терминала и не останавливайте процесс, пока используете инструменты MCP.
3

Добавьте Localrouter как сервер

Когда статус коннектора сменится на «Готов», нажмите «Изменить серверы» и вставьте конфигурацию сервера MCP.

  1. Дождитесь, пока статус коннектора сменится на «Готов».
  2. Нажмите «Изменить серверы».
  3. Вставьте конфигурацию сервера MCP для Localrouter.
  4. Сохраните список серверов.
  5. Обновите статус, если хотите убедиться, что коннектор по-прежнему готов к работе.
Настройки MCP в TypingMind с активным сервером и кнопкой «Изменить серверы»
{
  "mcpServers": {
    "localrouter": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Используйте подключение с разными моделями

Сохраните список серверов, откройте раздел «Плагины», включите инструменты MCP для Localrouter, затем выберите любую поддерживаемую модель ИИ в TypingMind и используйте инструменты в чате или назначьте их ИИ-агенту.

  1. Откройте страницу «Плагины» в TypingMind.
  2. Включите инструменты MCP для Localrouter.
  3. Начните чат и выберите модель ИИ, которую хотите использовать.
  4. Используйте инструменты MCP в чате или назначьте их ИИ-агенту.
  5. При необходимости переключайтесь на другую модель ИИ без повторного подключения MCP.
Чат TypingMind с включёнными инструментами MCP и выбранной ИИ-моделью
Можете помочь мне с этой задачей с помощью Localrouter?
Localrouter
Конечно. Я всё прочитал.
Вот что я нашёл с помощью Localrouter.

Вариант 2: добавьте URL сервера MCP

Выберите этот способ, если Localrouter уже размещён на удалённом сервере или вашей команде нужен общий коннектор для нескольких пользователей.

1

Откройте коннекторы MCP

В TypingMind перейдите в раздел «Плагины», откройте «Коннекторы MCP» и выберите «Добавить URL».

  1. Откройте TypingMind в браузере.
  2. Перейдите в раздел «Плагины».
  3. Откройте раздел «Коннекторы MCP».
  4. Нажмите «Добавить URL».
Форма «Добавить URL своего сервера MCP» в TypingMind
2

Вставьте URL сервера

Введите http://{{config.HOST}}:{{config.PORT}} в поле «URL сервера». Добавьте название подключения, описание, значок, пользовательские HTTP-заголовки или настройки клиента OAuth, если они требуются серверу.

  1. Вставьте http://{{config.HOST}}:{{config.PORT}} в поле «URL сервера».
  2. Введите название подключения для Localrouter.
  3. Добавьте описание и значок, чтобы подключение было проще узнать.
  4. Добавьте пользовательские HTTP-заголовки или данные клиента OAuth, если сервер требует аутентификации.
3

Создайте подключение

Нажмите «Создать подключение», затем вернитесь к списку плагинов и убедитесь, что новое подключение MCP активно.

  1. Нажмите «Создать подключение».
  2. Вернитесь к списку коннекторов MCP.
  3. Убедитесь, что подключение Localrouter отображается как активное.
  4. Обновите список плагинов, если подключение не появится сразу.
4

Переключайте модели без повторного подключения

Начните чат с предпочитаемой моделью, включите инструменты Localrouter в разделе «Плагины» и при необходимости переключитесь на другую модель. Подключение MCP останется доступным в рабочем пространстве TypingMind.

  1. Начните новый чат в TypingMind.
  2. Выберите модель ИИ, которую хотите использовать.
  3. Включите инструменты Localrouter в разделе «Плагины».
  4. При необходимости попросите модель использовать инструмент.
  5. Переключитесь на другую модель ИИ и используйте то же подключение MCP.
Чат TypingMind с включёнными инструментами MCP и выбранной ИИ-моделью
Можете помочь мне с этой задачей с помощью Localrouter?
Localrouter
Конечно. Я всё прочитал.
Вот что я нашёл с помощью Localrouter.

Часто задаваемые вопросы

Для чего используется сервер MCP Localrouter?

Localrouter — это сервер MCP, который позволяет совместимым ИИ-клиентам подключаться к внешним инструментам и получать контекст. В TypingMind достаточно один раз добавить этот сервер MCP, чтобы его инструменты стали доступны в вашем рабочем пространстве с ИИ.

Можно ли использовать сервер MCP Localrouter с несколькими ИИ-моделями в TypingMind?

Да. TypingMind подключает инструменты MCP на уровне рабочего пространства, поэтому вы можете использовать Localrouter с разными ИИ-моделями, например Claude, ChatGPT, Gemini или другими моделями, настроенными в TypingMind, без отдельной настройки сервера MCP для каждой модели.

Зачем использовать MCP Localrouter с TypingMind?

TypingMind — один из лучших интерфейсов для чата с LLM: он объединяет разные ИИ-модели, промпты, плагины, ИИ-агентов, ключи API и инструменты MCP в одном рабочем пространстве. Подключив Localrouter, вы сможете использовать его инструменты MCP с предпочитаемыми моделями, сохраняя удобную организацию работы с чатами в TypingMind.

Как подключить сервер MCP Localrouter к TypingMind?

Localrouter можно подключить к TypingMind через локальный коннектор MCP или добавив URL удалённого сервера MCP. Используйте локальный коннектор, если серверу нужен доступ к файлам, приложениям или закрытым ресурсам на вашем устройстве, и URL сервера, если сервер MCP размещён удалённо.

Какие инструменты предоставляет сервер MCP Localrouter в TypingMind?

Localrouter предоставляет возможности MCP, которые можно включить на странице «Плагины» в TypingMind и использовать в чате или назначить ИИ-агентам.

Нужно ли передавать TypingMind свои ключи API для использования сервера MCP Localrouter?

Нет. TypingMind ориентирован прежде всего на локальную работу и позволяет вам контролировать выбор провайдеров моделей, ключи API, промпты и конфигурацию MCP. Если Localrouter требует аутентификации, при создании подключения добавьте необходимые заголовки, настройки OAuth или локальную конфигурацию для этого сервера MCP.

Похожие серверы MCP

Все

Создайте свою рабочую ИИ-среду сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇