Back to Browse

Local Delegate MCP Server

Developer Tools5.2Moderate riskLocal
Free

Delegate mechanical text tasks to a local OpenAI-compatible LLM to save Claude quota.

About

Delegate mechanical text tasks to a local OpenAI-compatible LLM to save Claude quota.

At a glance

Runs
On your computer, from the PyPI package local-delegate-mcp, which we verified belongs to this listing.
Works with
Claude Desktop, Claude Code, Grok Build (formerly Cursor), Windsurf, VS Code, Codex, Antigravity CLI, Gemini CLI, ChatGPT.
Can access
  • Connects to services on the internet
  • Reads files on your computer
  • Writes or changes files on your computer

Security report

How we score
5.2out of 10Moderate riskMCP Marketplace security score

Serious: Uses an outdated component (mcp) with a known security hole

local-delegate is a Python MCP server that forwards text tasks to a user-configured OpenAI-compatible local LLM endpoint, with clearly documented scope and a pinned set of dependencies with major-version ceilings. The visible code shows no data exfiltration, hardcoded credentials, or unsanitized shell execution, and its network access (to the local backend, optionally a tailnet peer) matches its purpose. Only minor concerns were observed in the truncated portions, notably a remote-backend feature that forwards operations to another daemon and some Windows process/handle management that warrants review. Supply chain analysis found 15 known vulnerabilities in dependencies (0 critical, 2 high severity). Package verification found 1 issue.

Claude reviewed an earlier version of this code on Nov 29, 2026. The code has changed since then.

4 files analyzed · 19 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

File System Read

Reads files on your machine. Normal for tools that analyze or process local data.

File System Write

Writes or modifies files on your machine. Check that this is expected for the tool.

HTTP Network Access

Connects to external APIs or services over the internet.

env_vars

Check that this permission is expected for this type of plugin.

process_spawn

Check that this permission is expected for this type of plugin.

system_info

Check that this permission is expected for this type of plugin.

database

Check that this permission is expected for this type of plugin.

What You'll Need

Set these up before or after installing:

OpenAI-compatible endpoint (llama-swap, Ollama, LM Studio, vLLM). Default http://127.0.0.1:9292/v1Optional

Environment variable: LOCAL_DELEGATE_BASE_URL

Bearer token for the endpoint, if it requires one.Required

Environment variable: LOCAL_DELEGATE_API_KEY

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "local-delegate-mcp": {
      "command": "uvx",
      "args": [
        "local-delegate-mcp==0.57.3"
      ],
      "env": {
        "LOCAL_DELEGATE_API_KEY": "your-local-delegate-api-key-here",
        "LOCAL_DELEGATE_BASE_URL": "your-local-delegate-base-url-here"
      }
    }
  }
}

Some servers take additional arguments. See the repository for details.

Documentation

View on GitHub

From the project's GitHub README.

English · Español

local-delegate

Delegate the mechanical steps of your coding agent to models on your own GPU, and keep your subscription quota for the hard parts. An MCP server (stdio or a shared HTTP daemon) that is a generic client for any OpenAI-compatible endpoint — llama-swap, Ollama, LM Studio, vLLM.

PyPI CI License: MIT local-delegate MCP server

zahirinatzuke.github.io/local-delegate — what it does and why, on one page (es/en). Its source is in site/.

Demo

Embedded dashboard (sample data): local backend status (loaded models, delegation in progress with its per-chunk progress, MCP tools), system RAM/VRAM with per-process usage, context tokens preserved, savings by tool and model, where the compute ran —this machine or a remote backend— and paginated recent activity in your local time. Served at http://127.0.0.1:9393.

Figures and method

Every figure says where it comes from; none is a savings promise for your case.

FigureMethod and source
27 of 30 commit messages preferred blind with Inkling 2 Mini, against 2 with Gemma 4 26B (1 tie)33 cases per model (30 real and 3 traps); blind sheet judged by an agent with no access to the key or the results; the control trap did not win. benchmarks/commits-2026-11/verdict.md, 2026-11-30.
10 of 11 correct code explanations with Inkling 2 Mini, against 3 of 11 with Qwen3.6 35BMeasured on 2026-11-29 with llama.cpp b12845; it is about 4 times slower when explaining (~38 s against ~9 s). The entry for the code role change in the CHANGELOG.
Context preserved, the one your dashboard showsCharacters read by the server (source=path, successful calls) minus what was returned, converted to Claude tokens with a density table per tokenizer and content type. Full method in “The savings metric”, below.

We do not publish an “X % less quota” figure yet: the control measurement with a clean install is pending and, until it runs, there is no honest number to give. The demo dashboard figures are sample data, not a measurement.

Why?

When Claude has to summarize a huge log, classify, extract fields or generate boilerplate, it spends your subscription quota on mechanical work. local-delegate exposes those tasks as MCP tools that run on a local LLM: you pass path instead of text and the file is read on the server side, so the large content never enters Claude's context. Only the short result comes back: the document neither fills your context window nor is processed by Claude.

Quick install

With uv there is nothing to install: uvx downloads and runs the package in isolation.

Add it to your MCP config (Claude Desktop / Claude Code) in the compatible stdio mode:

{
  "mcpServers": {
    "local-delegate": {
      "command": "uvx",
      "args": ["local-delegate-mcp"]
    }
  }
}

See complete templates in examples/.

Or let the package configure everything for you —MCP entry, hooks, skill and the delegation rule in your global CLAUDE.md/AGENTS.md— with a single command:

uv tool install local-delegate-mcp          # leaves `local-delegate` on the PATH
local-delegate install --dry-run            # shows exactly what it would touch
local-delegate install                      # applies

uvx local-delegate-mcp install also works to try it without installing anything, but note that uvx does not leave the command available: it builds an ephemeral environment and deletes it when it finishes, so local-delegate doctor will answer “command not found” afterwards. install itself warns you if it detects that case.

It is idempotent, leaves a .bak of what it edits (the first time it touches it; it does not overwrite it afterwards), does not touch other people's configuration and is reverted with local-delegate uninstall. Since 0.44.0 it writes atomically, reapplies its change if Claude Code saves the file at the same time, and if a file is not UTF-8 (cp1252, UTF-16) the action fails without touching it. Details and options in Integration install.

Want Tab completion of subcommands, options and values? local-delegate install --shell-completion loads it into your PowerShell, zsh or bash profile (opt-in, reversible with uninstall --shell-completion), and local-delegate completion powershell|zsh|bash prints the script in case you prefer to load it yourself. See Shell autocompletion.

If you use several sessions or several clients on the same machine, a single daemon is recommended:

uvx local-delegate-mcp serve

The daemon serves MCP at http://127.0.0.1:9393/mcp and the dashboard at http://127.0.0.1:9393/. Codex, Claude Code, opencode and any Streamable HTTP-compatible client can share that URL without starting duplicate MCP processes. With a local llama-swap, the [llamaswap] extra and LLAMASWAP_CONFIG pointing at its config.yaml, the daemon also hands out the backend by turns: two delegations whose models would evict each other do not step on each other, and the second waits (the dashboard shows it as a local wait). Full guide: Shared daemon.

A delegation can add turn waiting and inference, and some clients cut earlier: Codex cuts any MCP tool call at 60 s (tool_timeout_sec in [mcp_servers.local-delegate] of config.toml raises it, and it has to be restored after each install/update, which rewrite that block) and Claude Code cuts an HTTP call after 5 min without a response (the CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT variable, in ms, raises it and survives install). Details in Integration install.

To use another machine's GPU while keeping the client's local paths, use a local MCP that points at the remote backend: Mac → PC guide and the full technical recipe. The operations of both machines form a single queue: the one that does not have the backend asks the other's daemon for a turn, with the same backend key and only toward a private host (the tailnet), and if that daemon is not available it goes on without a turn, as before (common PC+Mac turn).

Do not pin an old version “for stability”. A pin (==X.Y.Z) also freezes the dependency ranges that wheel declared, and that ages badly: versions before 0.12.2 asked for mcp with no ceiling, so today they resolve to SDK 2.x and die on import. If you need to pin, pin the current one, and bump it when a new one comes out.

On Windows, if you register it as a task at logon, run the pythonw.exe of the environment where you installed the package with -m local_delegate serve --log-level warning. pythonw creates no console and no taskbar button. The task belongs to the Windows user, not to Codex or Claude: any local client shares the same daemon. The dashboard identifies that single process with the MCP DAEMON badge; connected sessions are HTTP clients, not additional MCP processes.

When updating on Windows, stop the daemon before uv tool install --force. With the daemon running, the reinstall can fail halfway (it has files of the environment open) and leave it broken; schtasks /End is not enough because the launcher is detached, so stop the daemon's pythonw process, install and launch it again. Afterwards, local-delegate update restores hooks, skill and the CLAUDE.md/AGENTS.md block if they were left out of date.

If you installed with a pinned version (uv tool install "local-delegate-mcp==X.Y.Z"), uv tool upgrade says “Nothing to upgrade” and upgrades nothing: reinstall with uv tool install "local-delegate-mcp[llamaswap]@latest" (with your extras). Since 0.45.1, local-delegate update and doctor detect it and give that command.

0.36.0 speaks Spanish or English and follows the system language. With the system in English you will start seeing English: to stay in Spanish, LOCAL_DELEGATE_LANG=es local-delegate install (or update). The _local_delegate keys and the tools' markers become English (breaking change); the table is in the CHANGELOG and in Language.

0.35.0 renames commands, variables, the skill and data files to English. The old names worked with a warning since 0.35.0 and were removed in 0.38.0: they no longer have any effect. local-delegate doctor names those still set (up to 0.40.x) and local-delegate update migrates the ones it can. Going back to an earlier version is not supported. The full table is in the CHANGELOG.

Requirements

Python 3.11+ — with uvx you do not have to install it yourself, it resolves it; it only matters if you install with pip in an environment of your own.

And an OpenAI-compatible endpoint already running, reachable at LOCAL_DELEGATE_BASE_URL (default http://127.0.0.1:9292/v1). Any of these works:

  • llama-swap — see the recipe with a Blackwell GPU.
  • Ollama — http://127.0.0.1:11434/v1.
  • LM Studio, vLLM, or any server that speaks the OpenAI API.

The package does not start any backend by default (LOCAL_DELEGATE_AUTOSTART=0). Auto-starting llama-swap is opt-in (see the configuration table).

Which versions of llama-server/llama-swap to use and how to lay out the workspace? See Backend versions and reference workspace (a tested suggestion, not a requirement). local-delegate doctor compares your installation against those versions and, along the way, checks the rest of the scaffolding —hooks, skill, memory, MCP entries, the daemon, that each role's model is in the backend's list and, in Codex, the hooks and the plugin— without writing anything (what each check looks at).

Tools

Passing path (instead of text) makes the MCP read the file server-side: the content does not enter Claude's context, and that is where the savings come from. A file that is not UTF-8 (UTF-16 with BOM, Windows-1252) is read without losing characters and the response says so.

ToolWhat it doesModel role (default)
local_summarizeSummarizes text or a file; optional focus to say what to keep (e.g. “configuration figures”); warns if the summary carries acronyms, words or figures that the input does not havemechanical / long (auto; a small input with a table goes to long)
local_classifyReturns ONE label from a listmechanical
local_extractExtracts fields → a validated object with exactly the requested keys (missing ones, or ones that come back as “N/A”, are null), not a string you have to parse; each field with its type (a list never comes back as a boolean; what does not fit gets one retry and, if it stays the same, goes into type_mismatch_keys); with path, a field that asks for lines comes back as a list of {name, start, end} computed by the program, never by the model (index of Python, TS/JS, Markdown, diff and ids; or a literal chunk that the program looks up exactly), with located and unlocated; a small input with a table (HTML, ARIA, Markdown/GFM, CSV or TSV) goes to the long model and _local_delegate.role_reason says so with its format; if a key's value comes from the row of another requested key, it warns in cross_filled_keys, and if it flips a negation of the input, in polarity_flipped_keysmechanical / long (auto; also with a table; code or long input with a line field that needs a model)
local_boilerplateGenerates code from a spec and writes it to target; returns only a receiptcode
local_delegateGeneric text→text escape hatchmechanical (or the one you pass)
local_lint_summarySummarizes lint/test/CI logs; with pytest it starts from the real failures in the log and warns if the summary does not match themmechanical / long (auto)
local_commit_msgCommit message from a diff; with path it takes the repo's language and warns if it could not; with an enormous diff it finishes in time with what was read and says so; chunked, it warns and lists the changed conditions so you can review itcode
local_translateTranslates text or a filemechanical / long (auto)
local_explain_codeExplains code in prose; with path and a question it warns about doubtful cited lines and about a premise the code does not support, even if the answer places it next to real codecode
local_describe_imageDescribes an image or answers a question about it (image→text); it does not measure alignment, sizes or line breaks, and warns when the question or the answer talk about thatvision
local_statusRead-only diagnostics: backend, catalog, log, VRAM, system RAM— (does not call the chat backend)

Local models do not use tool-calling: the server assembles the prompt + guardrails, POSTs to the endpoint and returns only text.

Long documents. local_translate (and local_delegate with long inputs) splits the text at natural boundaries —Markdown headers, paragraphs, lines— and processes one chunk per call respecting the max_tokens ceiling, concatenating the outputs in order and keeping the format at the seams. A document of 20 000+ characters comes back complete instead of cut off halfway. The log records chunks: N and the dashboard shows the progress (chunk 3/7) while it runs. Since 0.43.0, “In progress” also says the phase: “Combining 3 chunks…” while the partials are being joined and “Retrying chunk n/total” when a truncated chunk is split again; and activity separates chunks from backend calls (3 +1: three chunks and one combination). Since 0.47.2 that case says “Splitting chunk n/total” and, as soon as the parts are known, how far the split has got without moving the total number of chunks: “Chunk 3/4 · split into 3 · part 2” in the dashboard and 3/4 · split into 3 · part 2 in the band.

Long calls and queues. Since 0.45.0 each live call sends MCP progress every 20 s with its phase (“waiting for turn, position N”, “processing chunk k/N”), so Claude Code no longer cuts at 300 s a delegation that is waiting in the queue. The daemon gives each call its own deadline (LOCAL_DELEGATE_CALL_MAX_S, 1800 s) and, if the queue has gone 900 s without progress, fails at once with “queue saturated” instead of leaving the client hanging. Aborted delegations stay in the log as errors, “In progress” separates “Processing (n)” from “In queue (m)”, and each log entry says which machine it came from (host) and how long it waited in each phase (concurrency). Since 0.46.0 a long chunked delegation hands the turn over between chunks to the one that collides with it (LOCAL_DELEGATE_TURN_YIELD_S, 120 s), “In progress” groups under “Waiting for backend” the call that is waiting for llama-swap to switch models, and a read_timeout names the model that was blocking it. Since 0.47.0 that wait is shown as such even while the chunk is being split (it used to show as “retrying”; since 0.47.2, “splitting”).

Bursts that mix models. The turn serves in arrival order, so a burst that alternates tools of models that do not fit together (summarize and explain code, for example) forces a model switch at each handover, and the last one can wait minutes without the model being slow. Claude Code sends to the background a call that has taken 2 min and the result arrives all the same. If the turn wait passes LOCAL_DELEGATE_TURN_WAIT_NOTICE_S (60 s), the response carries a notice saying how long it waited. Grouping the calls by tool (all the summaries first, then all the code) reduces it.

Summaries of huge documents. local_summarize and local_lint_summary do map-reduce when the input does not fit in the model: they summarize each part and then summarize the summaries, level by level if needed. They used to truncate —with a huge CI log, the beginning was summarized and the rest silently discarded, which is exactly where the errors usually are— and now the whole thing is read. If a chunk is cut off by max_tokens, the result says so and the log records finish_reason: length. Since 0.43.0, a cut-off partial is no longer accepted as good: it is discarded, the chunk (or the regrouped batch) is split and retried, up to two levels; if any is still cut off, the notice says which chunk and which lines. Since 0.47.0, the regrouped batch does not repeat rounds without progress: if a round does not reduce the material by at least 20 % and the notes still do not fit in the final step, it stops and returns the grouped notes with a notice, marked as truncated (finish_reason: length, truncated_out). And a unified diff is summarized in prose, never “by sections”. Since 0.36.1, with a log that does not fit in one call, local_lint_summary only feeds in the ten most named files (and says how many more there are), and the figures of the final summary are put in by the program, not the model. Since 0.36.0, local_commit_msg, local_explain_code (by top-level def/class, with the name inventory in the final step) and local_extract (a partial object per chunk and a final step with a schema that combines them) also read the whole input. Since 0.44.2, if after chunking a local_extract field is null in every chunk, _local_delegate.chunked says so (pieces, null_fields, notice): that null means “not seen”, not “does not exist”. Since 0.47.0, local_explain_code with question carries the question to each chunk and, with path, at the end checks the lines it cites against the file (warns about the doubtful ones) and adds the exact occurrences of each identifier in the question.

Configuration

Everything through environment variables; nothing hardcoded. The default model ids are just that — swap them for those of your backend.

VariableDefaultDescription
LOCAL_DELEGATE_BASE_URLhttp://127.0.0.1:9292/v1OpenAI-compatible endpoint
LOCAL_DELEGATE_API_KEY(empty)Bearer token, if your endpoint requires one
LOCAL_DELEGATE_BACKEND_ORIGINautolocal/remote force the compute origin; auto infers it from the host. Set it if you reach the backend through a tunnel (ssh -L, port-forward): on loopback it would look local
LOCAL_DELEGATE_TIMEOUT180HTTP timeout (seconds)
LOCAL_DELEGATE_MAX_CONCURRENT_REQUESTS2Maximum backpressure per process; shared by every daemon client
LOCAL_DELEGATE_ASK1Ask the user (via elicitation) instead of failing silently: backend down, model outside the catalog, empty output_format. 0 disables it
LOCAL_DELEGATE_ASK_TIMEOUT30Seconds to wait for an answer; once exhausted, the tool proceeds as if it had not asked
LOCAL_DELEGATE_LOG_DIR(user data dir)Directory of the monthly-rotated usage-YYYYMM.jsonl and clients.jsonl, and of project-salt, project-names.json and self-projects.json. The daemon, hooks and scripts must resolve the same one: if you set it in the launcher and not in the daemon, or the other way round, the salt and the name map differ between rows and events
LOCAL_DELEGATE_LOG(empty = rotation active)If set, path of an explicit non-rotated usage.jsonl (compatibility)
LOCAL_DELEGATE_MACHINE_NAME(short machine name)Name of this machine in the usage log (host) and in the X-Local-Delegate-Host header sent to the backend; useful if two machines are named the same
LOCAL_DELEGATE_MODEL_MECHANICALgemma3-4bModel for classify/extract/short summary
LOCAL_DELEGATE_MODEL_LONGqwen38-27b (fallback: gemma4-26b-a4b)Model for long documents
LOCAL_DELEGATE_MODEL_CODEinkling2-miniModel for code: Inkling 2 Mini, which always reasons (llama.cpp ≥ b12828, ~10 GB RAM and ~13 GB peak VRAM). It carries its own reasoning values (origin model in backend-params show). Without that entry in your catalog, the previous one: LOCAL_DELEGATE_MODEL_CODE=qwen36-35b-a3b; doctor suggests it if your backend serves it
LOCAL_DELEGATE_MODEL_VISIONqwen36-35b-a3b-visionVision model for local_describe_image: Qwen3.6 35B-A3B with --mmproj (~14 GB RAM, ~11 GB VRAM). With less VRAM or without that entry in your catalog, the light alternative: LOCAL_DELEGATE_MODEL_VISION=gemma4-12b
LOCAL_DELEGATE_MAX_IMAGE_MB8Image size cap for local_describe_image
LOCAL_DELEGATE_DUMP_CHUNK_NOTES(empty: off)Local folder where each chunked operation leaves the output of each step; for measurement only, it never leaves the machine
LOCAL_DELEGATE_LONG_INPUT_CHARS6000Mechanical↔long threshold
LOCAL_DELEGATE_EXTRACT_TABLE_LONG1local_extract sends to the long model an input below the threshold that contains a table (HTML, ARIA, Markdown/GFM, CSV or TSV), and says so in role_reason (response, with the format, and log). It takes longer and can load the model; 0 disables it
LOCAL_DELEGATE_SUMMARIZE_TABLE_LONG1The same rule for local_summarize: the summary ends with a notice naming the format and the log row carries role_reason; 0 disables it
LOCAL_DELEGATE_CHUNK_CHARS3500Chunk size when splitting long documents (local_translate, local_delegate)
LOCAL_DELEGATE_CHUNK_MAX_TOKENS2048max_tokens ceiling per chunk
LOCAL_DELEGATE_CHUNK_MIN_CHARS400Minimum chunk: below it, it is not split again
LOCAL_DELEGATE_JSON_SCHEMAautoresponse_format with schema in local_extract: auto/on/off
LOCAL_DELEGATE_FEEDBACK1Savings line appended to the result when source=path (0 disables it). In local_extract it is not appended to the text —it would break the JSON—: it goes inside _local_delegate
LOCAL_DELEGATE_ALLOWED_DIRS(empty = no additional restriction)Allowed roots for path and target, separated by ;. Protected paths (credentials, autostart, configuration that executes code) are always rejected, with or without this variable: see Configuration
LOCAL_DELEGATE_DENY_PATHS(empty)Extra paths, separated by ;, that the tools neither read nor write; they are added to the protected list
LOCAL_DELEGATE_WEB1Web embedded in stdio mode (0 to disable it). Since 0.42.0 it asks for the LOCAL_DELEGATE_WEB_TOKEN token if set, like the daemon
LOCAL_DELEGATE_WEB_HOST / _PORT127.0.0.1 / 9393Host/port of the web or the daemon. Empty counts as unset
LOCAL_DELEGATE_WEB_ALLOWED_HOSTS(empty)Extra names the port accepts in the Host header, comma-separated (e.g. the one from tailscale serve). By default only loopback and WEB_HOST, against DNS rebinding (since 0.42.0: without it, coming in through another name gives 421); * disables the check
LOCAL_DELEGATE_WEB_FONTS1Brand typography from Google Fonts (0 = zero requests to third parties)
LOCAL_DELEGATE_AUTOSTART0Auto-start of llama-swap (opt-in)
LLAMASWAP_EXE / LLAMASWAP_CONFIG / LLAMASWAP_LISTEN—Only if AUTOSTART=1; LLAMASWAP_CONFIG also enables the daemon's turn and affinity (with the [llamaswap] extra). LLAMASWAP_EXE must be an absolute path to an existing file (otherwise it warns and does not start); without it, llama-swap is searched only in the absolute folders of PATH, never in the current folder (since 0.44.0)
LLAMASWAP_WATCH_CONFIG01 adds -watch-config to the auto-started backend
LOCAL_DELEGATE_FALLBACK1Fallback between models: if a role's model fails on its own, the next one in its chain answers (_MAX_HOPS=2; chains with _<ROLE>, see the wiki). 0 disables it
LOCAL_DELEGATE_COOLDOWN1Per-model cooldown: 3 consecutive failures (_FAILURES) stop it for 120 s (_S), doubling up to 900 s (_MAX_S). 0 disables it
LOCAL_DELEGATE_BACKEND_BREAKER1Cut-off for an unreachable backend: 3 consecutive connection failures (_FAILURES) make the local_* tools answer at once “backend unreachable, do it yourself” for 60 s (_S), doubling up to 600 s (_MAX_S), without counting as a delegation; when it expires, the next call probes it. 0 disables it
LOCAL_DELEGATE_REMOTE_TURN_CUT1Remote turn cut (#577): with the other machine's turn unanswered, operations go without a turn and one at a time per process (Claude Code and the Desktop daemon each carry their own row); if one exhausts its read deadline on the backend (_FAILURES, 1; a 5xx at the moment does not count), for 120 s (_S, doubling up to 600 s, _MAX_S) those that would go without a turn fail at once with “the remote turn does not respond; retrying now does not help”. 0 turns it off (the series stays)
LOCAL_DELEGATE_COST_FALLBACK(empty = claude-opus-5-5 in subagent)With which model and thread a delegation without an attributed model is valued: model or model:main|subagent. An invalid value breaks nothing: the dashboard uses the declared one and says so
LOCAL_DELEGATE_COMMIT_LANGUAGE(empty = current language)Language of the local_commit_msg message: es, en, fr, pt, de, it or a free name. Empty: the product's current language; diff: the predominant language of the diff's texts
LOCAL_DELEGATE_OUTPUT_LANGUAGE(empty = current language)Language in which the free-text tools (local_summarize, local_lint_summary, local_explain_code, local_describe_image) ask the model to answer: fr, pt, português… It does not change the interface nor local_commit_msg
LOCAL_DELEGATE_TURN_MAX_S600Daemon turn between models that collide in llama-swap: if the first in the queue has waited this many seconds and the daemon has gone another such time with no backend call starting or finishing, it is granted the turn anyway (turn: "forced" in the log)
LOCAL_DELEGATE_TURN_YIELD_S120Turn handover between chunks: if the first in the queue has waited this many seconds for a model colliding with that of an operation that has held the turn for another such time, that operation releases it before its next chunk and goes to the back of the queue (turn_yields in the log). Cost: at most one pair of model loads every such time when two long operations collide. 0 disables it
LOCAL_DELEGATE_CALL_MAX_S1800The daemon's own deadline for a call, queue included: on passing it, it is cancelled and logged as a failure (cancel_reason: "deadline"). 0 disables it
LOCAL_DELEGATE_PROGRESS_INTERVAL_S20Every how many seconds a live call sends notifications/progress with its phase (queued, slot, chunk k/N), so the client does not cut it for inactivity (Claude Code: 300 s). 0 disables it
LOCAL_DELEGATE_TURN_WAIT_NOTICE_S60If a call waited for the turn at least this many seconds, its response carries a notice ([local-delegate warning: …]; in local_extract, _local_delegate.turn_wait) saying how long it waited, that it was other delegations' queue and not model slowness, and that grouping calls by tool reduces it. Not in local_classify (exact label) nor in an error response. 0 disables it
LOCAL_DELEGATE_QUEUE_MAX_WAIT_S900Maximum seconds a call waiting for the turn or a slot endures without the queue advancing (a slow queue that does advance cuts no one): on passing it, the call fails at once with “queue saturated” (error: "queue_saturated"). 0 disables it
LOCAL_DELEGATE_SLOW_THRESHOLD0.5A call is “slow” (slow in the log, “slow ×0.37” in the dashboard) if it generates at less than this fraction of its model's normal speed
LOCAL_DELEGATE_AFFINITY_MARGIN_S5Affinity: an already loaded model is used only if at least this many seconds of TTL remain
LOCAL_DELEGATE_BACKEND_PARAMS(empty)Point override, key by key, of the per-role parameters in backend-params.json (sampling and reasoning): role.key=value;…, e.g. code.top_k=20. Needs a daemon restart; the file does not

The per-role parameters that travel in each request to the backend (top_k, temperature, enable_thinking with its budget…) are stored in backend-params.json and edited with local-delegate backend-params show|set|unset|reset; the closed list of keys, the precedence, and the reasoning are in the wiki.

The savings metric

The MCP logs each call in a monthly-rotated log and serves a dashboard at http://127.0.0.1:9393, with a range selector and visibility of delegations in progress. The context preserved = the input read server-side (calls with source=path that succeeded) minus what the tool returned to you, counted once per delegation even if the MCP chunks it. It is measured in characters and converted to Claude tokens with a density table measured per tokenizer family and content type (prose, code, log, structured data, diff): a .md does not count the same as a .json, and Haiku 4.5 does not count like Opus 5.5. Images are left out of that figure —without their dimensions there is no way to know how many tokens they would cost Claude— and are shown separately. Against it, the local cost = the tokens your GPU actually consumed, summing all calls: a chunked delegation repeats the system prompt in each chunk, and that difference is what chunking cost. There the real token count reported by the backend is used; chars ÷ 4 is only the fallback for the local model when it does not report one. Details in the wiki.

The dashboard also shows an estimated API-price equivalent: what that same context read by Claude would cost at list price, between a low bound and an estimate that counts the requests in which that content would have been re-read from the cache. It is not money you saved: your subscription is flat-rate. It is an estimate with its assumptions in view (with which model each delegation is attributed, how many requests followed, which density was used) and it does not deduct re-reads of the same file. Next to it, a quota block that reads “uncalibrated” until there are at least three measurements from statusline windows of different kinds, and never shows a percentage without that calibration. To attribute the history and feed those two blocks, run local-delegate recompute-cost from time to time (it reads your transcripts locally and writes only aggregates; since 0.50.0, if it cannot read one of its files it stops without rewriting it); doctor warns if there are delegations about to run out of transcript.

Tests do not count: delegations from the mcp client of scripts, those from benchmarks and those falling in a test window are set aside from the dashboard and from local_status. Before testing live against the MCP or the daemon, mark the interval and keep the id it prints:

local-delegate test-window start --label "Monday test"   # prints the id
local-delegate test-window stop <id>
local-delegate test-window list                          # windows and rows in each

The dashboard bar's Tests button shows them again; its ⓘ says how many were left out.

By project: each log row stores from which Claude Code project the delegation was requested (caller_project, a hash with the local salt LOG_DIR/project-salt, never the name or the path), and each hook-telemetry event, project. The dashboard shows the By project card (delegations and savings of each repo, largest first) and, in the filter bar, a project selector that filters the whole dashboard; by default it shows everything. The readable name comes from a separate local map, LOG_DIR/project-names.json (hash → the last folder of the project's real path, such as webshop, with the parent folder if two coincide and the full path on hover), which is written when the hash is computed and never leaves the machine; rows from before the map existed name themselves the first time you open the dashboard, from the folders of ~/.claude/projects. A hash without a name shows as “Unnamed project” and rows without a project, as “No project”. The “Who delegated” card separates main thread, subagents and mod. Whoever has the log and project-salt can confirm a project name by brute force: do not share that file (nor project-names.json) together with a log. Details in Savings & metrics and in Configuration.

The dashboard comes out in Spanish or English depending on your browser's language, and the ES/EN selector in its header changes it (remembered in that browser). See Savings & metrics.

The ranges, the chart days and the table hours use your time zone (the log is written in UTC, which is an unambiguous instant; the conversion is presentation). The dashboard also separates where the compute ran: local if the backend listens on loopback, remote if the inference went to another machine —for example this Mac using the PC's GPU—. Events from before v0.11.0 do not carry the field and show as n/a.

Scope / non-goals

local-delegate is deliberately text/image→text: it assembles the prompt (or the multimodal payload), POSTs to /chat/completions and returns only text. Things it does not do on purpose:

  • Local tool-calling. Local models do not invoke tools or execute code; Claude still does that. Adding it would turn this package into a parallel orchestrator, which is not the goal.
  • Image generation or editing. local_describe_image is only image→text (describe, read visible text, answer a specific question); nothing about generating or editing images.
  • Audio. For transcription, use the companion whisper-transcribe-mcp instead of trying to fit audio in here.
  • Replacing the subscription. The goal is to preserve quota by delegating bounded mechanical steps, not to route all the work to local models.

Client integration: hooks, skill and memory

local-delegate install leaves the complete integration ready in your HOME:

ComponentWhereWhat it does
MCP entryClaude Code config / ~/.codex/config.toml / ~/.config/opencode/opencode.json[c]registers the server (stdio with uvx or HTTP against the daemon)
HooksClaude Code plugin local-delegate@local-delegate (or ~/.claude/hooks/local-delegate/ + settings.json)suggest delegating; the read ones can also reject a full read of documentation, if turned on; one records which agent requested each delegation
Codex hooks~/.codex/hooks.json, next to yourstwo advisory hooks (UserPromptSubmit and SubagentStart), one that summarizes large prose reads through the shell and stops writing over what was only read summarized (PreToolUse on Bash, apply_patch and MCP reads) and one that records the session of each delegation (PreToolUse on the local-delegate tools), which Codex runs only when you approve them in /hooks
Skill~/.claude/skills/local-delegation/ and ~/.config/opencode/skill/local-delegation/golden rule and tool catalog
Memorymanaged block in ~/.claude/CLAUDE.md, ~/.codex/AGENTS.md and ~/.config/opencode/AGENTS.mdthe rule in a short, always-loaded note

By default only the clients you have installed are configured; you choose by hand with --clients claude|codex|opencode. The hooks are Claude Code's and, since 0.53.0, Codex's too: four in ~/.codex/hooks.json (two advisory, one that summarizes large prose reads through the shell and stops writing over what was only read summarized, and one that records which session each delegation comes from), which neither touch nor move yours and which do not run until you approve them in /hooks. See Codex hooks. opencode extends with TypeScript plugins, which is another surface, and Claude Desktop has no hooks at all. The Claude Code plugin does not work in Codex: Codex 0.169 rejects its whole hooks/hooks.json (because of the mod's modules) with only a warning at startup. If you imported it by hand, local-delegate doctor says so and gives codex plugin remove local-delegate@<marketplace>, which leaves the MCP entry intact. Each piece can be excluded (--no-hooks, --no-skill, --no-memory, --no-mcp).

Everything comes out in Spanish or English. install and update save the language of the session they run in (LOCAL_DELEGATE_LANG=es|en, or the system's) in language.json, so the daemon and the hooks use it too, and they write the skill, the memory block and the subagents' catalog in that language. Precedence and how to go back to following the system: Language.

Three hooks act on their own: UserPromptSubmit (mechanical intents), SubagentStart (reminds each subagent to load the local_* tools and read by ranges) and record_call.py (PreToolUse on the local-delegate tools), which neither warns nor blocks: it records which agent requested each delegation and with what effort, to attribute the equivalent cost to its model. The two read ones —PreToolUse/Read and PreToolUse/Bash|PowerShell— stay off unless --enable-read-hook, which turns them on together (--disable-read-hook or uninstall turn them off). They go together because they are a single rule over two paths: closing the Read tool and leaving cat report.md open does not change the behavior, it moves it elsewhere. With a large image that local_describe_image accepts (.png, .jpg, .gif, .webp) the notice recommends that tool with path, not a read by ranges; .svg, .bmp, .ico, small images, .pdf and .ipynb pass silently.

Those two warn; **rejec

Documentation truncated — see the full README on GitHub.

Reviews

No reviews yet

Be the first to review this server!