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

推荐订阅源

G
Google Developers Blog
D
Docker
Stack Overflow Blog
Stack Overflow Blog
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
H
Help Net Security
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
L
LangChain Blog
MongoDB | Blog
MongoDB | Blog
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
博客园 - 司徒正美
C
Check Point Blog
B
Blog
Y
Y Combinator Blog
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
F
Fortinet All Blogs
美团技术团队
D
DataBreaches.Net

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
Your LLM Bill Is Too High. Here's How to Fix It (Part 1)
Liz Zhang · 2026-04-27 · via DEV Community

The cheapest LLM call is the one you do not make.

Everyone building with LLMs eventually hits the same wall. The prototype
works, usage climbs, and suddenly the API bill starts doing things
nobody planned for. The problem is usually not that AI is expensive. The
problem is that teams are using models for work that should never have
touched a model in the first place.

Before you debate GPT versus Claude versus Gemini, ask a more basic
question: Do you need an LLM at all?

Rule: use an LLM when the task requires ambiguity handling,
judgment, synthesis, flexible natural-language generation, complex
reasoning, or tool use. Do not use one because the word AI looks good in
the architecture diagram.

The no-model audit

A shocking amount of production LLM spend is expensive glue around work
that deterministic code, dedicated APIs, or cheaper ML services already
handle well.

Task Start here before an LLM Use an LLM when
Meeting transcription Dedicated speech-to-text service You need synthesis, follow-up extraction, or action-item judgment.
Translation Translation API or cheaper model The task needs tone adaptation, context-aware rewriting, or multilingual reasoning.
Structured document extraction OCR, document parser, AWS Textract-style pipeline The document layout is messy, fields are ambiguous, or human-like interpretation is required.
Small taxonomy classification Keyword rules, regex, small classifier Categories overlap, labels are subjective, or confidence is low.
Formatting and validation Schema validation, deterministic code The output needs natural-language repair or explanation.

Table 1. No-model audit: cheaper first-pass alternatives before using an LLM.

Where teams waste money

A no-model-first audit prevents teams from paying frontier-model prices for deterministic work
Figure 1. A no-model-first audit prevents teams from paying frontier-model prices for deterministic work.

The common pattern is simple. A team builds a general-purpose prompt,
points every request at a strong model, and ships. It works, so nobody
questions the architecture until the bill arrives. By then, the model
has become the default path for classification, extraction, routing,
formatting, translation, rewriting, and exception handling.

That is backwards. The model should not be the default path. The model
should be the judgment path.

![Illustrative savings potential by optimization lever. Actual savings vary by workload and traffic shape (https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1rf8cty7ptfjfg0rvu39.png)
Figure 2. Illustrative savings potential by optimization lever. Actual savings vary by workload and traffic shape.

A better default architecture

  1. Validate inputs with code. Reject malformed payloads before spending tokens.
  2. Use deterministic tools first. Regex, parsers, lookup tables, and APIs are boring. That is why they are cheap and reliable.
  3. Use small models for fuzzy but routine tasks. Classification, extraction, and rewriting usually do not need a frontier model.
  4. Escalate only when confidence is low. Premium models should handle ambiguity, high-risk cases, and hard reasoning.

Practical checklist

  • Can the task be solved with deterministic code?
  • Can a dedicated API solve it more cheaply and consistently?
  • Can a small classifier handle the common path?
  • Are you sending repetitive context that could be cached?
  • Is the frontier model reserved for exception cases?

Bottom line

The first cost optimization step is not prompt compression. It is
architectural honesty. Most requests are boring. Treat them that way,
and the bill starts dropping before you even switch models.