{"slug": "how-to-run-local-llms-with-ollama-and-plug-them-into-your-coding-agent", "title": "How to run local LLMs with Ollama and plug them into your coding agent", "summary": "A developer guide details how to run open models like Gemma, Qwen, DeepSeek and gpt-oss locally with Ollama, covering installation, terminal chat, and calling models through the local REST API or the official Python and JavaScript libraries. It highlights the `ollama launch` command, which connects coding agents such as Claude Code, Codex, Copilot CLI and OpenCode directly to local Ollama models, while cautioning that small local models are notably weaker at agentic coding than frontier models.", "body_md": "[Ollama](https://github.com/ollama/ollama) runs open models such as Gemma, Qwen, DeepSeek, Kimi and gpt-oss on your own machine, with a CLI, a local REST API and official Python and JavaScript libraries. The newest trick is the one most people miss: `ollama launch` wires a coding agent like Claude Code, Codex or OpenCode straight to Ollama models.\n\nThis guide goes from install to a local chat, then to calling the model from code, then to a coding agent backed by Ollama.\n\n```\n# macOS and Linux\ncurl -fsSL https://ollama.com/install.sh | sh\n\n# Windows (PowerShell)\nirm https://ollama.com/install.ps1 | iex\n```\n\nPrefer not to pipe a script into your shell? There are manual downloads for macOS (`Ollama.dmg`) and Windows (` OllamaSetup.exe`), manual Linux instructions at docs.ollama.com, and an official Docker image, `ollama/ollama`, on Docker Hub.\n\n```\nollama run gemma4\n```\n\nThe first run downloads the model, then you chat in the terminal. Download size and speed depend on the model and your hardware, so start small. The full list is at [ollama.com/library](https://ollama.com/library).\n\nNot sure where to start? Just run:\n\n```\nollama\n```\n\nIt prompts you to run a model or connect Ollama to your existing agents and apps, such as Claude Code, OpenClaw, OpenCode, Codex and Copilot.\n\n```\nollama launch claude\n```\n\nPick a model when prompted, then work in your repo as usual. Supported coding integrations listed in the README are [Claude Code](https://docs.ollama.com/integrations/claude-code), [Codex](https://docs.ollama.com/integrations/codex), [Copilot CLI](https://docs.ollama.com/integrations/copilot-cli), [DeepSeek Harness](https://docs.ollama.com/integrations/deepseek-harness), [Droid](https://docs.ollama.com/integrations/droid) and [OpenCode](https://docs.ollama.com/integrations/opencode). Each link has the specific setup for that agent.\n\nBe realistic about quality: small local models are much weaker at agentic coding than frontier models. Local is great for privacy, offline work and cheap experiments; give the agent bigger models for real multi-file tasks if your hardware allows.\n\nThere is also `ollama launch openclaw`, which turns Ollama into a personal assistant across WhatsApp, Telegram, Slack, Discord and more.\n\nOllama's REST API listens on localhost by default:\n\n```\ncurl http://localhost:11434/api/chat -d '{\n  \"model\": \"gemma4\",\n  \"messages\": [{\n    \"role\": \"user\",\n    \"content\": \"Why is the sky blue?\"\n  }],\n  \"stream\": false\n}'\npip install ollama\npython\nfrom ollama import chat\n\nresponse = chat(model='gemma4', messages=[\n  {'role': 'user', 'content': 'Why is the sky blue?'},\n])\nprint(response.message.content)\nnpm i ollama\npython\nimport ollama from \"ollama\";\n\nconst response = await ollama.chat({\n  model: \"gemma4\",\n  messages: [{ role: \"user\", content: \"Why is the sky blue?\" }],\n});\nconsole.log(response.message.content);\n```\n\nThat is a full AI feature prototype with no API bill. When you need more, the [API docs](https://docs.ollama.com/api), [CLI reference](https://docs.ollama.com/cli), [Modelfile reference](https://docs.ollama.com/modelfile) and [importing models](https://docs.ollama.com/import) guide cover the rest.\n\nOllama lists [llama.cpp](https://github.com/ggml-org/llama.cpp) as its supported backend. If you want lower-level control, such as an OpenAI-compatible server with your own flags, llama.cpp is the engine to look at directly.\n\nEach page has who it is for, the steps, and a prompt you can paste into your coding agent.\n\nUse case: [Launch a coding agent backed by Ollama](https://dedupedai.com/use-cases/ollama-ollama/launch-coding-agent-on-ollama/)\n\nUse case: [Run an open model on your machine in one command](https://dedupedai.com/use-cases/ollama-ollama/run-open-model-locally-one-command/)\n\nUse case: [Call a local model from Python or JavaScript](https://dedupedai.com/use-cases/ollama-ollama/call-local-model-from-python-or-js/)\n\n**Get one email every Monday with the week's hottest AI repos and exactly how to use them: [subscribe free at dedupedai.com](https://dedupedai.com/join/?utm_source=devto&utm_medium=article&utm_campaign=howto_ollama)**", "url": "https://wpnews.pro/news/how-to-run-local-llms-with-ollama-and-plug-them-into-your-coding-agent", "canonical_source": "https://dev.to/dedupedai/how-to-run-local-llms-with-ollama-and-plug-them-into-your-coding-agent-4ce0", "published_at": "2026-10-25 03:40:01+00:00", "updated_at": "2026-10-25 03:40:55.976202+00:00", "lang": "en", "topics": ["large-language-models", "ai-tools", "ai-agents", "developer-tools", "ai-products"], "entities": ["Ollama", "Claude Code", "Codex", "OpenCode", "Copilot CLI", "llama.cpp", "Gemma", "DeepSeek"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/how-to-run-local-llms-with-ollama-and-plug-them-into-your-coding-agent", "markdown": "https://wpnews.pro/news/how-to-run-local-llms-with-ollama-and-plug-them-into-your-coding-agent.md", "text": "https://wpnews.pro/news/how-to-run-local-llms-with-ollama-and-plug-them-into-your-coding-agent.txt", "jsonld": "https://wpnews.pro/news/how-to-run-local-llms-with-ollama-and-plug-them-into-your-coding-agent.jsonld"}}