100% Local Agentic AI Coding Setup in 2026 | OpenCode + Ollama + Qwen3-Coder AI Model | Agentic, by CodeWithRajRanjan on YouTube. 32 min 11 s.
- Video length
- 32 min 11 s
- Time to do it
- 45 minutes
- Difficulty
- Medium
- Steps
- 10
What you need
Steps
Install Ollama and confirm it runs by opening a terminal and checking the version. Keep the Ollama service running in the background for the rest of the setup.
Install OpenCode using its installer or package manager for your system, then run it once to confirm the command works.
Pull the Qwen3-Coder 30B model in Ollama with the pull command for that model tag. Wait for the download to finish before testing.
Watch GPU and RAM usage while the model loads so you know it fits in memory. If it spills to system RAM, expect slow replies.
Create a new project folder for the to-do app and open a terminal inside it. This folder is where the agent will write files.
Point OpenCode at your local Ollama endpoint and select the Qwen3-Coder model in its configuration. Save the config and restart OpenCode.
Ask the agent to build the to-do app and let it create files. If it fails or loops, note the error before changing settings.
Raise Ollama's context size from 4K to 32K in the model or server settings, then update the OpenCode config to match. Restart both.
Retry the build with the larger context and let the agent generate the app files. Then run the app and test adding and removing tasks.
Ask the agent for one more feature, such as editing a task, and check the files it changes. Review the diff before keeping it.
Tips and common mistakes
A 30B model needs a lot of memory, so a smaller quant or smaller model may be the only option on modest hardware.
Small context windows cause agent loops and broken edits, so set 32K before asking for a full app.
Keep the project in a git repo so you can undo any bad file the agent writes.
Run the app yourself after each agent change instead of trusting the summary it gives.
Questions
Can I run this without a GPU?
Yes, but a 30B model on CPU will be very slow. Use a smaller model or a lower quant to make it usable.
Can OpenCode talk to Ollama on another computer?
Yes. Set Ollama to listen on the network and point OpenCode's base URL at that machine's IP and port.
Why does the agent keep failing halfway?
The context window is usually too small. Raise it in Ollama and in the OpenCode config, then restart both.
This guide was drafted from the video's details and general task knowledge. It has not been checked against the full video. Check the video and relevant product instructions before following a procedure. Report a correction.



