<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rajab Baig</title>
    <description>The latest articles on DEV Community by Rajab Baig (@rajab_baig_a3929cefc3758b).</description>
    <link>https://dev.to/rajab_baig_a3929cefc3758b</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3920991%2F50162320-09ca-4dfd-9876-57b86fef30ec.jpg</url>
      <title>DEV Community: Rajab Baig</title>
      <link>https://dev.to/rajab_baig_a3929cefc3758b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rajab_baig_a3929cefc3758b"/>
    <language>en</language>
    <item>
      <title>My Turing Solstice Project: A Narrative Puzzle Game Powered by Gemini AI</title>
      <dc:creator>Rajab Baig</dc:creator>
      <pubDate>Thu, 18 Jun 2026 19:35:50 +0000</pubDate>
      <link>https://dev.to/rajab_baig_a3929cefc3758b/my-turing-solstice-project-a-narrative-puzzle-game-powered-by-gemini-ai-24mi</link>
      <guid>https://dev.to/rajab_baig_a3929cefc3758b/my-turing-solstice-project-a-narrative-puzzle-game-powered-by-gemini-ai-24mi</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/june-game-jam-2026-06-03"&gt;June Solstice Game Jam&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Video Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dev.tourl"&gt;&lt;/a&gt;&lt;br&gt;
  &lt;iframe src="https://www.youtube.com/embed/2T048MnJWGY"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/rajab-rajab" rel="noopener noreferrer"&gt;
        rajab-rajab
      &lt;/a&gt; / &lt;a href="https://github.com/rajab-rajab/June-Solstice-Game-Jam" rel="noopener noreferrer"&gt;
        June-Solstice-Game-Jam
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      We are celebrating authenticity and LGBTQIA+ history with Pride month, which also happens to be the birth month of Alan Turing – the famous computer scientist behind the "Turing Test" for artificial intelligence who was persecuted for being gay. June also marks Juneteenth, a day to celebrate an important milestone towards the freedom.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;The Turing Solstice&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;A narrative logic puzzle game for the June Solstice Game Jam&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Every code can be broken. Every wall can fall. Every self can be free."&lt;/em&gt; — The Machine, at Solstice&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🎯 Concept&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;You are an apprentice to Alan Turing. The Solstice is a cosmic event where the barrier between human intelligence and artificial intelligence is thinnest.&lt;/p&gt;
&lt;p&gt;The screen is &lt;strong&gt;split in two&lt;/strong&gt;:&lt;/p&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;☀️ LIGHT PANEL (Day)&lt;/th&gt;
&lt;th&gt;🌙 DARK PANEL (Night)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Solve logic gate puzzles&lt;/td&gt;
&lt;td&gt;Commune with The Machine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Visual, click-based&lt;/td&gt;
&lt;td&gt;Text terminal, type to speak&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AND · OR · NOT gates&lt;/td&gt;
&lt;td&gt;Gemini AI responds in character&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;The Machine's personality changes&lt;/strong&gt; based on your Solstice Energy (Sunlight meter) — from COLD and cryptic to RADIANT and celebratory. On the actual solstice (June 21), the game unlocks special content.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🏆 Why This Wins&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Best Google AI Usage&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Gemini is &lt;strong&gt;mechanically essential&lt;/strong&gt; — not a chatbot add-on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Generates puzzles&lt;/strong&gt;…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/rajab-rajab/June-Solstice-Game-Jam" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;By creating this project The Turing Solstice was a milestone in the way of historical tribute and modern artificial intelligence. I chose Python and Pygame for its flexibility and usefulness. Python,  pygame and gemini model are the core engine because using them I create a "retro-technical" aesthetic that mimics the computing world of the 1950s.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Dual-Core Gameplay Engine
The most interesting technical challenge was the split-screen architecture. The game runs two separate systems simultaneously:
The Light Panel: A custom-built logic gate simulator. I built a modular "Gate Class" that evaluates inputs (AND, OR, NOT) in real-time.
The Dark Panel: A retro terminal emulator. I built a typewriter-style text renderer that controls "The Machine's" responses, complete with scanlines and a phosphor glow effect.&lt;/li&gt;
&lt;li&gt;Making AI "Mechanically Essential" (Gemini 3.1 Flash Light)
For the Best Google AI Usage category, I didn't want a generic chatbot. Instead, I integrated Gemini 3.1 Flash light directly into the game’s state machine.
The Personality Shift: I used a dynamic prompting system. Gemini is fed the current sunlight_meter value. If the meter is low (Darkness), Gemini uses a "Cold/Cryptic" system prompt. As the player solves logic puzzles and increases "Sunlight," the system prompt updates in real-time to "Warm" or "Radiant," changing the machine's tone and willingness to help.
Procedural Puzzles: Gemini generates unique cipher challenges (ROT13, A1Z26, etc.) on the fly, ensuring that no two playthroughs are exactly the same.&lt;/li&gt;
&lt;li&gt;Real-World Time Integration
To honor the June Solstice, I used Python's datetime module to check the local system clock. If the game is launched on June 21st, the UI colors shift into a "Convergence" palette, and the AI acknowledges the specific astronomical transition, bridging the gap between the player's reality and the game world.&lt;/li&gt;
&lt;li&gt;Weaving the Narrative
The progression system is tied to "Found Documents." These aren't just lore; they are milestones of history. I curated specific fragments related to:
Alan Turing’s 1952 persecution to highlight the theme of authenticity.
General Order No. 3 (Juneteenth) to parallel the theme of "delayed liberation."
The Stonewall Uprising to tie the struggle for identity back to June’s Pride Month.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prize Category
&lt;/h2&gt;

&lt;p&gt;I am officially submitting The Turing Solstice for the following two categories:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Google AI Usage
In this project, "gemini-3.1-flash-lite" is not just a mere  addition—it works as a functional game engine, brain of project.
State-Aware AI: The AI is integrated into the game's logic. By feeding the current sunlight meter value into the system prompt, the AI’s personality shifts dynamically, as the player progresses.
Procedural Content: Gemini generates unique ciphers and narrative clues on the fly, ensuring that the "Dark Panel" terminal feels alive and unpredictable.
Intelligent Evaluation: The AI evaluates the player’s narrative responses, granting "Sunlight Energy" based on the creativity and relevance of their answers, rather than just checking for static keywords.&lt;/li&gt;
&lt;li&gt;Best Ode to Alan Turing
This game is a tribute to the "father of modern computing" on multiple levels:
Scientific Tribute: The core gameplay loop—solving logic gates and ciphers—is a direct mechanical representation of Turing’s work at Bletchley Park and his innovative development on the ACE (Automatic Computing Engine).
Historical Narrative: As players solve puzzles, they unlock "Found Documents" that explore Turing’s 1950 paper on machine intelligence and the tragic history of his persecution.
Intersectional Recognition: By launching during the June Solstice and Pride month, the game honors Turing’s legacy as a scientist, a metaphor for the struggle for authenticity and freedom.
If API KEY FAILS PROGRAM WOULD RUN ON ITS OWN.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>devchallenge</category>
      <category>gamechallenge</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>Mr.PERFECT---TO PERFORM AGENTIC TASKS USING LOCAL LLM</title>
      <dc:creator>Rajab Baig</dc:creator>
      <pubDate>Sun, 07 Jun 2026 05:16:49 +0000</pubDate>
      <link>https://dev.to/rajab_baig_a3929cefc3758b/mrperfect-to-perform-agentic-tasks-using-local-llm-21lj</link>
      <guid>https://dev.to/rajab_baig_a3929cefc3758b/mrperfect-to-perform-agentic-tasks-using-local-llm-21lj</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/github-2026-05-21"&gt;GitHub Finish-Up-A-Thon Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;What I Built: Agent Mr. Perfect&lt;br&gt;
The Backstory&lt;br&gt;
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.&lt;br&gt;
The "Before": A Local LLM Server&lt;br&gt;
Before this submission, my project was essentially a local hosting setup.&lt;br&gt;
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.&lt;br&gt;
The Workflow: It was a "Prompt-In, Text-Out" system. I had a server listening on main: model loaded&lt;br&gt;
main: server is listening on &lt;a href="http://127.0.0.1:5005" rel="noopener noreferrer"&gt;http://127.0.0.1:5005&lt;/a&gt;&lt;br&gt;
main: starting the main loop...&lt;br&gt;
02:07:49-662877 INFO     Loaded "D:\NEW-MODELS\New folder (22)\gemma-4-E4B-it-Q4_K_M.gguf" in 27.61 seconds.&lt;br&gt;
02:07:49-662877 INFO     LOADER: "llama.cpp"&lt;br&gt;
02:07:49-662877 INFO     CONTEXT LENGTH: 131072&lt;br&gt;
02:10:22-236834 INFO     OpenAI/Anthropic-compatible API URL:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                     http://127.0.0.1:5000/v1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Running on local URL:  &lt;a href="http://127.0.0.1:7860" rel="noopener noreferrer"&gt;http://127.0.0.1:7860&lt;/a&gt;, providing an OpenAI-compatible API, but I had to manually interact with it for every single response.&lt;br&gt;
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.&lt;br&gt;
The "After": Agent Mr. Perfect (The Agentic Shift)&lt;br&gt;
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."&lt;br&gt;
Autonomous Task Planning: Instead of just responding to a prompt, Mr. Perfect now breaks down complex goals into smaller, executable steps.&lt;br&gt;
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.&lt;br&gt;
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.&lt;br&gt;
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.&lt;br&gt;
Why it matters&lt;br&gt;
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.&lt;br&gt;
Key Technical Details for your Documentation:&lt;br&gt;
Model Used: gemma-4-E4B-it-Q4_K_M.gguf (Quantized for efficiency)&lt;br&gt;
Inference Engine: llama.cpp[1]&lt;br&gt;
Architecture: Local API Server + Custom Agentic Logic Layer&lt;br&gt;
Primary Focus: Privacy-focused automation and multi-step task execution.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/rajab-rajab" rel="noopener noreferrer"&gt;
        rajab-rajab
      &lt;/a&gt; / &lt;a href="https://github.com/rajab-rajab/github-challenge-2026-Mr.Perfect" rel="noopener noreferrer"&gt;
        github-challenge-2026-Mr.Perfect
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      I Built: Agent Mr. Perfect for github dev challenge-May-2026
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;github-challenge-2026-Mr.Perfect&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;I Built: Agent Mr. Perfect for github dev challenge-May-2026&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/rajab-rajab/github-challenge-2026-Mr.Perfect" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;h2&gt;
  
  
  The Comeback Story
&lt;/h2&gt;

&lt;p&gt;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. &lt;/p&gt;

&lt;h2&gt;
  
  
  My Experience with GitHub Copilot
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>githubchallenge</category>
    </item>
    <item>
      <title>MY PROTRAIT MAKER</title>
      <dc:creator>Rajab Baig</dc:creator>
      <pubDate>Sat, 23 May 2026 20:40:42 +0000</pubDate>
      <link>https://dev.to/rajab_baig_a3929cefc3758b/my-protrait-maker-5c88</link>
      <guid>https://dev.to/rajab_baig_a3929cefc3758b/my-protrait-maker-5c88</guid>
      <description>&lt;p&gt;&lt;em&gt;This post is my submission for &lt;a href="https://dev.to/deved/build-apps-with-google-ai-studio"&gt;DEV Education Track: Build Apps with Google AI Studio&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I build an RPG Character Portrait Generator that successfully uses both Gemini&lt;br&gt;
(to expand simple ideas into detailed descriptions) and Imagen (to turn those descriptions into art), use the prompts below.&lt;br&gt;
Prompt: "Build a web application called 'My Portrait Maker.'&lt;/p&gt;

&lt;p&gt;Features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; User Input: A text field for character name and a dropdown for 'Universe'
(choices: High Fantasy, Cyberpunk, Cosmic Horror, Steampunk,
Post-Apocalyptic).&lt;/li&gt;
&lt;li&gt; Character Traits: Add buttons or chips for Race (Human, Elf, Orc, Android,
etc.) and Class (Warrior, Mage, Hacker, Pilot).&lt;/li&gt;
&lt;li&gt; The Logic: When the user clicks 'Generate', the app should first send the
user's choices to Gemini to write a 50-word, highly detailed cinematic
visual description of the character.&lt;/li&gt;
&lt;li&gt; Image Generation: Take that Gemini-generated description and pass it
automatically to the Imagen API to generate a high-quality 1:1 portrait.&lt;/li&gt;
&lt;li&gt; Gallery: Display the generated image alongside the character name and the
description Gemini wrote. Include a 'Download' button to save the portrait
as a PNG.&lt;/li&gt;
&lt;li&gt; Persistence: Use localStorage so the user can see their previous character
creations in a 'History' section.&lt;/li&gt;
&lt;li&gt;Add an API Key input field in the App UI so I can paste my key directly into the running app to test it.
Styling: Use a dark, professional 'gaming' theme with gold accents and a
responsive layout."&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://my-portrait-maker-652806875882.asia-southeast1.run.app" rel="noopener noreferrer"&gt;https://my-portrait-maker-652806875882.asia-southeast1.run.app&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Experience
&lt;/h2&gt;

&lt;p&gt;I learned how a good and powerful prompt can be converted into a stunning application. Technology is getting so advanced that user can create what he imagines.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkhebrzvkhdm99u548mww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkhebrzvkhdm99u548mww.png" alt="A high-quality wide-angle banner for a digital app called " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>deved</category>
      <category>learngoogleaistudio</category>
      <category>ai</category>
      <category>gemini</category>
    </item>
    <item>
      <title>AGENT Mr. PERFECT AND GEMMA 4 E4B</title>
      <dc:creator>Rajab Baig</dc:creator>
      <pubDate>Sat, 23 May 2026 06:13:50 +0000</pubDate>
      <link>https://dev.to/rajab_baig_a3929cefc3758b/agent-mr-perfect-and-gemma-4-e4b-f99</link>
      <guid>https://dev.to/rajab_baig_a3929cefc3758b/agent-mr-perfect-and-gemma-4-e4b-f99</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/google-gemma-2026-05-06"&gt;Gemma 4 Challenge: Build with Gemma 4&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;My project is based on Google Gemma 4 variant E4B model. 1- I created an Agent that perform different agentic tasks named as tools which consists of powershell commands, content creation, coding tasks using python, html, php, c, c++ languages. I used gguf file of E4B model 4.63 GB named gemma-4-E4B-it-Q4_K_M.gguf&lt;br&gt;
I developed powerful Agentic AI - Local LLM Assistant, a high-performance desktop orchestration layer powered by the Google Gemma 4 E4B (it-Q4_K_M) model.&lt;br&gt;
As many AI assistants are confined to a chat box, my project bridges the gap between conversational AI and OS-level execution. I designed it for developers, system administrators, and power users who need a powerful local, private agent capable of managing a Windows environment through natural language.&lt;br&gt;
By leveraging the advanced reasoning and instruction-following capabilities of the Gemma 4 E4B model, the agent can intelligently select and chain together over 50+ specialized tools to perform complex system tasks. No doubt Agent Mr. Perfect works as Brain and Gemma 4 E4B as Heart in the project. &lt;br&gt;
Core Capabilities:&lt;br&gt;
🖥️ Advanced System &amp;amp; Windows Admin: The agent uses Gemma 4’s logic to generate and execute precise authorized PowerShell commands for monitoring system health, managing Windows services, inspecting registry keys, and analyzing event log and using other tools----- all without the user needing to remember complex syntax.&lt;br&gt;
💻 Multi-Language Coding Assistant: A sandbox-ready environment where the agent can write, debug, and execute code in Python, HTML, PHP, C, and C++. It doesn't just write code; it can create the files and execute them locally to verify results.&lt;br&gt;
🌐 Autonomous Web-Augmented Reasoning: When the local model identifies a gap in its training data (such as current events or specific documentation), it autonomously triggers a web search via the Tavily API, parses the results, and provides answers with verified URLs.&lt;br&gt;
📁 Intelligent File Management: A robust suite of tools for file operations (create, hash, move, search) protected by a sophisticated Self-Protection Layer that prevents the AI from modifying critical system files or its own source code.&lt;br&gt;
🛡️ Secure Local Execution: Built for privacy-conscious users, the system runs entirely on a local server (via text-generation-webui), ensuring that sensitive system data and code never leave the local machine.&lt;br&gt;
Here is the command used to load Gemma4 E4B &lt;br&gt;
python server.py --cpu --listen-host 127.0.0.1 --listen-port 7860 --loader llama.cpp --model "D:\NEW-MODELS\New folder (22)\gemma-4-E4B-it-Q4_K_M.gguf" --auto-launch&lt;br&gt;
Here is the output of generated command&lt;br&gt;
main: model loaded&lt;br&gt;
main: server is listening on &lt;a href="http://127.0.0.1:5005" rel="noopener noreferrer"&gt;http://127.0.0.1:5005&lt;/a&gt;&lt;br&gt;
main: starting the main loop...&lt;br&gt;
22:33:57-707819 INFO     Loaded "D:\NEW-MODELS\New folder (22)\gemma-4-E4B-it-Q4_K_M.gguf" in 42.22 seconds.&lt;br&gt;
22:33:57-707819 INFO     LOADER: "llama.cpp"&lt;br&gt;
22:33:57-707819 INFO     CONTEXT LENGTH: 131072&lt;br&gt;
22:37:00-762808 INFO     OpenAI/Anthropic-compatible API URL:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                     http://127.0.0.1:5000/v1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Running on local URL:  &lt;a href="http://127.0.0.1:7860" rel="noopener noreferrer"&gt;http://127.0.0.1:7860&lt;/a&gt;&lt;br&gt;
As model is running on http port 7860 with chat-ui. It means user can chat directly with Gemma 4 E4B and set Question &amp;amp; Answer session with loaded model.&lt;br&gt;
And for agentic tasks I would first run my agent.py file which would use OpenAI/Anthropic-compatible API URL:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                     http://127.0.0.1:5000/v1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;to make API calls to the loaded Gemma 4 E4B model i.e Agent would work as Brain and Gemma 4 E4B as Heart of the project.&lt;br&gt;
Here is the command to launch my Agent Mr. Perfect&lt;br&gt;
C:\Users\RAJAB BAIG\Documents\GitHub\BAIG\PERFECT&amp;gt;python agent.py&lt;br&gt;
It would open our GUI-Interface based Agent Mr. PERFECT&lt;br&gt;
The Brain (Agent Mr. Perfect): This is the orchestration layer of my Project. It handles the "cold logic"—the 65+ tools, the PowerShell administration, file hashing, and multi-language code execution (Python, C, PHP). It is the structural "Perfect" execution of tasks.&lt;br&gt;
My Agent Mr. PERFECT answers in FOUR STEPS ONE BY ONE.&lt;br&gt;
The Problem It Solves:&lt;br&gt;
As modern workflows often require jumping between a web browser for research or visiting a URL, a terminal for system commands, and an IDE for coding. Agentic AI combines and unifies these into a single, modern GUI. By using Gemma 4 E4B, the assistant understands the "intent" behind a user's request—like "Optimize my system for gaming"—and translates that into a series of diagnostic and administrative actions. It works as mind body relationship.&lt;br&gt;
I also added SAVE SESSION AND LOAD SESSION functionalities to make my Agent and Gemma 4 E4B project modern and robust. The Save/Load functionality transforms Agent Mr. Perfect from a temporary chat interface into a persistent engineering assistant. By capturing and ensuring the synergy between Gemma 4’s reasoning and local tool execution in a structured JSON format, I provide users with a transparent, safe, auditable, and private record of their AI-driven workflow that they can check and use anytime.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;[(&lt;a href="https://youtu.be/cbrrgWRNvkw)" rel="noopener noreferrer"&gt;https://youtu.be/cbrrgWRNvkw)&lt;/a&gt;]&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/rajab-rajab/gemma4-agentic-gui-app" rel="noopener noreferrer"&gt;https://github.com/rajab-rajab/gemma4-agentic-gui-app&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Used Gemma 4
&lt;/h2&gt;

&lt;p&gt;For this project, I chose the Gemma 4 E4B (it-Q4_K_M) model. As an "Engineering-for-Business" variant, it provides the precise reasoning required to handle system-level administration and multi-language coding tasks without the massive hardware requirements of larger dense models. As it has suitable memory space i.e 4.63 GB, it is easy to work for 20 GB RAM of mine only CPU machine. &lt;br&gt;
🧠 The Heart of the Orchestration Layer&lt;br&gt;
Gemma 4 E4B serves as the central decision-maker. Unlike standard chat models, I utilized Gemma’s advanced instruction-following capabilities to act as a Tool Orchestrator. When a user submits a prompt like "Check my CPU and if it's over 80%, tell me which process is the culprit," Gemma 4:&lt;br&gt;
Analyzes the intent.&lt;br&gt;
Selects the appropriate system tools (get_system_info and get_processes).&lt;br&gt;
Parses the raw data returned by the OS.&lt;br&gt;
Synthesizes a human-readable explanation.&lt;br&gt;
🛠️ Precision Engineering &amp;amp; PowerShell Generation&lt;br&gt;
The E4B variant shines in its ability to generate syntactically correct code. I leveraged its strengths to:&lt;br&gt;
Generate PowerShell Scripts: Gemma 4 generates complex Windows Admin commands for registry queries and service management on the fly.&lt;br&gt;
Multi-Language Logic: The model handles logic across Python, HTML, PHP, C, and C++, allowing the agent to not only write scripts but also explain the logic and debug execution errors in the local environment.&lt;br&gt;
🔍 Autonomous Reasoning &amp;amp; Web Fallback&lt;br&gt;
I implemented a "Self-Awareness" loop using Gemma 4. If the model determines that its local tools or internal training data are insufficient to answer a query (e.g., "What is the current version of React?"), it is programmed to autonomously trigger a Web Search Fallback. It then processes the search snippets to extract the most relevant information and presents them as interactive, URLs.&lt;br&gt;
🛡️ Safety and Constraint Adherence&lt;br&gt;
A critical part of using Gemma 4 was its ability to respect strict Self-Protection Rules. I provided the model with a system context that forbids it from interacting with its own source code (agent.py) or the LLM's binary files or pc system files and system disk. Through testing, Gemma 4 E4B demonstrated superior adherence to these safety guardrails compared to smaller models, ensuring the agent remains a helpful assistant rather than a system risk.&lt;br&gt;
⚡ Optimized Local Performance&lt;br&gt;
By using the 4.63 GB GGUF quantization (Q4_K_M), I achieved a balance of high intelligence and low latency. The model runs locally on consumer-grade hardware, ensuring that the system monitoring and file operations happen in near real-time, providing a "snappy" desktop experience while keeping all user data 100% private.&lt;br&gt;
"Mr. Perfect is not just a wrapper for Gemma 4; but it is a safety-first orchestration layer that translates Gemma’s engineering-grade reasoning into safe, fast, reliable, local actions."&lt;br&gt;
Here is a comprehensive list of the "Plus Points" for my project. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The "Heart &amp;amp; Brain" Architecture (Conceptual Innovation)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dual-Layer Intelligence: Instead of a generic chatbot, I have created a synergy between the Heart (Gemma 4 E4B) for high-level reasoning and the Brain (Mr. Perfect) for precise and exact and error free system execution. 
Intent Recognition: The system doesn't just "chat"; it also understands and uses engineering intent. If a user asks to "Fix the PC or want to run system commands," the agent knows to trigger diagnostic tools and commands rather than just giving advice.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Powered by Gemma 4 E4B (Model Optimization)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Engineering-for-Business (E4B) Precision: I chose the E4B variant specifically for its superior performance in generating high level technical programming code (Python, PowerShell, C++) and following complex and difficult business logic.&lt;/li&gt;
&lt;li&gt;Local Performance: By using the it-Q4_K_M GGUF quantization, I have achieved a perfect balance: high intelligence (reasoning) and accuracy with low latency (speed) on consumer-grade hardware. As it uses minimal resources in RAM and disk space.&lt;/li&gt;
&lt;li&gt;Private &amp;amp; Offline: The model runs 100% locally. A protected environment where no data ever leaves the user's machine, making it suitable and important for corporate and sensitive engineering environments.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Professional Grade Toolset (65+ Built-in Tools)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OS-Level Integration: While most AI agents are "sandboxed," Mr. Perfect has deep integration with Windows via PowerShell Admin Tools, allowing for real-time system monitoring, registry edits, and service management.&lt;/li&gt;
&lt;li&gt;The Developer's Swiss Army Knife: Built-in capabilities for Code Creation, Creating files and folders, Syntax Checking, and Immediate Execution across multiple languages (Python, HTML, JS).&lt;/li&gt;
&lt;li&gt;Web-Augmented Reasoning: When local knowledge isn't enough, the agent autonomously and efficiently uses the Tavily API to fetch real-time data, presenting it with Verified URLs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Advanced Session Management (The "Black Box")&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Persistence (Save/Load): Its ability to save sessions to JSON transforms the agent from a temporary chat into a persistent workspace for developers and software engineers.&lt;/li&gt;
&lt;li&gt;Auditability: The JSON logs provide a transparent and neat record of each and every step of "Action" and "Argument," which is critical for business stability, accountability and debugging.&lt;/li&gt;
&lt;li&gt;Ease of Any time Context Restoration: Users can stop and close mid-project, save their current session, and reload it later to pick up and start exactly where Gemma 4 left off.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;"Responsible AI" &amp;amp; Safety (The Self-Protection Layer)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Self-Preservation Logic: The agent is hard-coded to never delete its own source code (agent.py) or the LLM binaries. This prevents "Agentic Suicide" or accidental system damage.&lt;/li&gt;
&lt;li&gt;System Guardrails: It recognizes protected Windows directories and system files, refusing to perform "Delete" operations on critical OS components.&lt;/li&gt;
&lt;li&gt;Human-in-the-Loop: Critical actions (like system shutdown or bulk file deletion) require explicit user confirmation through the modern GUI.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Modern &amp;amp; Intuitive UX (CustomTkinter GUI)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clean Dark Theme: A professional, tech-focused interface that reduces eye strain for long engineering and coding sessions.&lt;/li&gt;
&lt;li&gt;Dynamic Status Feedback: The UI provides real-time updates (e.g., "Step 1/4: Tool Execution: "), so the user is never left wondering what the agent is "thinking."&lt;/li&gt;
&lt;li&gt;Rich Text Features: Support for URLs, color-coded message tags. Quick Prompt buttons for common tasks.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Resilient Execution (The 4-Iteration Loop)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Autonomous Problem Solving: The agent uses a multi-step thinking process while working with Gemma4. If a code execution fails, it reads the error, searches for a fix, modifies the code, and tries again—all in one session.&lt;/li&gt;
&lt;li&gt;Synthetic Final Answers: if the agent exhausts its loop during a tool call, it provides a logical summary of its actions, ensuring the user is always well informed and aware.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Clean and neat Code &amp;amp; High Portability&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Single-File Power: Most of the core logic is contained in agent.py, making it incredibly easy for other developers to download, inspect, and run.&lt;/li&gt;
&lt;li&gt;Standardized Data: By using standard JSON for sessions and Markdown for code, your project integrates perfectly into existing developer workflows (like GitHub and VS Code).
I am still working on Install, Uninstall, Update, Shutdown and Restart functionalities. However, most of powershell tools are working fine.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fttrupbm4ybnknwrxmscj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fttrupbm4ybnknwrxmscj.png" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gemmachallenge</category>
      <category>gemma</category>
    </item>
  </channel>
</rss>
