Use a coding agent with Ollama or llama.cpp on a Mac
Fix "error sending request for url (http://0.0.0.0:8081/v1/chat/completions)": point the agent at 127.0.0.1, then pick a tool-capable local model.
TroubleshootingUpdated 7 min read
On this page
You pointed a Claude Code-style coding agent at Ollama, llama.cpp or another local server on your Mac, and it fails with this:
error sending request for url (http://0.0.0.0:8081/v1/chat/completions)The server often answers fine in a browser or with curl. A Goose GitHub issue reported exactly this against a working llama.cpp server, and the reply was to use 127.0.0.1. The fixes below cover that error and the other things that commonly go wrong with local models.
Why it happens
0.0.0.0 means "every network interface" when a server binds to it. It is a listening address, not a destination, so a client should not send requests there. The failure surfaces as a generic request error with no hint about the real cause.
The other causes look similar from the agent's side:
| Cause | Symptom | Fix |
|---|---|---|
Client uses 0.0.0.0 | error sending request for url (http://0.0.0.0:...) | Use 127.0.0.1 (Fix 1) |
| Server not running, or wrong port | Connection refused, timeout, "Not running at <url>" in Sledbot | Check the port (Fix 2) |
| Model name doesn't match the server | "model not found", or no model configured | Copy the exact name (Fix 3) |
| Model can't call tools | Agent talks about edits but never makes them | Pick a tool-capable model (Fix 4) |
| Apple on-device model selected | Not supported by Sledbot's native agent | Use a local server instead (Fix 5) |
Step-by-step fixes
Fix 1: Use 127.0.0.1 as the client host
Find the base URL in your agent's config file, environment variable or provider settings.
Replace
0.0.0.0with127.0.0.1. Keep the port. For an OpenAI-compatible server the base URL normally ends in/v1, for examplehttp://127.0.0.1:8081/v1.Check the server from Terminal. This only lists models, and you should get JSON back. Change the port to match your server.
bash curl http://127.0.0.1:8081/v1/modelsRestart the agent so it reads the new URL.
If you start llama.cpp yourself, you can pin the server to the loopback address. This makes it reachable only from your Mac. Stop it with Control-C.
llama-server -m /path/to/model.gguf --host 127.0.0.1 --port 8081Fix 2: Check the server is on the port you think
The 8081 in the error is a custom port. Servers ship with different defaults, and these are the local addresses Sledbot looks for:
| Server | Default local address |
|---|---|
| Ollama | localhost:11434 |
| LM Studio | :1234 |
| llama.cpp server | :8080 |
| vLLM | :8000 |
MLX (mlx_lm.server) | :8080 |
| Jan | :1337 |
| LocalAI | :8080 |
Run the curl check from Fix 1 against your port. For Ollama, Microsoft's documentation shows an OpenAI-compatible endpoint at http://localhost:11434/v1/, and says the native client connects to http://localhost:11434 by default. You can override that with the OLLAMA_HOST environment variable, so check whether you changed it. ollama list shows which models you have pulled.
As of November 2026, LM Studio's docs list macOS 14 or later on Apple silicon only, so it won't run on an Intel Mac.
Fix 3: Use the exact model name
- List what the server has:
ollama list, or the/v1/modelsresponse from thecurlcheck. - Copy the name exactly, including any tag such as
:8b. - Put it in the agent's config. In Sledbot's
sled chat, pass it as--model provider/model.
If no model is configured, sled chat prints: "No model configured. Add a provider key in Sledbot (or set e.g. ANTHROPIC_API_KEY) and pass --model provider/model."
Fix 4: Pick a model that supports tool calling
A coding agent works by calling tools: read a file, edit a file, run a command. A model that can't call tools can still chat, so the symptom is an agent that describes an edit and never makes it. Microsoft's Ollama page notes that not all models support function calling, and suggests llama3.2 or qwen3:4b for tool use. Check your runner's model page for a tools label before you download a large model.
- Prefer a model your runner documents as tool-capable over a bigger one that isn't.
- In Sledbot, a teammate that runs on the native agent only offers tool-capable models. The Perplexity provider is flagged as having no tool calling.
- With no
--model,sled chatuses the last model you used, then the first tool-capable model of an enabled provider.
Fix 5: Don't use Apple's on-device model for the agent
Sledbot lists "Apple on-device" among its local providers, but the native agent doesn't support it ("Apple on-device models are not supported by the native agent yet"). Use Ollama, LM Studio, llama.cpp, vLLM, MLX, Jan or LocalAI for agent work.
Checklist before you try again
- The base URL uses
127.0.0.1(orlocalhost), your real port and/v1. curl http://127.0.0.1:<port>/v1/modelsreturns JSON.- The model name matches the server's list exactly.
- The model is documented as supporting tool calling.
- The project is a git repo with a clean commit to return to.
Use a local model in Sledbot
We make Sledbot, and its native agent works with the local servers above (everything except Apple on-device). Detection and the Test button tell you quickly whether the server is reachable.
- Start your local server, for example Ollama.
- Open Settings with ⌘, and go to Providers. Local servers are in their own group.
- Select your server. Sledbot shows "Looking for a server on…", then "Detected on…" or "Nothing is running on…". Click Check again after starting the server.
- If your server isn't on its default port, open Advanced and set Base URL to the
127.0.0.1address and your port. Click Test, then Save. "Connected (N models)" means it works. "Endpoint not found — check the base URL" means the port or path is wrong. - Under Models, click Refresh. If the model doesn't appear in pickers, check that Enabled is on, because disabled providers are hidden.
For a server that isn't listed, use Add custom endpoint…. Choose OpenAI under Compatible with, enter a Name and Base URL, turn on Runs on my machine (no internet needed), and click Add.
To start work, press ⌘T, choose the agent Sledbot, and pick a model with the model chip. Starting an agent needs an active trial or a license. You can also run sled chat in a Sledbot terminal, and --plan gives you read-only mode.
Safeguards for the overwrite risk above:
- Worktrees: Work in a new worktree is on by default for git repos.
- Approvals: native agent tool calls go through the approval rules, and edits outside the working folder always ask.
- Review: Review changes lets you accept or reject each hunk.
- Undo:
/undoinsled chatrestores files to before the last turn (git repos only).
Sledbot also runs OpenCode, Crush, Goose and Aider, which are tagged "Any model" in Settings ▸ Agents. Claude Code, Codex CLI and Gemini CLI are not, so don't expect to point them at a local model from Sledbot.
If you only want one terminal agent and are happy to edit its config, you don't need Sledbot. As of November 2026, Goose and Aider are both free and open source, and Fix 1 applies to any client. Sledbot is part of MacSuite, and you can try Sledbot free for 7 days. The full setup is in AI providers, accounts and fallback.
If nothing works
Contact the agent's developers (for Goose or Continue, their GitHub issue trackers), or the runner's (Ollama, llama.cpp). For Sledbot, use support and see Troubleshooting Sledbot. Include the exact error text, the base URL you configured, the curl output, the model name, the command that started the server, and your macOS version.
Hi, my coding agent can't reach my local model on macOS.
Error: error sending request for url (http://0.0.0.0:8081/v1/chat/completions)
Base URL now: http://127.0.0.1:8081/v1
curl http://127.0.0.1:8081/v1/models returns: (paste output)
Server command: (paste the command that starts it)
Model name: (exact name from the model list)
Steps tried: switched host to 127.0.0.1, confirmed port, restarted the agent.Common questions
Can I use Claude Code itself with a local model?
Not through Sledbot. Claude Code, Codex CLI and Gemini CLI aren't marked "Any model" there. Use a "Claude Code-style" agent that accepts any model, such as Sledbot's native agent, OpenCode, Goose or Aider.
Why does the browser work but the agent doesn't?
You probably typed 127.0.0.1 or localhost in the browser, while the agent's config still has 0.0.0.0. Fix the agent's base URL.
Which local model should I pick?
One your runner documents as supporting tool calling. Microsoft's Ollama page names llama3.2 and qwen3:4b as starting points. Smaller models make more mistakes, so keep edits in a worktree.
Does a local model send my code anywhere?
Not by itself: a server on 127.0.0.1 is only reachable from your Mac. The agent's other tools, such as web fetch or MCP servers you enable, may still make network calls.
Background reading: Run a local AI coding agent on your Mac.