{"slug": "show-hn-local-motion-use-cursor-agents-and-chat-with-a-local-llm", "title": "Show HN: Local Motion – Use Cursor Agents and Chat with a Local LLM", "summary": "Local Motion, a new tool for VS Code and Cursor, lets developers run local coding agents with local LLMs on macOS, managing model loading and memory automatically. The tool selects compatible models, connects to Cursor via a proxy, and frees memory when not in use, supporting resumable downloads and on-demand model switching.", "body_md": "Local Motion turns a local coding agent on and off for VS Code and Cursor. It chooses a compatible local model for your Mac, loads it when you need it, and frees the memory when you do not.\n\n- Gives you one local-agent switch: turn on, connect Cursor, free memory.\n- Chooses a compatible local coding model for this Mac.\n- Reuses the installed model when possible, so turning it on again is quick.\n- Keeps every downloaded model on disk and switches between them on demand, so you can run a maximum-size model normally and a lighter one when the Mac is busy.\n- Connects Cursor automatically when running inside Cursor — model stays on this Mac, Cursor relays chats through its servers — without writing Cursor private state.\n- Frees the loaded model from memory immediately when you are done.\n- Keeps the runtime bound to\n`127.0.0.1`\n\n.\n\n- Profiles your Mac for architecture, memory, and model storage space.\n- Sizes the model memory budget at 80% of unified memory, pegged to the Apple Silicon Metal wired-memory limit (the real ceiling for GPU-resident GGUF weights), and estimates load cost at 1.1x file size plus explicit KV-cache and server overheads.\n- Fits the context window to the machine: the\n`localMotion.contextTokens`\n\nsetting is a ceiling, and every model start uses the largest context the memory budget affords under it. - Never blocks a start on current free memory. macOS reclaims cache and\ncompresses idle apps on demand, and Local Motion reports an honest\nout-of-memory explanation if\n`llama-server`\n\ngenuinely cannot load. - Searches Hugging Face GGUF repositories and ranks compatible quantizations only when setup or advanced model controls need them.\n- Downloads model files with resumable streaming.\n- Finds or installs\n`llama-server`\n\nthrough Homebrew. - Starts\n`llama-server`\n\nand a stable loopback OpenAI-compatible proxy.`Connect Cursor to Local Agent`\n\nstarts the tunnel that makes the proxy reachable by Cursor's backend. In real VS Code no tunnel starts and the`vscode.lm`\n\npath stays fully local. - Registers the running model with the VS Code Language Model API, with the provider's manage action opening the local-agent switch.\n\n- macOS.\n- VS Code or Cursor compatible with VS Code\n`^1.105.0`\n\n. - Homebrew, when\n`llama-server`\n\nis not already available on`PATH`\n\n,`/opt/homebrew/bin`\n\n, or`/usr/local/bin`\n\n; Local Motion uses it to install`llama.cpp`\n\n. - Enough free disk and unified memory for the selected GGUF file.\n- Localhost port\n`41434`\n\navailable for the Cursor-facing proxy, or set`localMotion.proxyPort`\n\nto another port. If the preferred port is occupied, Local Motion falls back to an ephemeral port and shows updated setup values. `cloudflared`\n\nfor the Cursor connection; when you connect Cursor, Local Motion installs it through Homebrew on demand, or set`localMotion.cursorTunnelUrl`\n\nto a public HTTPS tunnel URL you manage.\n\n- Install Local Motion.\n- Local Motion opens the local-agent switch once on first startup.\n- Click\n`Turn On Local Agent`\n\n.\n\nThe setup panel also exposes advanced model controls, but the default path does not require choosing a repository, model size, or quantization.\n\nWhen a local model is already running, `Local Motion: Connect Cursor to Local Agent`\n\nruns the\nCursor handoff directly from the command palette. If a size-valid installed model\nis stopped, the command starts it first; then it verifies the endpoint, copies\nthe setup block, and opens Cursor Models settings.\n\n`Turn On Local Agent`\n\nmay install `llama.cpp`\n\nthrough Homebrew and download the\nbest compatible GGUF quantizations for this Mac. The default setup is a two-model\npack: **Max: Qwen3-Coder-30B-A3B** and **Mini: Gemma 4 26B A4B**. Local Motion\npreinstalls both when they fit, then starts the selected model. It does not\nsilently downgrade the one-click setup to older Qwen2.5 models; choose those\nexplicitly from Advanced when needed. Set\n`localMotion.runAutomagicalSetupOnFirstStartup`\n\nto `true`\n\nonly if you want that install/download to start automatically on first\nstartup.\n\nThe ladder is maintained from a live ranking; see\n[README/Notes/model-selection.md](/mattmireles/local-motion/blob/main/README/Notes/model-selection.md) and\n`npm run models:check`\n\n/ `npm run models:refresh`\n\n.\n\nIf setup fails or is cancelled, run `Local Motion: Repair Local Agent`\n\n.\n\nRun `Local Motion: Free Memory`\n\nto unload the local model immediately.\n\nThe setup panel shows Max and Mini as first-class choices with their selected\nquantization, download size, and estimated runtime memory. Select either model\nand use the main button to start, switch, or install the pack if it is not\ndownloaded yet. The current model stops, the selected one starts, and it becomes\nthe model that `Turn On Local Agent`\n\nstarts next time.\n\nMax and Mini are replaceable slots. Paste a Hugging Face GGUF repository into\neither row and click `Replace`\n\n; Local Motion validates the best compatible Q4+\nquantization, downloads it into that slot, and restarts the model only when that\nslot was already running.\n\nRun `Local Motion: Diagnose Setup`\n\nfor a read-only status check of the installed\nmodel file, local runtime, proxy verification, copied Cursor values, and the\nremaining Cursor picker verification step.\n\nAfter Cursor setup succeeds once, Local Motion can restart the installed model\nautomatically on future editor startups without downloading a new model,\nopening the setup panel, opening Cursor settings, or replacing the clipboard.\nThe Cursor tunnel still starts only when you run `Connect Cursor to Local Agent`\n\n.\nTunnel URLs can rotate across handoffs, so the setup panel marks previously\ncopied Cursor values stale when the active Base URL changes. Disable\n`localMotion.resumeAutomagicalSetupOnStartup`\n\nto turn automatic local model\nrestart off.\n\nFor advanced manual control:\n\n- Load a Hugging Face GGUF repository.\n- Pick a quantization marked\n`Compatible`\n\n. - Click\n`Install and Turn On`\n\n; Local Motion installs the quantization and starts the local model. Use`Connect Cursor to Local Agent`\n\nwhen you want Cursor chat to use it.\n\n`Connect Cursor to Local Agent`\n\nverifies `GET /v1/models`\n\nthrough the\nCursor-facing tunnel with the current session key, copies the full setup block,\nopens Cursor Settings (in plain VS Code, the filtered settings editor instead),\nand leaves one-click copy controls visible for:\n\n- OpenAI API Key: the current session key\n- Override OpenAI Base URL: the active public Cursor tunnel Base URL\n- Add Custom Model: the active Local Motion model ID\n- Full setup block\n\nIn Cursor's API Keys section, **turn on OpenAI API Key** after pasting the\nsession key. A saved key with that provider toggle off makes Cursor reject the\nselected custom model before it sends any request. See the\n[custom-model validation debugging guide](/mattmireles/local-motion/blob/main/README/Guides/cursor-custom-model-validation-guide.md).\n\nCursor does not expose a stable extension API for mutating its native model\npicker or private settings. Local Motion deliberately does not write Cursor\nSQLite databases, secure storage, `settings.json`\n\n, or other private application\nstate.\n\n**Known Cursor limit (confirmed 2026-07-01):** Cursor routes every custom-model\nrequest through its own cloud backend, which refuses private addresses with\n`Provider returned error: Access to private networks is forbidden`\n\n. A\n`http://127.0.0.1:41434/v1`\n\nBase URL therefore cannot work in Cursor's native\nchat, in any build. The proven workaround is a public HTTPS tunnel\n(cloudflared or ngrok) in front of the Local Motion proxy — with the tradeoff\nthat prompts then transit Cursor's backend and the tunnel, so the Cursor path\nis \"local compute\", not \"fully private\". Anyone with the tunnel URL and current\nsession key can reach the proxy while the tunnel is up, and Cursor's Zero Data\nRetention does not apply to custom keys. Full failure analysis, fix matrix, and\nsetup steps:\n[Cursor private-network block guide](/mattmireles/local-motion/blob/main/README/Guides/cursor-private-network-block-guide.md).\nThe fully local path (`vscode.lm`\n\nprovider) works in real VS Code only; Cursor\ndoes not implement the VS Code Language Model API.\n\nCursor's OpenAI Base URL override is global in Cursor settings and may not apply\nto every Cursor surface. Custom API keys officially power chat models only —\nTab autocomplete, Apply, and Auto never use the custom endpoint, and Agent mode\nis best-effort. Treat setup as proven only for the Cursor surface you manually\ntest, such as `Cmd+L`\n\nchat. Do not assume Agent, Composer, Inline Edit, or Tab\nautocomplete use the tunnel until verified in your Cursor build.\n\nLocal Motion keeps the loopback proxy stable by preferring\n`http://127.0.0.1:41434/v1`\n\n, but Cursor must use the active public tunnel Base\nURL shown by `Connect Cursor to Local Agent`\n\n. If that URL changes, the setup\npanel marks previously copied Cursor values stale and offers `Copy Updated Setup`\n\n.\n\nLocal Motion binds its runtime services to `127.0.0.1`\n\n. Model files are stored in\nthe extension global storage directory, outside the workspace. VS Code\nLanguage Model API requests stay on loopback. Cursor requests use local compute\nbut transit Cursor's backend and the configured tunnel before reaching the\nLocal Motion proxy. Requests sent to the proxy are sanitized before forwarding\nto `llama-server`\n\n.\n\n```\nnpm install\nnpm run check\nnpm run lint\nnpm test\nnpm run package\n```\n\nThe `CI`\n\nGitHub Actions workflow runs the same deterministic gate on pull\nrequests and pushes: install, typecheck, lint, test, and package.\n\nOptional local runtime smoke proof:\n\n```\nnpm run smoke:local-runtime\n```\n\nThis downloads the default compatible GGUF when it is not already cached, starts\n`llama-server`\n\n, verifies the Cursor-facing proxy, and sends one local chat\ncompletion.\n\nOpen this folder in VS Code or Cursor, run the Extension Development Host, and\nexecute `Local Motion: Open Local Agent`\n\n.\n\nFound a defect or have an idea worth trying? Start with\n[CONTRIBUTING.md](/mattmireles/local-motion/blob/main/CONTRIBUTING.md). Do not put a vulnerability, session key, or\nprivate prompt in an issue; use the private reporting path in\n[SECURITY.md](/mattmireles/local-motion/blob/main/SECURITY.md).\n\nLocal Motion publishes to the Visual Studio Marketplace with `vsce`\n\n.\n\nLocal package proof:\n\n```\nnpm run check\nnpm run lint\nnpm test\nnpm run package\n```\n\nManual Marketplace publish:\n\n```\nVSCE_PAT=<token> npx vsce publish -p \"$VSCE_PAT\"\n```\n\nGitHub Actions publish:\n\n- Create or verify the Visual Studio Marketplace publisher ID from\n`package.json`\n\n. - Add a repository secret named\n`VSCE_PAT`\n\nwith Marketplace`Manage`\n\nscope. - Run the\n`Publish VS Code Extension`\n\nworkflow manually.\n\nMicrosoft recommends moving automated publishing to Entra ID before global Azure DevOps Personal Access Tokens retire on December 1, 2026.\n\nSee [Local Native LLM Extensions for VS Code and Cursor on macOS](/mattmireles/local-motion/blob/main/README/Guides/vs-code-local-ai-hugging-face-guide.md)\nfor the sidecar architecture field guide.", "url": "https://wpnews.pro/news/show-hn-local-motion-use-cursor-agents-and-chat-with-a-local-llm", "canonical_source": "https://github.com/mattmireles/local-motion", "published_at": "2026-07-10 18:50:24+00:00", "updated_at": "2026-07-10 19:05:12.435287+00:00", "lang": "en", "topics": ["developer-tools", "large-language-models", "ai-tools"], "entities": ["Local Motion", "VS Code", "Cursor", "Hugging Face", "Homebrew", "llama.cpp", "Qwen3-Coder-30B-A3B", "Gemma 4 26B A4B"], "alternates": {"html": "https://wpnews.pro/news/show-hn-local-motion-use-cursor-agents-and-chat-with-a-local-llm", "markdown": "https://wpnews.pro/news/show-hn-local-motion-use-cursor-agents-and-chat-with-a-local-llm.md", "text": "https://wpnews.pro/news/show-hn-local-motion-use-cursor-agents-and-chat-with-a-local-llm.txt", "jsonld": "https://wpnews.pro/news/show-hn-local-motion-use-cursor-agents-and-chat-with-a-local-llm.jsonld"}}