How to run a free local AI agent with Ollama on an 8 GB GPU

Set up Ollama in Ubuntu on WSL, pull a model that fits your 8 GB graphics card, and point Claude Code at it so an agent runs fully on your own PC. It suits beginners with a Windows machine and a mid-range GPU. No account or subscription is needed.

How to use a local AI Agent FREE on an 8 GB GPU: Ollama + Claude Code for Beginners, by Amplified Architect on YouTube. 10 min 2 s.

12 chapters. Tap a step to jump to it.Chapters from the creator
Video length
10 min 2 s
Time to do it
45 minutes
Difficulty
Medium
Steps
11

What you need

Steps

  1. Check your graphics card memory first. Run a GPU query in the terminal or check your system settings, and note the VRAM. An 8 GB card fits a model around 9B parameters at a reduced context.

  2. Open your Ubuntu terminal and install the missing compression tool with sudo apt install zstd. A fresh Ubuntu install usually lacks it, and the Ollama installer needs it.

  3. Install Ollama with the official script: curl -fsSL https://ollama.com/install.sh | sh. Wait for it to finish, then confirm the ollama command responds.

  4. Download a model that fits your card with ollama pull ornith:9b. Pick a smaller model if you have less VRAM. The download takes a few minutes.

  5. Start a chat with ollama run ornith:9b and send a short test prompt to confirm the model answers. This shows the difference between a plain chat model and an agent.

  6. Raise the context length inside the chat with /set parameter num_ctx 32768. Agents need a large context, and Ollama's default is too small for them to follow multi-step work.

  7. Save that setting as your own model version with /save ornith-agent. This keeps the bigger context so you do not set it again each time.

  8. Open Claude Code and choose the local model from Ollama's menu instead of signing in. This gives the agent hands to read and write files in your project folder.

  9. Ask the agent to build something small, like a single index.html fireworks page. Give clear, specific instructions about the file name and the behaviour you want.

  10. Open the page in your browser. If it breaks, open the browser console, copy the red error line, and paste it to the agent with a plain request to fix it.

  11. Improve the result in small steps, one change per prompt, such as bigger bursts or longer trails. Ask it to change only the file you name.

Tips and common mistakes

Keep prompts small and specific. A 9B model on 8 GB loses track on long, multi-part requests.

Always paste the exact browser console error. The agent fixes bugs much faster with the real message than with a vague description.

Close other GPU-heavy apps before running the model so it has the full 8 GB of VRAM.

Save your tuned model with /save so the context setting survives between sessions.

Questions

Do I need an account or subscription?

No. Ollama and the local model run on your own machine, and Claude Code connects to it without signing in. Nothing you type leaves your PC.

Will this work without a dedicated graphics card?

It can run on the CPU, but it will be much slower. A card with around 8 GB of VRAM gives usable speed for a 9B model.

Why does the agent ignore my instructions?

Ollama's default context is too small for agent work. Set num_ctx to 32768 and save it as your own model version.

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.

More in Computers & Phones

See all