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

推荐订阅源

Martin Fowler
Martin Fowler
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Vercel News
Vercel News
L
LangChain Blog
B
Blog RSS Feed
Y
Y Combinator Blog
IT之家
IT之家
H
Hackread – Cybersecurity News, Data Breaches, AI and More
GbyAI
GbyAI
V
V2EX
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
阮一峰的网络日志
阮一峰的网络日志
有赞技术团队
有赞技术团队
D
Docker
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
Last Week in AI
Last Week in AI
月光博客
月光博客

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
Making DSPy reliable: self-correcting, schema-validated L...
Ramkumar Muraleedharan (Ram) · 2026-06-25 · via DEV Community

Ramkumar Muraleedharan (Ram)

I got tired of babysitting LLM prompts, so I built a small open source tool to stop.
The pattern that wore me down: every LLM call in a real agent needs a wrapper. Parse the JSON, catch the field that didn't come back, re-prompt, hope it works this time. And every time I swapped models, the prompt I'd spent an afternoon tuning would quietly stop working and I'd tune it again by hand. After enough of that, I stopped treating it as the cost of doing business and started treating it as a thing to fix.

So I made dspyer.

The idea is simple. You wrap an LLM step in a Pydantic schema. When the model returns something that doesn't fit, malformed JSON, a missing field, a citation it made up, dspyer tells the model exactly what was wrong and asks again until it conforms, or stops after however many retries you allow. It's one decorator on a normal typed function. No try/except, no parsing glue.

The part I actually care about is what that buys you. The step compiles down to a standard DSPy module, so instead of hand editing prompts you point a DSPy optimizer at a handful of examples and let it tune them, then save the result and load it in production. That was the whole reason I went down this road. I wanted my prompts to stop being something I maintain.

A few deliberate choices, since they're the part I'd want to know about if I were reading this:

  • It doesn't care which model you run. OpenAI, Claude, Gemini, or a local Ollama model with no API key at all.
  • It doesn't make you rewrite anything. If you're already on LangGraph, your deterministic and tool nodes stay plain Python. Only the reasoning nodes get wrapped, because those are the only ones a prompt optimizer can actually help.
  • And it's honest about its limits. There is no auto convert your whole agent magic, and the README says so. The value is a small reliable runtime, not a framework you have to adopt.

It's early. 0.3.5, Apache 2.0, on PyPI. There's a quickstart that runs in about 30 seconds offline with no key if you just want to watch the self correction loop fire.

I'd genuinely rather hear where it breaks than hear that it's neat. If you build agents and any of this sounds familiar, I'd love for you to try it and tell me what's missing.

Link in the comments.