DEV Community

Rajab Baig
Rajab Baig

Posted on

Mr.PERFECT---TO PERFORM AGENTIC TASKS USING LOCAL LLM

GitHub “Finish-Up-A-Thon” Challenge Submission

This is a submission for the GitHub Finish-Up-A-Thon Challenge

What I Built

What I Built: Agent Mr. Perfect
The Backstory
I started with a folder full of local LLM tools and a desire and wish to run AI model locally completely offline for accuracy, privacy and speed. However, for a long time due to my workings, the project was just a "server in a box"—I could chat with it, but it couldn't do anything. It was a powerful engine with no wheels. This challenge gave me the push to build the "wheels": a custom agentic layer I call Agent Mr. Perfect.
The "Before": A Local LLM Server
Before this submission, my project was essentially a local hosting setup.
The Tech: I was using text-generation-webui as a backend to run quantized models like Gemma (via llama.cpp). It run perfectly on only CPU 20 GB RAM and 1TD SSD and NVME device.
The Workflow: It was a "Prompt-In, Text-Out" system. I had a server listening on main: model loaded
main: server is listening on http://127.0.0.1:5005
main: starting the main loop...
02:07:49-662877 INFO Loaded "D:\NEW-MODELS\New folder (22)\gemma-4-E4B-it-Q4_K_M.gguf" in 27.61 seconds.
02:07:49-662877 INFO LOADER: "llama.cpp"
02:07:49-662877 INFO CONTEXT LENGTH: 131072
02:10:22-236834 INFO OpenAI/Anthropic-compatible API URL:

                     http://127.0.0.1:5000/v1
Enter fullscreen mode Exit fullscreen mode

Running on local URL: http://127.0.0.1:7860, providing an OpenAI-compatible API, but I had to manually interact with it for every single response.
The Limitation: The AI was "limited" in the terminal. It had no way to access my local files, search the web, or execute multi-step tasks. If I wanted to research a topic and summarize it, I had to do the research myself and paste the text into the UI.
The "After": Agent Mr. Perfect (The Agentic Shift)
For my submission, I transformed this local server into a fully-functional Agentic System. I built Agent Mr. Perfect to bridge the gap between "Chatting" and "Acting."
Autonomous Task Planning: Instead of just responding to a prompt, Mr. Perfect now breaks down complex goals into smaller, executable steps.
Tool Integration: I connected the local LLM to a suite of "tools" (Python scripts and APIs) that allow it to perform actions like file manipulation, web searching, and data processing.
Persistent Memory: I implemented a local state-management system so the agent remembers the context of a long-term project across different sessions, rather than forgetting everything the moment the server restarts. With Save Session and Load Session Commands, one can start where it stopped his work.
The "Perfect" Standard: I refined the system prompts and error-handling loops to ensure the agent self-corrects. If a task fails, Mr. Perfect analyzes the error and tries a different approach until the task is complete. I has four steps loop to complete a task.
Why it matters
By moving from a standard UI to an agentic workflow, I've created a private, local-first assistant that can actually manage workflows. I’m no longer just running an LLM; I’ve built a partner that handles the "heavy lifting" of my development tasks and work loads without a single byte of data leaving my machine.
Key Technical Details for your Documentation:
Model Used: gemma-4-E4B-it-Q4_K_M.gguf (Quantized for efficiency)
Inference Engine: llama.cpp[1]
Architecture: Local API Server + Custom Agentic Logic Layer
Primary Focus: Privacy-focused automation and multi-step task execution.

Demo

GitHub logo rajab-rajab / github-challenge-2026-Mr.Perfect

I Built: Agent Mr. Perfect for github dev challenge-May-2026

github-challenge-2026-Mr.Perfect

I Built: Agent Mr. Perfect for github dev challenge-May-2026




The Comeback Story

As earlier mentioned before it was a simple local model server running locally on my windows machine. After reading cgallenge, I decided to work for a Agent to perform different agentic tasks, coding, web browsing, system commands etc 109 tolls running on my machine.Before I prepared single file Agent comprised of more than 4000 lines of code . which I presented for Dev Gemma 4 challenge. But for Github challenge I decided to choose Divide and Conquer rule. Breaking my code in different code files using decorative approach using instances rather than static methods.

My Experience with GitHub Copilot

It really helped me in preparing Mr. Perfect. I used first plan and then implement approach. Github copilot and AI suggested decorative approach to divide my code base into tool files, and as a result I created a remarkable application.

Top comments (0)