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

推荐订阅源

S
Security Affairs
S
Schneier on Security
T
Tenable Blog
G
GRAHAM CLULEY
Latest news
Latest news
D
Darknet – Hacking Tools, Hacker News & Cyber Security
A
Arctic Wolf
I
Intezer
Cyberwarzone
Cyberwarzone
T
The Exploit Database - CXSecurity.com
T
Tailwind CSS Blog
K
Kaspersky official blog
Blog — PlanetScale
Blog — PlanetScale
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Threat Research - Cisco Blogs
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 叶小钗
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Recent Commits to openclaw:main
Recent Commits to openclaw:main
P
Palo Alto Networks Blog
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
The Cloudflare Blog
Help Net Security
Help Net Security
罗磊的独立博客
博客园 - 聂微东
Jina AI
Jina AI
Project Zero
Project Zero
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LINUX DO - 最新话题
V
V2EX
人人都是产品经理
人人都是产品经理
美团技术团队
博客园 - 【当耐特】
Spread Privacy
Spread Privacy
J
Java Code Geeks
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Security Latest
Security Latest
The Last Watchdog
The Last Watchdog
Stack Overflow Blog
Stack Overflow Blog
雷峰网
雷峰网
S
Securelist
Forbes - Security
Forbes - Security
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
P
Privacy International News Feed
宝玉的分享
宝玉的分享
C
CERT Recently Published Vulnerability Notes

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
ToolOps: The Python Middleware That's Quietly Cutting AI Infrastructure Costs for Teams Running at Scale
Antoinette C · 2026-05-20 · via DEV Community

There's a number most AI teams discover too late.

It's not in the documentation. It's not in the LLM provider's pricing FAQ. It shows up on the bill — usually during a routine review, usually after a production deployment that "went well." According to CloudZero's research, average monthly AI spend jumped from $63,000 in 2024 to $85,500 in 2025 — a 36% increase. And for the teams that figure out what's actually driving that number, the culprit is almost never the model they chose. It's the calls they didn't need to make.

This article is about a Python SDK called ToolOps that I started using a few months ago. I'm not affiliated with the project. I'm a developer who was burning through LLM credits faster than I should have been, tried a few solutions, and eventually found one that actually worked.


The Real Cost of Production AI Agents

Token prices are falling. LLM API prices dropped approximately 80% between early 2025 and early 2026 — GPT-4o input pricing fell from $5.00 to $2.50 per million tokens, and newer models offer input at just $0.55/MTok. On paper, that sounds like great news for anyone building AI systems.

In practice, it barely moves the needle if your architecture is inefficient.

Here's why: each tool call in an agent adds the full message history back into the prompt. A 5-step agent with a 30,000-token system prompt can pay for that prompt five or more times per request. Now multiply that by concurrent agents, parallel pipelines, and repetitive queries that ask effectively the same thing in slightly different words. The token price per million is irrelevant. You're paying for the same computation over and over.

The cheapest API call is the one you don't make. Efficient prompts, smart caching, and appropriate model selection matter more than provider choice. That principle sounds obvious until you're the one writing the infrastructure to enforce it — at which point you realize it's neither simple nor fast.


What Most Teams Do (And Why It Doesn't Scale)

The standard approach to managing these costs involves writing custom infrastructure: a cache layer, retry logic, a circuit breaker for when APIs go down, observability hooks so you can debug what's happening, and concurrency controls to prevent 40 agents from hammering the same endpoint in parallel.

Every piece of that is necessary. And every piece of it is code you write yourself, from scratch, for each project.

When you build AI agents, external calls — LLMs, APIs, databases — are expensive, unreliable, and slow. ToolOps eliminates the boilerplate: it's a framework-agnostic middleware SDK that wraps any Python function in a single decorator, instantly upgrading it with caching, resilience, observability, and concurrency control.

That's the pitch. Here's what it actually looks like in code.


One Decorator. Everything Else Is Handled.

The before/after is stark.

Before ToolOps, a properly resilient LLM tool call involves cache management, retry logic, circuit breaker state, timeout handling, and tracing — spread across dozens of lines of infrastructure code that wraps three lines of actual work.

After:

@readonly(cache_backend="semantic", cache_ttl=3600, retry_count=3)
async def ask_llm(query: str) -> str:
    return await llm.complete(query)

Enter fullscreen mode Exit fullscreen mode

Automatically cached, retried, and traced. Every agent developer hits a wall when moving from demo to production — and that one decorator is what stands between a clean codebase and an unmaintainable nest of infrastructure scaffolding.

The @readonly decorator signals that this function is idempotent — safe to cache and retry. The @readonly / @sideeffect decorator split is opinionated in a good way: it forces you to be explicit about whether a tool call is idempotent or not, which matters a lot when deciding what's safe to cache and retry.


The Feature That Makes the Biggest Difference at Scale

For teams running multi-agent systems — which is increasingly the default architecture for any serious AI workflow — there's one ToolOps feature that changes the economics of high-volume operations more than anything else.

Request coalescing.

If 50 agents call the same endpoint simultaneously, ToolOps executes the real API call once and multicasts the result.

At first pass, this sounds like a minor optimization. It's not. In a production pipeline where multiple agents are processing similar inputs concurrently, this collapses what would be dozens of identical upstream requests into a single one. In a 50-concurrent-call benchmark, 50 calls collapsed to 1 upstream request — the thundering herd problem on cache miss is real, and this handles it cleanly.

One request. One credit charge. One point of failure.

For large-scale document processing, RAG pipelines, customer-facing AI products, or any architecture that handles bursty, repetitive loads — this is a structural cost reduction that no amount of model-switching will replicate.


Semantic Caching: Catching Costs That Exact-Match Misses

Standard caching is binary: the input either matches a cached key or it doesn't. That works well for structured data. For natural language queries — which is most of what LLM-powered agents process — it misses an enormous opportunity.

The semantic caching in ToolOps uses an intent-matching approach that's genuinely useful for NLP tool inputs. Queries like "Check status of invoice #442" and "Is invoice 442 paid?" hit the same cache entry, reducing LLM token usage noticeably.

This matters more than it might seem. In customer support agents, document analysis pipelines, and data extraction workflows, users phrase the same underlying question dozens of different ways. Every variation that misses an exact-match cache is a redundant API call. Semantic caching eliminates that category of waste entirely.


Production-Grade Resilience Without the Ceremony

Beyond cost reduction, there's the reliability side of production AI infrastructure.

LLM APIs go down. External services rate-limit. Downstream databases return transient errors. The naive response is to let your agent fail. The correct response is a circuit breaker that detects consistent failures, temporarily halts calls to the affected service, and allows recovery — without you having to build that logic yourself.

ToolOps includes this out of the box. A single CLI command — toolops doctor — validates all your backends and reports circuit breaker state. It's exactly what you want to wire into a health check endpoint.

That kind of operational visibility — knowing the status of every backend, every circuit breaker, without digging through logs — is the difference between an agent that fails silently and one you can actually run in production with confidence.


Framework Compatibility: It Works With What You Already Use

The natural concern when evaluating any new piece of infrastructure is migration cost. How much do I have to change?

ToolOps decorates plain Python async functions, making it 100% compatible with your favorite agent frameworks. It works across LangGraph, CrewAI, LlamaIndex, and MCP natively.

You don't rewrite your agents. You don't change your business logic. You add a decorator to the functions that make external calls and configure backends once at startup.

You register backends once at application startup, then reference them by name. ToolOps supports multiple backends simultaneously. Redis for persistent caching, in-memory for low-latency hot paths, semantic backends for NLP tools — you configure the combination that fits your architecture. Then you stop thinking about it.

The core package has zero external dependencies. You only install what you need. No forced opinions on your stack, no transitive dependency conflicts on day one, no bloat.


Who Benefits Most From This

ToolOps is most valuable in three specific situations.

High-volume production pipelines. If your system makes thousands or tens of thousands of API calls per day, even modest cache hit rates translate to significant cost reductions. At scale, organizations can achieve cost reductions of 50% to 90% while maintaining or even improving the quality of their AI applications.

Multi-agent architectures. The request coalescing feature was built for this. The more agents you run in parallel on overlapping workloads, the more redundant upstream calls you're generating without it.

Teams who've been hand-rolling infrastructure. If your codebase currently has a custom retry wrapper, a homemade cache manager, and a circuit breaker you wrote yourself — that's infrastructure debt ToolOps replaces directly. The integration is one decorator per function, with zero changes to business logic.


Getting Started

pip install toolops

Enter fullscreen mode Exit fullscreen mode

From there, it's backend configuration at startup and decorator placement on your tool functions. The GitHub repository covers the full setup, and the official documentation walks through backend configuration and the decorator API in detail.

The project is early — a web dashboard and budget control features are still on the roadmap — but the core resilience layer is solid. It's Apache 2.0 licensed. Open source, production-ready for its current feature set, actively developed.


The Architecture Principle It Enforces

There's something more fundamental happening here than a useful library.

ToolOps is built on the idea that every external call an AI agent makes should be treated as a first-class operation — not an afterthought. Caching, retry logic, circuit breaking, observability, and concurrency control aren't optional production concerns you bolt on later. They're the minimum viable infrastructure for anything that talks to an LLM or an external API.

Most teams know this. Most teams also don't have time to build it properly for every project. ToolOps packages that infrastructure into a decorator and gets out of the way.

Don't over-optimize for today's prices. What matters is building the architecture that can take advantage of future pricing improvements. The teams that will operate efficiently as models get cheaper, as APIs multiply, as agent systems scale — are the ones who built the right plumbing early. ToolOps is that plumbing.


If you're building production AI agents and you've hit the credit-burn problem, I'd genuinely like to hear how you've handled it. Drop a comment below.

GitHub: github.com/hedimanai-pro/toolops