<?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: dueprincipati</title>
    <description>The latest articles on DEV Community by dueprincipati (@dueprincipati).</description>
    <link>https://dev.to/dueprincipati</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%2F1891011%2Fc9f61209-c9bd-438a-b0c6-bae4f9d7ff6a.png</url>
      <title>DEV Community: dueprincipati</title>
      <link>https://dev.to/dueprincipati</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dueprincipati"/>
    <language>en</language>
    <item>
      <title>Gemma 4 Multimodal Reasoner: Local Visual CoT for Charts, Math, and UI Analytics</title>
      <dc:creator>dueprincipati</dc:creator>
      <pubDate>Sun, 17 May 2026 08:57:29 +0000</pubDate>
      <link>https://dev.to/dueprincipati/gemma-4-multimodal-reasoner-local-visual-cot-for-charts-math-and-ui-analytics-5gd9</link>
      <guid>https://dev.to/dueprincipati/gemma-4-multimodal-reasoner-local-visual-cot-for-charts-math-and-ui-analytics-5gd9</guid>
      <description>&lt;p&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;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Gemma 4 Multimodal Reasoner&lt;/strong&gt; is a production-ready, highly modular multimodal reasoning engine designed to unlock advanced visual and textual analysis. While traditional vision-language pipelines often treat perception and text generation as detached layers, this library deeply integrates Gemma 4's native chain-of-thought capabilities into a unified Python API and a seamless Command Line Interface (CLI).&lt;/p&gt;

&lt;p&gt;The engine abstracts the complexity of configuring diverse inference providers and handles advanced visual token budget allocations out of the box by providing four specialized analytical tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Document Analysis (&lt;code&gt;DocumentParser&lt;/code&gt;):&lt;/strong&gt; Tailored prompt structures to read and convert complex data tables into Markdown, extract specific line items from invoices or receipts, parse filled form fields, analyze workflow diagrams, and transcribe handwritten annotations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chart &amp;amp; Graph Interpretation (&lt;code&gt;ChartAnalyzer&lt;/code&gt;):&lt;/strong&gt; Automatically maps axis boundaries, intervals, legends, and general trends from complex graphs, isolating numerical values and outliers into structured CSV or Markdown formats.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visual Math Solver (&lt;code&gt;MathSolver&lt;/code&gt;):&lt;/strong&gt; Capitalizes on the model's strong logical capacity to break down complex mathematical formulas or geometric problems directly from an image, outputting comprehensive, step-by-step breakdowns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Screen &amp;amp; UI Understanding (&lt;code&gt;ScreenAnalyzer&lt;/code&gt;):&lt;/strong&gt; Built specifically for agentic workflows, it maps interactable interface elements, estimates relative component coordinates, and performs automated accessibility (WCAG) contrast and alt-text compliance reviews.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;The application features a built-in interactive CLI that makes analyzing images or running multi-turn conversations completely immediate from the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Start an interactive multi-turn chat session with a visual context&lt;/span&gt;
gemma4 chat &lt;span class="nt"&gt;--image&lt;/span&gt; ./data/app_screenshot.png

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Additionally, a complete Jupyter Notebook walkthrough is available in the repository (&lt;code&gt;notebooks/demo.ipynb&lt;/code&gt;), making it fully optimized for deployment on cloud-hosted environments like Google Colab.&lt;/p&gt;

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

&lt;p&gt;The full open-source package, architecture layers, standalone container deployment profiles, and automated test suites are hosted publicly here:&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://www.google.com/search?q=https://github.com/dueprincipati/gemma4-reasoner" rel="noopener noreferrer"&gt;GitHub Repository: dueprincipati/gemma4-reasoner&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;When building a multimodal reasoning engine meant to scale seamlessly—from edge installations to massive cloud-hosted processing systems—model selection requires a careful balance between VRAM overhead, context windows, and absolute logical performance.&lt;/p&gt;

&lt;p&gt;While our repository abstractly supports the full Gemma 4 family (&lt;code&gt;E2B&lt;/code&gt; up to &lt;code&gt;31B Dense&lt;/code&gt;), we selected &lt;strong&gt;Gemma 4 E4B&lt;/strong&gt; as our primary flagship local model.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Core Case for Gemma 4 E4B
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;High Cognitive Density:&lt;/strong&gt; Traditionally, small-footprint "edge" models fail at advanced visual reasoning tasks. Gemma 4 E4B completely shatters this stereotype, scoring an incredible &lt;strong&gt;42.5% on the highly challenging AIME 2026 visual mathematics benchmark&lt;/strong&gt;. This enabled our &lt;code&gt;MathSolver&lt;/code&gt; and &lt;code&gt;ChartAnalyzer&lt;/code&gt; tools to work locally with extreme precision without forcing a hard dependency on an expensive third-party cloud API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimal VRAM Footprint:&lt;/strong&gt; For an engine to be truly production-ready, it must execute on consumer hardware. In native &lt;code&gt;BF16&lt;/code&gt; precision, E4B takes up &lt;strong&gt;15.0 GB of VRAM&lt;/strong&gt;, fitting perfectly inside mid-tier consumer graphics cards and standard developer cloud nodes. Quantized down to &lt;code&gt;q4_0&lt;/code&gt;, it drops to a meager &lt;strong&gt;5.0 GB&lt;/strong&gt;, turning regular laptops into air-gapped document parsing servers via local Ollama wrappers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Massive Multi-Image Context Window:&lt;/strong&gt; Taking advantage of the model's native &lt;strong&gt;128K context window (131,072 tokens)&lt;/strong&gt;, the engine easily manages simultaneous multi-image comparison tasks (&lt;code&gt;compare_images&lt;/code&gt;) without running into abrupt truncation issues or losing conversation state.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Technical Capabilities Unlocked by Gemma 4's Architecture:
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Isolated Local Chain-of-Thought (CoT) Streams
&lt;/h4&gt;

&lt;p&gt;Gemma 4 introduces native system control tokens. By injecting the &lt;code&gt;&amp;lt;|think|&amp;gt;&lt;/code&gt; block directly into our system prompt constructor, we trigger internal chain-of-thought routing. Our abstract backend layer custom-parses the model's output streams, separating the internal &lt;code&gt;&amp;lt;|channel&amp;gt;thought&lt;/code&gt; string from the final &lt;code&gt;&amp;lt;|channel&amp;gt;analysis&lt;/code&gt; answer. This allows us to display a dedicated, beautifully formatted reasoning block in our terminal CLI while returning clean markdown answers to the user without verbose conversational overhead.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Dynamic Variable Token Allocation
&lt;/h4&gt;

&lt;p&gt;Gemma 4's vision encoder allows flexible image resolutions through fine-grained token budgeting. Our &lt;code&gt;ImageProcessor&lt;/code&gt; implements this natively to match specific computational needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;MIN (70 visual tokens)&lt;/code&gt;&lt;/strong&gt; allows minimal compute overhead for rapid structural framing or sequential video frame categorizations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;HIGH/MAX (560 to 1120 tokens)&lt;/code&gt;&lt;/strong&gt; forces sub-segment upsampling (Pan &amp;amp; Scan). This completely unlocked high-fidelity OCR, making dense table cell data extractions, invoice reading, and raw handwriting transcription extremely robust.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. Clean History Multi-Turn Scaling
&lt;/h4&gt;

&lt;p&gt;Per Gemma 4's official specifications, passing historical reasoning channels inside active conversational arrays degrades subsequent generation quality. Our multi-turn state manager automatically strips historical &lt;code&gt;thinking&lt;/code&gt; output sequences before packaging the next chat context turn. This ensures our interactive chatbot tracks conversational context flawlessly over long multi-turn lengths without performance drops.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Architecture Agnostic Scalability
&lt;/h4&gt;

&lt;p&gt;The structural decoupling of our processing tools from the inference backend ensures developers are never locked into a single ecosystem. Thanks to multi-backend runtime mapping (&lt;code&gt;BACKEND=ollama | huggingface | openai_compat&lt;/code&gt;), if a production workflow requires moving to the max-tier &lt;strong&gt;Gemma 4 31B Dense model&lt;/strong&gt; (boosting AIME performance to an unmatched &lt;strong&gt;89.2%&lt;/strong&gt;), swapping backends is as simple as updating a single environment configuration string.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gemmachallenge</category>
      <category>gemma</category>
    </item>
    <item>
      <title>Hermes Sentry-Core: The Autonomous On-Call Engineer</title>
      <dc:creator>dueprincipati</dc:creator>
      <pubDate>Sat, 16 May 2026 13:36:48 +0000</pubDate>
      <link>https://dev.to/dueprincipati/hermes-sentry-core-the-autonomous-on-call-engineer-3ie9</link>
      <guid>https://dev.to/dueprincipati/hermes-sentry-core-the-autonomous-on-call-engineer-3ie9</guid>
      <description>&lt;p&gt;&lt;strong&gt;What I Built&lt;/strong&gt;&lt;br&gt;
I built Hermes Sentry-Core, an autonomous, self-healing Site Reliability Engineering (SRE) and infrastructure optimization engine.&lt;/p&gt;

&lt;p&gt;Traditional monitoring relies on passive alerting—when something breaks, a system pings a human on-call who then has to wake up, pull logs, diagnose the issue, and manually restart services. Hermes Sentry-Core flips this paradigm by acting as an automated "first-responder." Operating as a headless background daemon, it continuously monitors system health. When a failure occurs, it intercepts container error states, uses an LLM to cognitively parse and diagnose the root cause, executes targeted, low-risk remediation scripts (like cycling Docker containers), and finally broadcasts a concise, cryptographic-grade operational triage report straight to a Telegram channel.&lt;/p&gt;

&lt;p&gt;It solves the problem of alert fatigue and reduces mean-time-to-recovery (MTTR) for known or transient infrastructure failures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Demo&lt;/strong&gt;&lt;/p&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%2Fitt7gpbblxofqtpr0iem.jpeg" 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%2Fitt7gpbblxofqtpr0iem.jpeg" alt=" " width="800" height="1289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/dueprincipati/hermes-sentry-core" rel="noopener noreferrer"&gt;https://github.com/dueprincipati/hermes-sentry-core&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Tech Stack&lt;/strong&gt;&lt;br&gt;
Agent Framework: Hermes Agent Framework&lt;br&gt;
LLM Core: Anthropic Claude 3.5 Sonnet (Fallback: Claude 3 Haiku)&lt;br&gt;
Infrastructure Management: Docker, Kubernetes (via kubectl)&lt;br&gt;
Communication Gateway: Telegram Bot API&lt;br&gt;
System Tools: standard POSIX utilities (grep, awk, cat, systemctl)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I Used Hermes Agent&lt;/strong&gt;&lt;br&gt;
Hermes Agent was foundational in designing the secure, autonomous loop of this project. I leaned heavily on the following agentic capabilities:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Natural Language Cron Trigger Subsystem&lt;/strong&gt;: I utilized the Hermes abstraction layer to create continuous, intelligent monitoring loops that watch system wellness vectors without writing complex bash watchdogs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic Guardrails &amp;amp; Security&lt;/strong&gt;: This is where Hermes truly shines for an SRE tool. I configured the agent with strict conservative_auto boundaries in config.json. By strictly allowing only non-destructive commands (docker, kubectl, grep, systemctl) and locking scope to parsing only the last 200 lines of logs, Hermes Agent allowed me to safely grant an LLM terminal access without fear of it executing dangerous operations (like rm or database wipes).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Headless Gateways&lt;/strong&gt;: I used the Hermes gateway system to bypass traditional web UIs entirely, routing the agent's diagnostic Markdown reports directly into a Telegram control feed, perfectly mimicking how SRE teams already communicate. Hermes provided the exact balance of AI autonomy and rigid security boundaries necessary to build a self-healing infrastructure tool.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>hermesagentchallenge</category>
      <category>devchallenge</category>
      <category>agents</category>
    </item>
    <item>
      <title>node.js</title>
      <dc:creator>dueprincipati</dc:creator>
      <pubDate>Sat, 17 Jan 2026 05:17:30 +0000</pubDate>
      <link>https://dev.to/dueprincipati/nodejs-2l5m</link>
      <guid>https://dev.to/dueprincipati/nodejs-2l5m</guid>
      <description></description>
    </item>
    <item>
      <title>Submission for the Neon Open Source Starter Kit Challenge: Ultimate Starter Kit</title>
      <dc:creator>dueprincipati</dc:creator>
      <pubDate>Tue, 27 Aug 2024 17:19:29 +0000</pubDate>
      <link>https://dev.to/dueprincipati/submission-for-the-neon-open-source-starter-kit-challenge-ultimate-starter-kit-lai</link>
      <guid>https://dev.to/dueprincipati/submission-for-the-neon-open-source-starter-kit-challenge-ultimate-starter-kit-lai</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/neon"&gt;Neon Open Source Starter Kit Challenge &lt;/a&gt;: Ultimate Starter Kit&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Kit
&lt;/h2&gt;

&lt;p&gt;Introducing NeonStack, the ultimate open source starter kit for building modern, scalable web applications. NeonStack combines the power of Next.js, TypeScript, Tailwind CSS, Prisma, and Postgres on Neon to provide a robust foundation for your next project.&lt;br&gt;
Key features of NeonStack include:&lt;/p&gt;

&lt;p&gt;Next.js for server-side rendering and API routes&lt;br&gt;
TypeScript for type-safe code&lt;br&gt;
Tailwind CSS for rapid UI development&lt;br&gt;
Prisma as the ORM for database operations&lt;br&gt;
Postgres on Neon for a scalable and efficient database solution&lt;br&gt;
NextAuth.js for authentication&lt;br&gt;
tRPC for end-to-end typesafe APIs&lt;br&gt;
Zod for schema validation&lt;br&gt;
Jest and React Testing Library for testing&lt;br&gt;
ESLint and Prettier for code quality and formatting&lt;/p&gt;

&lt;p&gt;NeonStack is designed to help developers quickly bootstrap their projects with a modern, maintainable architecture. Whether you're building a small side project or a large-scale application, NeonStack provides the tools and structure you need to succeed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Link to Kit
&lt;/h2&gt;

&lt;p&gt;You can find the NeonStack starter kit on GitHub: &lt;a href="https://github.com/dueprincipati/neonstack" rel="noopener noreferrer"&gt;https://github.com/dueprincipati/neonstack&lt;/a&gt;&lt;br&gt;
Our repository includes a comprehensive README with detailed instructions on how to set up and use the starter kit.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Journey
&lt;/h2&gt;

&lt;p&gt;When designing NeonStack, our goal was to create a starter kit that would empower developers to build modern, scalable applications with ease. We chose this particular stack for several reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Next.js: We selected Next.js for its excellent developer experience, built-in API routes, and server-side rendering capabilities.&lt;/li&gt;
&lt;li&gt;TypeScript: TypeScript adds type safety to our JavaScript code, catching errors early and improving overall code quality and maintainability.&lt;/li&gt;
&lt;li&gt;Tailwind CSS: We chose Tailwind for its utility-first approach, which allows for rapid UI development and easy customization.&lt;/li&gt;
&lt;li&gt;Prisma: Prisma's type-safe database access and migrations make it an excellent choice for working with databases in TypeScript.&lt;/li&gt;
&lt;li&gt;Postgres on Neon: Neon's serverless Postgres offering is a game-changer for developers. It provides the power and reliability of Postgres with the scalability and ease of use of a cloud-native solution.&lt;/li&gt;
&lt;li&gt;tRPC: We included tRPC to enable end-to-end typesafe APIs. This ensures that our frontend and backend are always in sync, reducing errors and improving developer productivity.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Throughout the process of building NeonStack, we learned several valuable lessons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Integration is key: Ensuring that all these technologies work well together required careful consideration and testing.&lt;/li&gt;
&lt;li&gt;Documentation matters: Clear and comprehensive documentation is crucial for an open source project.&lt;/li&gt;
&lt;li&gt;Flexibility is important: While we've made opinionated choices in our stack, we've also ensured that developers can easily modify or extend the starter kit to suit their specific needs.&lt;/li&gt;
&lt;li&gt;Performance considerations: We learned the importance of optimizing for performance from the start.&lt;/li&gt;
&lt;li&gt;Community feedback is invaluable: We've set up the project to welcome contributions and feedback from the community.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>devchallenge</category>
      <category>neonchallenge</category>
      <category>postgres</category>
      <category>database</category>
    </item>
  </channel>
</rss>
