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

推荐订阅源

L
LINUX DO - 最新话题
G
Google Developers Blog
J
Java Code Geeks
The GitHub Blog
The GitHub Blog
F
Full Disclosure
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Vercel News
Vercel News
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Announcements
Recent Announcements
Help Net Security
Help Net Security
The Hacker News
The Hacker News
IT之家
IT之家
Y
Y Combinator Blog
Martin Fowler
Martin Fowler
L
Lohrmann on Cybersecurity
C
CERT Recently Published Vulnerability Notes
V
Visual Studio Blog
博客园 - 聂微东
Hacker News: Ask HN
Hacker News: Ask HN
H
Hacker News: Front Page
Know Your Adversary
Know Your Adversary
Security Latest
Security Latest
Security Archives - TechRepublic
Security Archives - TechRepublic
Simon Willison's Weblog
Simon Willison's Weblog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
Last Week in AI
Last Week in AI
Schneier on Security
Schneier on Security
N
News and Events Feed by Topic
博客园 - 【当耐特】
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
Blog — PlanetScale
Blog — PlanetScale
博客园_首页
Google DeepMind News
Google DeepMind News
Cloudbric
Cloudbric
N
News | PayPal Newsroom
A
About on SuperTechFans
S
Schneier on Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hugging Face - Blog
Hugging Face - Blog
M
MIT News - Artificial intelligence
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
雷峰网
雷峰网
T
The Exploit Database - CXSecurity.com
罗磊的独立博客
K
Kaspersky official blog
The Cloudflare Blog
I
Intezer

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
caveman 真的能幫我省下 Token 帳單嗎?
JH5 · 2026-06-15 · via DEV Community

前幾天在聽 MS的 Token 滅火大會時,線上的講師提到的熱門工具,https://github.com/juliusbrussee/caveman

只要掛上 caveman system prompt,就能在保證 100% 技術精確度的前提下,大幅砍掉 AI 程式碼生成時的輸出 token 成本。

實測顯示,在 React 入門除錯範例中,caveman ultra 模式能省下 60.9% 的 token,然後我找了社群上熱門的 Next.js Todo List App 專案(包含 Prisma 與 Server Actions)來實測,修改優先級、過濾排序與截止日期等功能也省下了約 49% 的 token。

不論是你想要降低 API 成本與提高 IDE 反應速度的開發者,建議都可以去下載來試試看。


caveman如何兼顧精確與精簡?

最近經歷了 Antigravity 與 Gitub Copilot 的雙重錢包夾殺,一直看著 token 噴掉真的超心痛,還用到不少 API 額度 QQ

caveman 是由 Julius Brussee 開發的 AI 程式碼代理人(AI coding agent)擴充技能,特點是透過精簡的原始人口吻抹除廢話以節省高達 60% 的輸出 token 成本。
運作的邏輯其實很土炮,就是透過 system prompt 強制 AI 閉嘴XD。

把所有無意義的客套話(比如「我很樂意為您解答」、「這是一個很好的問題」)、冠詞(a, an, the)還有無關緊要的修飾詞全部濾掉。
不過它只對文字敘述下重手,對程式碼區塊則是原封不動,這保證了代碼的 100% 精確度。

目前 Caveman 提供了 4 種不同的對話壓縮層級(grunt levels):

  • lite:只去掉廢話,保留完整句子與文法結構。
  • full:去掉冠詞,允許碎片句,開始用短同義詞。
  • ultra:極致縮寫,把 database 寫成 DB,用箭頭 表示因果關係。
  • wenyan:直接用文言文回覆,利用中文文言文的超高資訊密度來壓縮 token。

從入門到全端的 token 變化

我找了三個開發中常見的案例,在我的 local 環境用 tiktoken 庫(基於 OpenAI 的 cl100k_base 編碼,就是 GPT-4 用的那套)跑了實際的 token 計數。
以下是這三個範例的實測結果。

案例一:React Controlled Component

這個問題很基本,就是 input 綁定了 value 卻沒有寫 onChange 導致輸入框被鎖死。
這時候一般 LLM 會長篇大論解釋 controlled component 的機制,我們看看 caveman 各模式怎麼回答:

  • Vanilla(87 tokens): "Sure! I'd be happy to explain this. The reason you can't type into the input field is because you've set its value prop to a state variable (value), but you haven't provided an onChange handler..."
  • Caveman Lite(60 tokens,省下 31.0%): "In React, setting the value prop on an input without an onChange handler makes it read-only..."
  • Caveman Full(44 tokens,省下 49.4%): "Input value bound to state but missing onChange handler makes it read-only. Add onChange event..."
  • Caveman Ultra(34 tokens,省下 60.9%): "Input value bound state, no onChange → read-only. Add onChange to update. Fix: onChange={e => setValue(e.target.value)}."
  • Caveman Wenyan(39 tokens,省下 55.2%): "React元件以value縛state,缺onChange,遂成唯讀。增 onChange={(e) => setValue(e.target.value)} 即解。"。 (我第一眼看到這些訊息還想說這是啥玩意...)

範例二 Prisma Eager Load 優化

在撈資料庫時,不小心用 include 查了整張 posts 表,只是為了解構 posts 的陣列長度。

  • Vanilla:103 tokens。
  • Caveman Lite:73 tokens(省下 29.1%)
  • Caveman Full:55 tokens(省下 46.6%)
  • Caveman Ultra:47 tokens(省下 54.4%)
  • Caveman Wenyan:71 tokens(省下 31.1%)

範例三:Next.js App Router JWT Middleware API

這個範例包含了整段 TypeScript 的 API Route 程式碼,因為程式碼本身是不被壓縮的,這會大幅拉高 baseline。

  • Vanilla:283 tokens。
  • Caveman Lite:242 tokens(省下 14.5%)。
  • Caveman Full:203 tokens(省下 28.3%)。
  • Caveman Ultra:197 tokens(省下 30.4%)。
  • Caveman Wenyan:221 tokens(省下 21.9%)。

Next.js Todo App 修改

為了確認真的能救我的信用卡,我在我的 Antigravity 環境中,呼叫三個 subagents( Gemini 3.5 Flash)來修修改改 Next.js Todo List App 專案(結合 Prisma 與 Server Actions)的三項功能修改:加入優先程度、篩選與排序、截止日提醒。

我給了這三個 subagents 一模一樣的開發要求,在 vanilla、caveman ultra 與 caveman wenyan 三種系統設定下執行修改,並計算回傳的完整 token 數:

  • Vanilla 正常對話:總共消耗 2398 tokens 不意外的,大量的篇幅說明 Server Actions 的運作原理、詳細的修改步驟指示,以及各種前後說明的客套話。
  • Caveman Ultra 模式:總共消耗 1227 tokens 直接拿掉了所有贅詞,把「步驟一、步驟二」壓縮成極短的英文縮寫,只留下最重要的程式碼 diff,大概換算下來在三個任務中省下了 48% 的 token!
  • Caveman Wenyan 文言文模式:總共消耗 1606 tokens 以文言文的精簡方式交代步驟(到底是有什麼需求才會做這個mode XD ),但可能是受限於 tokenizer 對中文字元的編碼,只省下了 33% 的 token,效果略輸給 Ultra。

實測的局限

從數據上來看,只要回答中「程式碼」所佔的比例越高,caveman 的節省效率就會跟著遞減,好像也很合理,畢竟總不能讓 AI 把 NextResponse.json 瞎縮寫成 NextRes.json,這樣應該會引來更多的悲劇。

而在純文字回答的入門範例中,雖然帳面上可以爽拿 60.9% 的節省率,但到了實際開發與 修改,程式碼區塊是 byte-preserved,省下的百份率大概就落在 30% 到 40% 左右,不過依然是個很可觀的數字,一個月可以省下大概 40% 的額外 API 帳單,也是一筆不小的費用。

體感上更棒的是,因為 AI 吐出的 token 變少了,IDE 的反應速度也快了很多。

用了一週多,我個人覺得,平日開發使用full模式,大概能穩定省下 40% 到 50% 的 token,而且可讀性最好,如果你正在差找大量的 debug log 或是彙整資料,偶爾可以直接開 ultra,反正你只要看錯誤代碼跟那一兩個關鍵字。

至於 wenyan 模式,安裝完玩過一次即可XD