Skip to content
Courses/Claude Code + Local AI/Local code agents with Ollama

Local code agents with Ollama

You can use local models for coding tasks without sending your project to the cloud, but you need to design the workflow with context, permissions, and verification. The promise isn't "same as Claude Code"; the good promise is privacy, predictable cost, and control.

  • Understand when a local code agent is worth it and when it isn't.
  • Configure Ollama for code models with enough context.
  • Create an edit and verification workflow that doesn't break your repo.

The honest map

A local agent works very well for bounded tasks: explaining code, generating tests, creating scripts, refactoring a small component, or preparing a change plan. For large migrations, huge repositories, or long reasoning, the norm is to use a hybrid approach: local for privacy and drafts, cloud for difficult decisions or final review.

The practical foundation is Ollama. Its official documentation lets you run models on macOS, Windows, and Linux, and expose a local API for integrations. On Apple Silicon, MLX can be useful for experiments and performance with unified memory, but it doesn't turn any laptop into an unlimited workstation.

Terminal
# 1. Comprueba Ollama
ollama --version
ollama list

# 2. Descarga un modelo de código o propósito general
ollama pull qwen2.5-coder:7b

# 3. Prueba una tarea pequeña
ollama run qwen2.5-coder:7b "Explica este bug: un array vacío rompe un reduce sin valor inicial"

# 4. API local para integraciones
curl http://localhost:11434/api/generate -d '{
  "model": "qwen2.5-coder:7b",
  "prompt": "Escribe una función TypeScript que valide emails sin dependencias.",
  "stream": false
}'

Checklist before letting it touch files

  • Work on a branch: never test a local agent on `main`.
  • Define scope: which folder it can read, which files it can edit, and which commands it can execute.
  • Require a plan: before editing, have it list files, risks, and success criteria.
  • Verify cold: install dependencies and run tests after the change.
  • Log metrics: time, tokens, errors, and commands executed.
Terminal
# Flujo mínimo para trabajar con seguridad
git checkout -b agent-local/tarea-pequena

# Pide primero un plan, no cambios
# Después de aplicar cambios:
npm install
npm run lint
npm run build
git diff --stat
git diff

Official sources

  • Ollama Quickstart
  • Ollama: context length
  • MLX documentation
Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue