惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V2EX - 技术
V2EX - 技术
L
LangChain Blog
IT之家
IT之家
S
SegmentFault 最新的问题
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
U
Unit 42
B
Blog RSS Feed
GbyAI
GbyAI
Microsoft Security Blog
Microsoft Security Blog
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
T
Threatpost
C
CERT Recently Published Vulnerability Notes
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
Vercel News
Vercel News
S
Schneier on Security
Spread Privacy
Spread Privacy
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
博客园 - 叶小钗
雷峰网
雷峰网
博客园_首页
人人都是产品经理
人人都是产品经理
P
Palo Alto Networks Blog
The Hacker News
The Hacker News
T
Tor Project blog
L
Lohrmann on Cybersecurity
Know Your Adversary
Know Your Adversary
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
P
Privacy International News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tenable Blog
V
Vulnerabilities – Threatpost
大猫的无限游戏
大猫的无限游戏
博客园 - 【当耐特】
V
V2EX
Security Latest
Security Latest
A
About on SuperTechFans
Cloudbric
Cloudbric
S
Security Affairs
MongoDB | Blog
MongoDB | Blog
Y
Y Combinator Blog
Martin Fowler
Martin Fowler
TaoSecurity Blog
TaoSecurity Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Small Models, Great Tools: The Engineering Behind a Local AI Agent in Production
Quentin Merle · 2026-06-16 · via DEV Community

There is a persistent myth that to build a worthy code assistant, you absolutely must use GPT or Claude. This is false. You don't need a 1-trillion parameter model. You need a small local model and extremely rigorous engineering around it.

This is the direction history is taking for companies. As Mark Zuckerberg mentioned, the future isn't a single omniscient model, but "every company having its own specialized AI". And this specialization necessarily involves fine-tuning and local deployment (or on sovereign servers) to guarantee data security.

The thesis behind the construction of Vibrisse Agent can be summed up in one sentence: Small models, Great tools.

In this article, I will detail the technical stack and concrete engineering solutions I implemented to tame a local model and make it reliable in production: LangGraph, Ollama, FastAPI, React (no build step, with embedded custom CSS), all running on a machine with 32 GB of RAM.

For the curious who want to run the agent on their machine right now:

// MacOs / Linux
curl -sSL https://agent.vibrisse-studio.dev/install.sh | bash

// Windows
irm https://agent.vibrisse-studio.dev/install.ps1 | iex


Architecture: Why a State Machine (LangGraph)?

At first, when building an LLM application, we tend to think in sequential chains:
Input -> Prompt -> Tool -> Output.
The problem is that if one node fails, the whole chain stops without us being able to catch the error or understand the context of the crash.

That's where LangGraph comes in. Vibrisse's architecture isn't a chain, it's a state machine. Every node in the graph has a very precise responsibility, shares a global conversation state, and uses conditional transitions to move to the next node.

I implemented the Supervisor / Worker pattern:

  • The Supervisor analyzes the user's intent. It does nothing else but route.
  • It dispatches the task to specialized Workers (the RAG Worker, the Search Worker, the Ghost Worker...).
  • If a Worker fails or needs more information, it can send the state back to the Supervisor.

The Real Fight: Taming the "Laziness" of Small Models

The most valuable part of this project — and the one very few tutorials document honestly — was the fight against the nature of small LLMs.

Choosing Weapons: The Winning Models

If you're wondering which models survived my crash tests: I built the entire core of the agent around Gemma 4 (e4b). Why? Because it natively integrates vision and "thought" management, while offering that highly structured, Google-style response format. However, for evaluation and metrics, I had to switch to Llama 3 8B. A model that is too small proves incapable of reliably evaluating its own answers.

Constraints and Thinking Out Loud

Without strict constraints, a local model will always take the path of least resistance. Concretely, if you ask it to refactor a complex file at 3 AM without firm directives, it will proudly write: // ... rest of the code here.

The solution? Ultra-structured system prompts that impose a role, a strict JSON output format, and above all, the obligation to "think out loud". Imposing the use of a <thought> tag before triggering an action is paramount for two things: debugging why the agent made a bad routing decision, and improving the UX.

Triple-Layer Robust Parsing

Forcing an LLM to answer in JSON is only half the battle. When the model "tires" or gets tangled in context, it can generate malformed JSON. To keep the agent from crashing, I had to design a 3-layer parsing system:

  1. Layer 1: Standard JSON parsing.
  2. Layer 2: Regex Fallback to extract the object if the model added text around it.
  3. Layer 3: If the JSON is completely broken, a keyword fallback guesses the intent for a fallback action. Zero crashes.

Fun Fact: This approach was born from a thought exercise late in the project: "What if we had to run this agent on a very modest machine with a highly unstable SLM (Small Language Model)?" The forced constraints gave birth to these resilience tricks that I kept. (Perhaps the starting point for a future "Vibrisse-Lite"? Stay tuned...)


Triple-Layer Retrieval: Precise RAG, Not Noisy

RAG is not meant to stuff the model with context. The more text you send to a small model, the more it hallucinates. Context must be targeted and ultra-precise. The Vibrisse agent uses a Triple-Layer Retrieval:

  1. The Deterministic Layer (Ripgrep): For exact queries (e.g., "Where is the API_KEY variable defined?"). It's 100% precise, 0% hallucination.
  2. The Semantic Layer (ChromaDB): To understand intent (e.g., "Show me how errors are handled").
  3. The Statistical Layer (BM25): A standard safety net.

We don't choose one method, we execute all three and merge the results.


The Muscles of the Agent: MCP Hub, Web Search, and Ghost Mode

An LLM alone is just a "brain in a jar". You have to realize that to graft muscles onto it, every single action must be thought out and coded, which quickly breaks the "magic" aspect. You want your agent to do a simple grep? You have to code the tool, test it alone, then test it after a Vision action, then after a Web search, to ensure LangGraph doesn't crash.

Ghost mode

The agent has local tools, but also connected tools like Web Search (Tavily API), which is vital for grabbing the most recent documentation before answering.

The MCP Hub (Model Context Protocol)

Instead of reinventing the wheel, I integrated Anthropic's MCP standard. Vibrisse acts as an MCP Client. Adding a tool is simply a matter of plugging in an external Server. The architecture is thus "future-proof", ready for evolutions like Google's webMCP.

Ghost Mode: In-File Directives

This is the workflow killer-feature. An agent's goal isn't to force you to chat in a window.

Ghost Mode

Ghost Mode

A WatcherService (based on the Python watchdog library) runs in the background. As soon as it detects the @vibrisse: tag in a saved comment, it triggers a silent Ghost Worker that generates and injects the code directly into the editor.


Architect Mode: Human-in-the-Loop and Artifacts

For complex tasks, letting an autonomous agent execute dozens of commands in a loop is architectural suicide. You need a handbrake. So I implemented a Human-in-the-Loop pattern with LangGraph.

Graph Interruption (interrupt_after)

When a structural task is detected, the router switches to a dedicated node (planning_node). This node generates an action plan formatted in Markdown, wrapped in strict XML tags (<artifact id="plan">).
The LangGraph subtlety: the graph is compiled with the interrupt_after=["planning_node"] instruction. As soon as the plan is generated, execution stops dead on the backend and the state is saved in the database.

Frontend Rendering and State Resumption

On the React side, the UI intercepts these tags with a regular expression, hides the raw XML, and generates a rich interactive component (a CodeDiff, a Mermaid diagram, or a TaskBoard). The user then has buttons to "Approve" or "Reject" the proposal.

The biggest technical trap of this feature? State resumption (Resume).
When the user clicks "Approve", the frontend calls a route that restarts the LangGraph graph. Except that if you resume the conversation without saying anything, the small LLM finds itself with its own message (AIMessage) at the end of the context history and starts hallucinating the rest of the discussion.
The ingenious solution: Silently inject a HumanMessage ("Plan approved. You may proceed with implementation") into the state before restarting inference. The model thus has a clear directive and knows exactly what is expected of it.


Persistence and Context Limits

Curing Amnesia

An agent that forgets decisions made 2 hours ago is useless. Vibrisse uses SQLite for complete thread persistence, coupled with the automatic generation of a project_map.json at each launch.

The other sworn enemy is the context window limit (often 8k tokens on these small models). If the RAG brings back too many files, the context explodes. To handle this, Vibrisse constantly monitors token consumption and displays it live in the UI's Sidebar. The developer knows exactly when the context is saturated and it's time to refresh the conversation.

Sovereign Routing: Delegating Smartly

The agent analyzes the complexity of each request before acting:

  • Simple request -> Local model (Ollama). Immediate result.
  • Complex request -> The agent proposes switching to a more powerful Cloud model, with the user's explicit consent.

Sovereign Routing


The Elephant in the Room: Latency and RAM

We have to be honest about the main flaw of local AI: latency. Combining a Vision analysis with the generation of a complex React component can take up to 3 minutes (or more) on a consumer machine. It's the price to pay for total privacy and local execution.

To make this manageable, Vibrisse integrates real hardware resource tracking:

  • A (V)RAM check at installation to finely configure the agent via the onboarding Wizard.
  • A resource gauge in the Sidebar to monitor live machine load.
  • The ThinkingConsole: The "live" streaming of thought tokens. Even when the local action is slow, seeing the text scroll drastically reduces the cognitive friction of waiting. It's "Speed Design".

Hardware Discovery


The Golden Rule: Test in Blocks

Every new feature added risks breaking an existing one. The router (which reads intents) is the most temperamental point in the entire architecture. At the slightest adjustment in a tool's description, it can derail. Everything relies on semantics.

The absolute rule: test, test, and retest. Even when you don't feel like it. But how do you test a system whose answers are random?
I set up the RAGAS framework (driven by Llama 3 8B) to evaluate the quality and relevance of the RAG in an automated way. Added to this are scenario files (rigorous manual tests) and lightweight Python test scripts to ensure the routing chains don't break before adding the next block.


Conclusion: In Praise of the Small Model

Vibrisse isn't "the best agent in the world". There will always be more powerful Cloud models. But Vibrisse is proof that a Small models, Great tools philosophy holds up in production, provided you put in the necessary engineering rigor.

The tool is open-source. The code is out there.


Your turn:

  • Vibrisse Agent on GitHub
  • The project is designed to be "plug-and-play" with installation scripts (install.sh / .bat) for Mac, Linux, and Windows.
  • The project is open to contributions. Whether it's adding a new Worker (an MCP tool), optimizing the parsing system, or just fixing a bug in Ghost Mode... Pull Requests are more than welcome! Come break the code and rebuild it with me.
  • If you had to build or adapt an agentic stack today, which part scares you the most to stabilize? Routing? Parsing? Context management?
  • Let me know in the comments.

Proudly developed in Beauce, Québec 🇨🇦. Interested in the alliance between immersive web engineering and local AI sovereignty? Let's connect via Vibrisse Studio!