<?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: Tejas</title>
    <description>The latest articles on DEV Community by Tejas (@tejas1koli).</description>
    <link>https://dev.to/tejas1koli</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3945815%2Ffe96ab50-e161-453c-be68-e94681330633.jpeg</url>
      <title>DEV Community: Tejas</title>
      <link>https://dev.to/tejas1koli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tejas1koli"/>
    <language>en</language>
    <item>
      <title>Gemma4 based local Mac assistant in Rust</title>
      <dc:creator>Tejas</dc:creator>
      <pubDate>Sun, 24 May 2026 18:22:04 +0000</pubDate>
      <link>https://dev.to/tejas1koli/gemma4-based-local-mac-assistant-in-rust-5g0i</link>
      <guid>https://dev.to/tejas1koli/gemma4-based-local-mac-assistant-in-rust-5g0i</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;&lt;strong&gt;mac-agent-rust&lt;/strong&gt; is an early-stage local AI agent that controls your Mac through&lt;br&gt;
natural language — running entirely on-device, no cloud, no API keys.&lt;/p&gt;

&lt;p&gt;It is under active development. Right now it can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;navigate Safari tabs&lt;/li&gt;
&lt;li&gt;Draft and compose mails in the Mail app&lt;/li&gt;
&lt;li&gt;Create notes in Apple Notes&lt;/li&gt;
&lt;li&gt;Display system notifications&lt;/li&gt;
&lt;li&gt;Get and set system volume&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You type what you want in plain English. The agent writes the AppleScript, runs it&lt;br&gt;
on your machine, reads the result, and responds. Everything stays local.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;


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

&lt;p&gt;&lt;a href="https://github.com/Tejas1Koli/mac-agent-rust" rel="noopener noreferrer"&gt;github.com/Tejas1Koli/mac-agent-rust&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Built with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rust&lt;/strong&gt; — agent loop, tool execution, history management&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rig&lt;/strong&gt; — LLM client and tool calling framework based on rust&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ollama&lt;/strong&gt; — local model inference&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;osascript&lt;/strong&gt; — AppleScript execution via macOS native runtime&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  How I Used Gemma 4
&lt;/h2&gt;

&lt;p&gt;I used &lt;strong&gt;Gemma 4 E4B MLX&lt;/strong&gt; — the 4 billion parameter multimodal variant running via&lt;br&gt;
Ollama's MLX backend, optimized specifically for Apple Silicon. On an M2 MacBook Air&lt;br&gt;
it runs fast with no fan spin, no internet, and no API key — pure on-device inference&lt;br&gt;
using the unified memory architecture.&lt;/p&gt;

&lt;p&gt;The agent runs Gemma 4 E4B in a tool-calling loop: receive task → write AppleScript&lt;br&gt;
→ call the tool → read output → respond. The MLX backend gets significantly better&lt;br&gt;
token throughput than llama.cpp on Apple Silicon, which matters for a conversational&lt;br&gt;
agent where latency is noticeable.&lt;/p&gt;

&lt;p&gt;E4B was the right fit — big enough to reliably generate valid AppleScript and follow&lt;br&gt;
strict tool-call formatting, small enough to run locally without breaking a sweat on&lt;br&gt;
consumer Mac hardware. macOS automation tasks are narrow and structured, not&lt;br&gt;
open-ended reasoning problems, so you don't need a 31B model to get good results.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Rust
&lt;/h2&gt;

&lt;p&gt;Most AI agents are Python. I wanted a single binary, proper error handling around&lt;br&gt;
arbitrary system command execution, and Tokio's async runtime for process timeouts.&lt;br&gt;
Rig made tool-calling feel native — a tool is just a trait, schema mismatches are&lt;br&gt;
caught at compile time. &lt;code&gt;cargo install&lt;/code&gt; and it runs, no virtualenv, no runtime.&lt;/p&gt;

&lt;p&gt;try&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;mac-agent-rust
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Small models struggle with tool call formatting&lt;/strong&gt; — Gemma 4 E4B occasionally
returns empty responses or malformed tool calls, requiring retries&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No automatic retry on error&lt;/strong&gt; — when a script fails the model tends to report
the error to the user instead of fixing and retrying the script&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context degradation&lt;/strong&gt; — long conversations cause the model to lose track of
tool results and contradict correct output it just received&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool result confusion&lt;/strong&gt; — the model sometimes receives correct output but
claims the script failed, especially when results are wrapped in JSON instead
of plain text&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spotify and Music app&lt;/strong&gt; — track info only works when something is actively
playing, errors out when paused with no graceful handling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safari JavaScript&lt;/strong&gt; — requires "Allow JavaScript from Apple Events" to be
manually enabled in Safari's Developer settings, not obvious to first time users&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;History resets every session&lt;/strong&gt; — no persistence between runs, agent has no
memory of previous conversations&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>gemmachallenge</category>
      <category>gemma</category>
      <category>ai</category>
      <category>rust</category>
    </item>
    <item>
      <title>Made a Rust based AI agent</title>
      <dc:creator>Tejas</dc:creator>
      <pubDate>Fri, 22 May 2026 16:48:58 +0000</pubDate>
      <link>https://dev.to/tejas1koli/made-a-rust-based-ai-agent-3oj1</link>
      <guid>https://dev.to/tejas1koli/made-a-rust-based-ai-agent-3oj1</guid>
      <description>&lt;p&gt;I built and published a Rust AI agent from scratch in my journey to learn Rust.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/Tejas1Koli/rust-ai-agent" rel="noopener noreferrer"&gt;https://github.com/Tejas1Koli/rust-ai-agent&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;crates.io&lt;/strong&gt;: https: &lt;a href="https://crates.io/crates/rust-ai-agent" rel="noopener noreferrer"&gt;https://crates.io/crates/rust-ai-agent&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What it currently supports:&lt;br&gt;
• Local LLM execution with Ollama&lt;br&gt;
• DuckDuckGo web search&lt;br&gt;
• Async execution with Tokio&lt;br&gt;
• Structured logging&lt;br&gt;
• Typed configuration + validation&lt;br&gt;
• Cross-platform binaries (Linux/macOS/Windows)&lt;br&gt;
• Single-binary CLI distribution&lt;/p&gt;

&lt;p&gt;One thing I found interesting while building this:&lt;/p&gt;

&lt;p&gt;The entire source code is currently around ~25 KB.&lt;/p&gt;

&lt;p&gt;An equivalent LangChain-style AI agent would usually end up much larger because of:&lt;br&gt;
framework layers → wrappers → middleware → orchestration abstractions&lt;/p&gt;

&lt;p&gt;Rust forced me to think more directly about:&lt;br&gt;
• Runtime flow&lt;br&gt;
• Async execution&lt;br&gt;
• Tool orchestration&lt;br&gt;
• Error handling&lt;br&gt;
• Deployment&lt;br&gt;
• System design decisions&lt;/p&gt;

&lt;p&gt;Compared to many Python-based AI agents, Rust gives:&lt;br&gt;
• Lower runtime overhead&lt;br&gt;
• Better concurrency handling&lt;br&gt;
• Stronger type safety&lt;br&gt;
• Easier deployment through compiled binaries&lt;br&gt;
• Less dependency/runtime bloat&lt;/p&gt;

&lt;p&gt;Building this made me realize that AI tooling is increasingly becoming a systems engineering problem, not just a prompting problem.&lt;/p&gt;

&lt;p&gt;Still improving:&lt;br&gt;
• Provider abstractions&lt;br&gt;
• Streaming&lt;br&gt;
• Memory/runtime systems&lt;br&gt;
• Better orchestration flow&lt;/p&gt;

&lt;p&gt;You can try it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;rust-ai-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;P.S. I used tutorials/documentation while building parts of this, but implementing and shipping it taught me much more than just watching content.&lt;/p&gt;

&lt;h1&gt;
  
  
  Rust #AI #SystemsProgramming #OpenSource #DeveloperTools #LocalAI #Tokio #Ollama
&lt;/h1&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%2F16pjz7fv45ii5xhpym2t.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%2F16pjz7fv45ii5xhpym2t.png" alt=" " width="800" height="520"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>rust</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
