100-Iteration Autonomous Coding Loop with Local Qwen on an RTX 3090
Melvin Vivas · X post · 2026-10-22 · Open on X
Topics: AI Agents, Tool Use & MCP, AI Dev Tools & Productivity, LLMOps, Deployment & Monitoring · Level: intermediate
Summary
The creator runs an autonomous agent loop that improves a CRM app for 100 iterations, using a local quantized Qwen model at no cost. The setup is Qwen3.8-27B-Q4_K_M (Unsloth quant) on one RTX 3090, driven by Pi agent and its loop plugin. After about 6 hours (counted from a restart to change the prompt) it was on iteration 21 of 100.
Key points
- Model: Qwen3.8-27B in Unsloth's Q4_K_M quantization, running locally on one RTX 3090 (24 GB).
- Harness: Pi agent with the loop plugin, set to 100 iterations.
- Prompt for each iteration: check the code, find an improvement, make it, and verify it.
- Speed: about 21 iterations in about 6 hours, so roughly 17 minutes per iteration.
- Running locally makes an overnight loop free apart from electricity.
- Rewriting the prompt meant restarting the loop, so get the prompt right early.
Resources mentioned
- Qwen3.8-27B-Q4_K_M (Unsloth) · tool · huggingface.co · free
A 4-bit (Q4_K_M) quantized version of the 27B Qwen model from Unsloth, small enough to run on one consumer GPU.
Also in: Prompting an Autonomous Agent Loop: Be Specific, Show Visible Progress (Melvin Vivas on X · notes), Running an Overnight 100-Iteration Agent Loop with a Local Qwen Model (Melvin Vivas on X · notes), Use a Hugging Face Inference Endpoint as a Custom Model Provider in Pi Agent (Melvin Vivas on X · notes), Pi Agent on a Self-Deployed Qwen 27B Q4_K_M via Hugging Face Inference Endpoints (Melvin Vivas on X · notes) and 5 more - Unsloth · tool · unsloth.ai · free
Open-source library for fast, memory-efficient fine-tuning of open LLMs (LoRA/QLoRA) on a single GPU or in Colab.
Also in: Prompting an Autonomous Agent Loop: Be Specific, Show Visible Progress (Melvin Vivas on X · notes), Running an Overnight 100-Iteration Agent Loop with a Local Qwen Model (Melvin Vivas on X · notes), Agent tasks: Unsloth fine-tuning, ComfyUI face swap, script writing (Melvin Vivas on X · notes), Train Your Own Decision Model Locally with Unsloth (Melvin Vivas on X · notes) and 36 more - Pi · tool · x.com · free
A customizable coding agent that can be extended through its Extensions API and connected to several model providers.
Also in: Pi Agent: A Highly Customizable Agent with Durable Sessions (Melvin Vivas on X · notes), Prompting an Autonomous Agent Loop: Be Specific, Show Visible Progress (Melvin Vivas on X · notes), Running an Overnight 100-Iteration Agent Loop with a Local Qwen Model (Melvin Vivas on X · notes), Run Pi with local models on an RTX Spark laptop via llama.cpp (Melvin Vivas on X · notes) and 54 more
Try this
- Write a clear, specific per-iteration prompt before starting a long autonomous loop.
- Run an overnight local-model agent loop that keeps finding, making and checking improvements in an existing app.
More in AI Agents, Tool Use & MCP
- Grok Bot Adds 1Password Integration for Agent Logins
- Durable AI Agents with Pi Durable and Cloudflare Durable Objects
- How Non-Technical Users Use Grok Bot as a Thinking Partner
- Pi Agent: A Highly Customizable Agent with Durable Sessions
- Prompting an Autonomous Agent Loop: Be Specific, Show Visible Progress
- Grok Bot Can Manage X Livestreams via the X MCP