{"slug": "local-agent-toolkit-delegate-small-coding-tasks-to-local-ollama-models", "title": "Local Agent Toolkit – delegate small coding tasks to local Ollama models", "summary": "Local Agent Toolkit, an open-source tool, allows developers to delegate small coding tasks to local Ollama models, reserving cloud tokens for harder decisions. The toolkit filters repository context, blocks sensitive paths, and provides commands for code exploration, review, testing, and patching, with output treated as untrusted advice requiring verification.", "body_md": "**Keep frontier-model tokens for frontier-model work.**\n\n`local-agent`\n\nlets Codex, Claude Code, or a human developer delegate **small, bounded coding tasks** to an Ollama model running on local hardware.\n\nUse local compute for repository exploration, first-pass reviews, test ideas, diagnostics, and candidate patches—while reserving expensive cloud tokens and frontier-model attention for harder decisions.\n\nThe local model is a worker, not the authority. Its output is untrusted advice that must be independently verified.\n\nNote\n\nToken savings depend on the task, model, context size, and verification overhead. The toolkit enables controlled delegation; it does not guarantee a fixed reduction in cloud usage.\n\nTip\n\n**Contributions are wanted.** New commands, model-selection improvements, integrations, platform support, tests, examples, and documentation fixes are all welcome.\n\n```\nflowchart LR\n    A[\"Codex, Claude Code, or you<br/>Parent agent\"]\n    B[\"local-agent<br/>Bounded task + filtered context\"]\n    C[\"Ollama model<br/>Runs on local compute\"]\n    D[\"Verified result<br/>Accept, edit, or reject\"]\n\n    A -->|Delegate| B\n    B -->|Selected context| C\n    C -->|Untrusted advice| A\n    A -->|Verify| D\n```\n\nWith the default Ollama host, source context stays on your machine. The toolkit filters repository context, blocks sensitive paths by default, and can recommend a suitable installed model for the task and requested context size.\n\n| Need | Commands |\n|---|---|\n| Choose a model | `recommend-model` , `models` |\n| Explore code | `find` , `files` |\n| Plan a change | `plan` , `impact` |\n| Review work | `review` , `review-staged` , `review-branch` |\n| Design or draft tests | `test-plan` , `write-tests` |\n| Diagnose failures | `diagnose` , `fix-test` |\n| Challenge an approach | `second-opinion` |\n| Draft a small patch | `patch` |\n\nMost commands are read-only. `patch`\n\nand `write-tests`\n\nprint candidate diffs without applying them. `fix-test`\n\nexecutes the exact reviewed shell command supplied through `--command`\n\nbefore analyzing its output.\n\n- macOS with zsh is the primary supported environment.\n- Python 3.10–3.13; the CLI uses only the standard library.\n- Ollama with at least one installed model.\n- Git for repository-aware commands.\n- Codex and Claude Code are optional; the CLI works directly from a terminal.\n\nUbuntu is exercised in CI. Windows and non-zsh installation are not currently supported public interfaces.\n\n```\ngit clone https://github.com/tomerzipori/local-agent-toolkit.git\ncd local-agent-toolkit\nchmod +x install.sh\n./install.sh --skills both\nsource ~/.zshrc\n```\n\nChoose `codex`\n\n, `claude`\n\n, `both`\n\n, or `none`\n\n:\n\n```\n./install.sh --skills codex\n./install.sh --skills claude\n./install.sh --skills both\n./install.sh --skills none\nollama list\nlocal-agent models\nlocal-agent configure\n```\n\nFor noninteractive setup:\n\n```\nlocal-agent configure \\\n  --model 'your-installed-model-name' \\\n  --host http://127.0.0.1:11434 \\\n  --num-ctx 32768 \\\n  --max-chars 120000\nlocal-agent files \\\n  \"Explain the responsibilities, assumptions, and risks\" \\\n  src/client.py src/retry.py\n```\n\nInspect the exact context before contacting Ollama:\n\n```\nlocal-agent files \\\n  \"Explain the retry flow\" \\\n  src/client.py src/retry.py \\\n  --show-context-files\nMODEL=\"$(local-agent recommend-model review --num-ctx 16384 --name-only)\"\n\nlocal-agent review \\\n  \"Look for correctness regressions and missing tests\" \\\n  --model \"$MODEL\" \\\n  --num-ctx 16384\n```\n\nThe deterministic recommender filters models that lack the requested context or estimated memory capacity, then ranks the remaining candidates for the command. It reads metadata and system memory but never loads, unloads, benchmarks, or runs inference with a model.\n\n```\nlocal-agent find \"Where is retry behavior implemented?\"\nlocal-agent review-staged \"Pre-commit correctness review\"\nlocal-agent review-branch \"Review before opening a PR\" --base origin/main\nlocal-agent plan \"Add validation for empty package names\" src/config.py tests/test_config.py\ngit diff | local-agent second-opinion --stdin \"Challenge the design choices\"\npytest tests/test_sampling.py -x 2>&1 | local-agent diagnose --stdin \"Find the likely cause\"\n```\n\n`fix-test`\n\ndeliberately executes its supplied command. Only pass commands you have personally reviewed and would run directly yourself.\n\nThe installer can copy the personal skill to:\n\n- Codex:\n`~/.agents/skills/local-agent-toolkit`\n\n- Claude Code:\n`~/.claude/skills/local-agent-toolkit`\n\nRestart existing sessions after installation, then use a prompt such as:\n\n```\nUse local-agent to review the staged diff before you do your own review.\n```\n\nThe skill recommends a model, delegates one narrow task, and instructs the parent agent to verify the result. Installation does not guarantee that every session will invoke the skill automatically.\n\nBy default, the toolkit:\n\n- includes Git-tracked files only;\n- excludes ignored, untracked, sensitive, binary, symlinked, external, and oversized files;\n- limits file count, file size, and total context;\n- reports how much context is being sent.\n\nOpt-in flags include `--include-untracked`\n\n, `--include-ignored`\n\n, `--allow-sensitive-files`\n\n, `--allow-outside-repo`\n\n, `--allow-remote-host`\n\n, and `--allow-insecure-remote-host`\n\n.\n\nUse `--show-context-files`\n\nwhenever scope or sensitivity is uncertain.\n\nImportant\n\nThe default host is `http://127.0.0.1:11434`\n\n. A non-local host receives the supplied source context and requires explicit approval flags.\n\nKeep final decisions about credentials, permissions, destructive operations, deployments, migrations, security, broad data-integrity risks, and public APIs with the parent agent.\n\nUseful diagnostics:\n\n```\nlocal-agent recommend-model review --num-ctx 16384 --json\nlocal-agent models --verbose\nlocal-agent recommend-model review --refresh\n```\n\nThe recommender is conservative, explainable, and deterministic—not a quality leaderboard. Memory use for unloaded models is estimated, a safe model may still run slowly, and parameter count or quantization alone does not determine quality. Preferences cannot bypass context or memory safety filters.\n\nConfiguration is saved at `~/.config/local-agent/config.json`\n\n. Values resolve from command-line options, environment variables, saved configuration, then built-in defaults.\n\n| Setting | Default |\n|---|---|\n| Ollama host | `http://127.0.0.1:11434` |\n| Model context window | `32768` tokens |\n| Supplied context budget | `120000` characters |\n| Maximum file size | `256000` bytes |\n| Maximum context files | `200` |\n\nSee [the installer and configuration reference](/tomerzipori/local-agent-toolkit/blob/main/docs/installer-reference.md) for managed paths, environment variables, reinstall behavior, model-cache details, remote hosts, and uninstallation.\n\nThis project is intended to grow into a shared toolbox for practical local-model delegation. Small, focused pull requests are welcome.\n\nUseful contribution areas include:\n\n- new bounded commands and integrations;\n- model recommendation and memory estimation;\n- prompts, output contracts, and safety controls;\n- Linux, Bash, Fish, or Windows support;\n- reproducible model notes and benchmarks;\n- tests, documentation, and usability improvements.\n\nStart with [CONTRIBUTING.md](/tomerzipori/local-agent-toolkit/blob/main/CONTRIBUTING.md), or [open an issue](https://github.com/tomerzipori/local-agent-toolkit/issues) for an idea or rough edge.\n\n```\nbash scripts/check.sh\npython3 -m unittest discover -s tests -v\n```\n\nCI tests Python 3.10, 3.11, and 3.13 and runs Ruff, ShellCheck, CodeQL, and secret scanning.\n\n- Quality and speed depend on the model, quantization, context, task, and hardware.\n- Repository context may be incomplete or truncated.\n- The recommender estimates fit; it does not benchmark quality or performance.\n- macOS and zsh are the primary supported installation environment.\n- Saving cloud tokens still requires careful task selection and efficient verification.\n\n```\n./install.sh --uninstall\n./install.sh --uninstall --purge-config\n```\n\nThe uninstaller removes only toolkit-managed paths and marked integration blocks.\n\n[MIT](/tomerzipori/local-agent-toolkit/blob/main/LICENSE) © 2026 Tomer Zipori", "url": "https://wpnews.pro/news/local-agent-toolkit-delegate-small-coding-tasks-to-local-ollama-models", "canonical_source": "https://github.com/tomerzipori/local-agent-toolkit", "published_at": "2026-07-11 17:24:59+00:00", "updated_at": "2026-07-11 17:35:06.987956+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence", "ai-tools"], "entities": ["Local Agent Toolkit", "Ollama", "Codex", "Claude Code"], "alternates": {"html": "https://wpnews.pro/news/local-agent-toolkit-delegate-small-coding-tasks-to-local-ollama-models", "markdown": "https://wpnews.pro/news/local-agent-toolkit-delegate-small-coding-tasks-to-local-ollama-models.md", "text": "https://wpnews.pro/news/local-agent-toolkit-delegate-small-coding-tasks-to-local-ollama-models.txt", "jsonld": "https://wpnews.pro/news/local-agent-toolkit-delegate-small-coding-tasks-to-local-ollama-models.jsonld"}}