Why you don't need heavy frameworks to build local AI agents—just a list, a while loop, and your local model

Discussion

I posted this over in r/aiagents and it sparked a massive debate on architecture. I wanted to share it here because the 'framework-free' approach is particularly powerful for the Local LLM workflow.

When you're running models locally (via Ollama, vLLM, etc.), you want every token to count. Most frameworks add layers of abstraction that make it harder to debug local latency or context window issues.

The Core Idea:

  • You can build a fully functional coding agent in ~40 lines of Python.
  • No LangChain, no complex DAGs—just a simple list and a loop.
  • It gives you total control over the prompt and the tool-calling loop, which is essential when tuning for specific local models like Llama 3 or Mistral.

I'm currently the maintainer of jq. I wrote a book called 'Build Your Own Coding Agent' that dives deep into this 'minimalist' philosophy for production.

Check out the original discussion and the code snippet below. Curious to hear how you guys are handling state management for local agents without the bloat.

Posted Mar 6, 2026, 3:43 PM UTC

10
Loading comments…