local-llm-delegator
Allows delegating small coding implementations to cheaper models via Hugging Face inference endpoints, while the primary agent handles architecture, scoping, review, and final acceptance.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@local-llm-delegatorFix the off-by-one error in the pagination helper."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Local LLM Delegator
Local LLM Delegator is an installable Codex and Claude Code plugin that shifts small coding implementations to a cheaper model while the primary agent keeps architecture, scoping, review, and final acceptance.
The bundle contains:
A dependency-free Python MCP server with
propose_patchandapply_patch.A delegation skill that triggers before the primary model reads broad source context.
Templates for Hugging Face GPT-OSS, llama.cpp, and OpenRouter.
Exact-patch SHA-256 approval, path limits, stale-source checks, validation, partial-failure restoration, and one bounded repair.
Requirements
Python 3.11+
POSIX
shand thepatchutilityCodex with plugin support or Claude Code
An OpenAI-compatible model endpoint
No Python package installation is required.
Related MCP server: delegations-mcp
Install in Codex
Clone this repository, add it as a local marketplace, and install the plugin:
git clone https://github.com/tushrv/local-llm-delegator.git
codex plugin marketplace add ./local-llm-delegator
codex plugin add local-llm-delegator@local-llm-delegatorRestart Codex and begin a new thread so the skill and MCP tools are discovered.
Install in Claude Code
Add the cloned repository as a marketplace and install the plugin:
/plugin marketplace add /absolute/path/to/local-llm-delegator
/plugin install local-llm-delegator@local-llm-delegatorRestart Claude Code after installation.
Configure a project
From the target repository, create a policy:
python3 /absolute/path/to/local-llm-delegator/plugins/local-llm-delegator/scripts/init_project.py \
--provider huggingfaceSupported provider values are huggingface, llamacpp, and openrouter.
Review the generated local-llm-worker.toml; narrow allowed_paths and replace
the example validation command with the project's actual checks.
For Hugging Face, export the credential before launching Codex or Claude:
export HF_INFERENCE_TOKEN=your-tokenFor OpenRouter, export OPENROUTER_API_KEY. llama.cpp needs no token by default.
The plugin inherits these variables but never stores or returns them.
The skill passes the target repository as workspace_root on each proposal, so
one installed MCP server can work across projects without re-registration.
LOCAL_LLM_CONFIG may optionally force a policy file outside each project.
Use it
In Codex, ask:
Use $delegate-local-worker to implement this focused bug fix.In Claude Code, invoke:
/local-llm-delegator:delegate-local-workerThe skill is explicit-invocation-only on both hosts. Codex sets
allow_implicit_invocation: false. Claude uses a separate mirrored skill with
disable-model-invocation: true, which also keeps its description out of
Claude's context until manual invocation.
The full SKILL.md is therefore not loaded on every prompt. While the plugin is
enabled, the host may still advertise or discover the two MCP tool schemas; that
small, host-dependent overhead exists even when the skill is idle. Invoke the
skill only when the source context and implementation work being offloaded is
larger than that overhead.
The primary model scopes the task and calls propose_patch. The worker reads
only allowed files, asks the cheaper model for a diff, validates it without
mutating the project, and returns the patch plus its digest. After full review,
the primary model calls apply_patch, which applies those exact bytes and runs
configured checks.
The MCP reduces primary-model context only when delegation happens before the primary model reads and solves the implementation itself. Returned patches and validation results still consume review context. The plugin does not persist Codex or Claude conversation memory.
Security
Never place tokens in TOML, plugin JSON, prompts, or supporting context.
Treat project validation commands as trusted code.
Review the complete patch before approving its digest.
Hosted models receive the source files inside the delegated scope.
Proposal state is process-memory-only and expires after 15 minutes by default.
The worker does not commit, push, or execute commands proposed by the model.
Development
cd plugins/local-llm-delegator/mcp
PYTHONPATH=src python3 -m unittest discover -s tests -v
ruff check .
mypy srcValidate the skill and plugin with the validation scripts from Codex's built-in
skill-creator and plugin-creator skills.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tushrv/local-llm-delegator'
If you have feedback or need assistance with the MCP directory API, please join our Discord server