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

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Hacker News
The Hacker News
C
Cyber Attacks, Cyber Crime and Cyber Security
A
Arctic Wolf
Recent Commits to openclaw:main
Recent Commits to openclaw:main
T
Troy Hunt's Blog
小众软件
小众软件
L
LangChain Blog
Schneier on Security
Schneier on Security
D
DataBreaches.Net
爱范儿
爱范儿
P
Proofpoint News Feed
博客园 - 聂微东
M
MIT News - Artificial intelligence
Hacker News: Ask HN
Hacker News: Ask HN
T
Tailwind CSS Blog
Vercel News
Vercel News
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
Jina AI
Jina AI
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
T
Threat Research - Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
月光博客
月光博客
Spread Privacy
Spread Privacy
C
Cisco Blogs
S
Securelist
量子位
S
Security @ Cisco Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tenable Blog
WordPress大学
WordPress大学
T
The Exploit Database - CXSecurity.com
宝玉的分享
宝玉的分享
C
Cybersecurity and Infrastructure Security Agency CISA
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
MongoDB | Blog
MongoDB | Blog
C
CERT Recently Published Vulnerability Notes
Help Net Security
Help Net Security
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 司徒正美
B
Blog RSS Feed
博客园_首页
Security Archives - TechRepublic
Security Archives - TechRepublic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org

Hacker News - Newest: "LLM"

GitHub - lechmazur/position_bias: A benchmark for testing whether LLM judges keep the same preference when two lightly edited versions of the same story are shown in opposite orders. Flex routing (EU and EFTA) Dark Factories: Retooling for LLM Velocity Ask HN: What would be the impact of a LLM output injection attack? GitHub - AronDaron/dataset-generator: No-code desktop app for generating high-quality synthetic datasets to fine-tune LLMs — plan-then-execute pipeline, LLM-as-judge, HuggingFace upload. GitHub - Oaklight/llm-rosetta: Production-ready LLM API translation layer for Python — bidirectional conversion between OpenAI, Anthropic & Google formats via hub-and-spoke IR. Optional API gateway. Streaming & non-streaming. Zero core deps. Contributions welcome! GitHub - browser-use/browser-harness: Self-healing browser harness that enables LLMs to complete any task. GitHub - moeen-mahmud/remen: Remen turns thoughts into something you can return to Analyzing 156 LLM Launch Posts on Hacker News ChatGPT vs Gemini vs Claude: The Best LLM Subscription You Should Buy GitHub - salaamalykum/quran-semantic-search: High-density RAG Semantic Search Engine & Quran Corpus (GEO/SEO Architecture) GitHub - NVIDIA/TensorRT-LLM: TensorRT LLM provides users with an easy-to-use Python API to define Large Language Models (LLMs) and supports state-of-the-art optimizations to perform inference efficiently on NVIDIA GPUs. TensorRT LLM also contains components to create Python and C++ runtimes that orchestrate the inference execution in a performant way. The State of LLM Bug Bounties in 2026 Operational Readiness Criteria for Tool-Using LLM Agents Meshcore: Architecture for a Decentralized P2P LLM Inference Network How an LLM becomes more coherent as we train it GitHub - seetrex-ai/laimark GitHub - Jossifresben/BibCrit: AI-assited biblical textual criticism GitHub - wastedcode/memex: File system based wiki, maintained by Claude 99helpers.com GitHub - cliver-project/AITrigram GitHub - unbody-io/adapt: A self-evolving memory layer for AI agents. GitHub - hb20007/awesome-gen-ai-fails: A list of incidents where reliance on generative AI and LLMs resulted in harm to companies, individuals, or society GitHub - nevenkordic/localmind: Run any local LLM with persistent memory and context. CLI agent over Ollama with SQLite-backed hybrid recall. No cloud. Ask HN: What are the machine requirements for a LLM like Llama-3.1-8B? Faster LLM Inference via Sequential Monte Carlo grpo explained: group relative policy optimization for llm finetuning - cgft Stop comparing price per million tokens: the hidden LLM API costs · TensorZero Andrej Karpathy's LLM Wiki Is a Bad Idea GitHub - GG-QandV/mnemostroma: Offline RAM-first cognitive leer/coprocessor for AI agents and robotics. Solves "Context Abandonment" with 20-80ms latency using a dual-thread biomimetic memory architecture (ONNX + SQLite WAL). mempalace/agent at agent · skorotkiewicz/mempalace GitHub - Nyquest-ai/nyquest-rust-fullstack-pub: Nyquest — Semantic Compression Proxy for LLMs. 350+ rules, local LLM stage, 15-75% token savings. Full Rust stack. GitHub - TheoV823/mneme: Enforce architectural decisions in AI-assisted development. GitHub - klemenvod/TokenBrawl: A 1v1 Bomberman-style game where two LLM agents play autonomously against each other. No human plays — you watch the AIs fight. Each agent receives a text description of the board state, reasons about it, and outputs a move as JSON. The game engine executes it. Introducing the Common AI Provider: LLM and AI Agent Support for Apache Airflow Power Circuit AI: Designing Power Electronic Circuits for Motor Drives with Generative Artificial Intelligence Ask HN: How to program with IDE and LLM on CPU locally? Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis Bonsai 1-bit WebGPU - a Hugging Face Space by webml-community The LLM Fallacy: Misattribution in AI-Assisted Cognitive Workflows Ask HN: Simple tooling for local LLM code critique without IDE integration? Can a General LLM Diagnose a DICOM Slice? A 10-Case Public Benchmark Charts-of-Thought: Enhancing LLM Visualization Literacy (PDF, 2026) GitHub - Mesh-LLM/mesh-llm: Distributed AI/LLM for the people. Share compute privately or publicly to power your agents and chat. GitHub - seamus-brady/springdrift: A persistent runtime for long-lived LLM agents Writing an LLM from scratch, part 32k -- Interventions: training a better model locally with gradient accumulation Ask HN: Which LLM model and agentic CLI are you using for local development? GitHub - wayneColt/modelcascade: Route local. Escalate smart. Never overspend. Open-source multi-model cascade routing for autonomous agents. LLM pricing is 100x harder than you think GitHub - asakin/llm-primer: Pre-warmed Claude Code sessions in tmux. No startup wait. GitHub - EggerMarc/chat-rs: A multi-provider LLM framework for Rust. GitHub - SynapseKit/SynapseKit: Minimal, async-first Python framework for production LLM apps- 2 hard deps, no magic, no SaaS. A Claude Skill that Makes LLM Paragraphs More Bearable Does Gas Town 'steal' usage from users' LLM credits & paid services to improve itself? What's Claude Code Actually Doing? Open the Black Box with the Arthur Engine Milla Jovovich's New Open Source LLM Memory App and the Dark Code Problem Your intuition of LLM token usage might be wrong Show HN: Bloomberg Terminal for LLM ops – free and open source GitHub - 0xchamin/mcptube: Transform YouTube videos into a compounding knowledge base with transcripts, vision analysis, and agentic search. Works as an MCP server for Claude, Copilot & more. Show HN: Open KB: Open LLM Knowledge Base Your LLM is a compiler, not a runtime GitHub - sapountzis/Unslop: A Web Feed That Deserves You crates.io: Rust Package Registry Beyond Karpathy's LLM-Wiki: The Necessity of Cognitive Governance GitHub - amitshekhariitbhu/llm-internals: Learn LLM internals step by step - from tokenization to attention to inference optimization. GitHub - parallem-ai/parallem: An expressive library for running agents with the Batch API. GitHub - stfurkan/pi-llm LLM-Wiki Show HN: Formal – Formal verification for AI-generated code using Lean 4 LRTS – Regression testing for LLM prompts (open source, local-first) LLM Wiki Skill: Build a Second Brain with Claude Code and Obsidian I built an LLM Wiki and RAG solution: here's a demo for a security KB The biggest advance in AI since the LLM Predict-Rlm: The LLM Runtime That Lets Models Write Their Own Control Flow the-synthetic-library/the-synthetic-mind at main · joshferrer1/the-synthetic-library GitHub - yisding/reviewwiggum GitHub - Donnyb369/mcp-spine: Context Minifier & State Guard — Local-first MCP middleware proxy GitHub - Beledarian/wgpu-llm: A from-scratch LLM inference engine that uses wgpu (the cross-platform WebGPU implementation) to dispatch WGSL compute shaders for every math operation a Transformer needs. No CUDA. No Python. No massive framework dependencies. Just Rust, raw shaders, and your GPU. GitHub - anitiue/Hindsight: An experience-driven self-improvement framework for LLM agents — 基于经验的 LLM Agent 自我改进框架 GitHub - stef41/lmscan: 🔍 Detect AI-generated text and fingerprint which LLM wrote it. Open-source GPTZero alternative. Zero dependencies, works offline. GitHub - alainnothere/AmdPerformanceTesting: Amd Performance Testing Ask HN: Is a purely Markdown-based CRM a terrible idea? Optimized for LLM agents Context Engineering - LLM Memory and Retrieval for AI Agents | Weaviate little_helper_tui/letter.md at main · sleepyeldrazi/little_helper_tui GitHub - EvanZhouDev/umr: The Unified Model Registry for all your local AI apps. GitHub - JordanCT/VigIA-Orchestrator Your Agent Is Mine: Measuring Malicious Intermediary Attacks on the LLM Supply Chain A Taxonomy of RL Environments for LLM Agents Llama LLM Network Feture GitHub - genedeng-ca/ai-mac-migration: AI-powered Mac-to-Mac migration tool - replace Apple Migration Assistant with intelligent, selective transfer using local LLMs GitHub - lunargate-ai/gateway: High-performance self-hosted AI gateway (OpenAI-compatible) with routing, retries, and streaming GitHub - AuthBits/webmcp: A lightweight, prompt-driven MCP web research server for high-quality LLM powered information extraction. Externalization in LLM Agents: A Unified Review of Memory, Skills, Protocols and Harness Engineering Springdrift: An Auditable Persistent Runtime for LLM Agents with Case-Based Memory, Normative Safety, and Ambient Self-Perception High-Stakes Personalization: Rethinking LLM Customization for Individual Investor Decision-Making From Static Templates to Dynamic Runtime Graphs: A Survey of Workflow Optimization for LLM Agents HUOZIIME: An On-Device LLM-enhanced Input Method for Deep Personalization TIDE: Token-Informed Depth Execution for Per-Token Early Exit in LLM Inference Characterizing WebGPU Dispatch Overhead for LLM Inference Across Four GPU Vendors, Three Backends, and Three Browsers LLM Targeted Underperformance Disproportionately Impacts Vulnerable Users
Every LLM Tool Call Needs an Output Budget
jhonovich · 2026-06-12 · via Hacker News - Newest: "LLM"

TL;DR

Tools are one of the main reasons AI agents are useful, but tool outputs can quietly explode cost, latency, and context usage. A short user request can become a huge model request if tools return verbose API objects, metadata, comments, logs, or too many results. The fix is not to give up on tools. It is to profile real agent traces and treat tool output as a first-class optimization problem: return the minimum useful information by default, with drill-down paths when more is needed.

Disclaimer

I’m sure strong engineering teams are already doing versions of this. I’m writing because I could not find many practical posts focused specifically on tool output budgets. If you know good examples, I’d appreciate links.

Excitement And Risk Over Tools

One of the most exciting things about modern AI systems are tools. Being able to connect models to search systems, databases, CRMs, browser automation, internal APIs, email systems, calendars, and third-party integrations is genuinely powerful. When an agent combines multiple tools to answer a question or complete a task, it can feel almost magical. It starts to feel less like a chatbot and more like a person piecing together information from different systems.

That excitement is real. It is also dangerous.

Once a tool works, the natural instinct is to add more. More APIs. More integrations. More actions. More data sources. The system becomes more capable, and the demos become more impressive.

But we started looking more carefully at the actual traces.

  • How many tool calls did the agent make?

  • How much did each tool call return?

  • Did a short user question trigger twenty tool calls?

  • Did each of those tool calls send thousands or tens of thousands of tokens back into the model?

That was the uncomfortable part. The agent could be doing the right thing at a high level while still using far more tokens than necessary.

This is not a post arguing against agents, tools, MCP, integration platforms, or third-party services. Quite the opposite. Tools are one of the main reasons modern AI systems are useful. But if tool outputs are treated as incidental, agents can become slow, expensive, and context-limited very quickly.

The Cost Problem

A normal LLM request can be tiny. A user might ask a short question. A model might produce a short answer. A simple math or reasoning question might involve only a few dozen input tokens and a few hundred output tokens. That can cost a tiny fraction of a cent.

But once tools enter the loop, the economics can change completely.

A user can ask a short question, the agent can call a tool, and the tool can send back a very large response. Sometimes that response includes useful information. Often it also includes metadata, timestamps, comments, audit fields, internal IDs, redundant fields, verbose records, irrelevant results, too many rows, too much page content, or too much log output.

Now the request is no longer small. The user’s prompt may have been 30 tokens, but the tool result might be 30,000 or 100,000 tokens.

That creates three problems immediately:

  • Cost, because model APIs charge by tokens.

  • Latency, because large contexts take longer to process.

  • Token maxing, because the request can hit the context limit before the model has done the useful part of the work.

When people complain about agents producing unexpectedly large bills, burning through context, or feeling impractical at scale, I suspect this is often part of the reason. The problem is not necessarily that agents are inherently wasteful. The problem is often that the tools are not optimized for what the model actually needs.

The conclusion should not be:

Tools are the problem.

The better conclusion is:

Tool outputs need budgets.

The Thing That Changed Our Behavior: Per-Query Cost Breakdowns

The most useful thing we did was not a clever prompt.

It was instrumentation.

For every internal agent query, we made it possible for our team to inspect a cost and trace breakdown. Not just the final answer. The whole path.

  • Which tools were called?

  • How many times?

  • How much did each tool return?

  • How much context did each step consume?

  • How much did the model call cost?

  • Did the agent bounce between tools?

  • Did it call a tool, miss, call another tool, then come back to the first one?

  • Did it break a cache?

  • Did a short user question turn into a huge model request because one tool returned too much?

That visibility changed how we debugged the system.

Before that, a query could look fine from the outside. The answer might be correct. The UI might feel normal. But underneath, the agent might have made a chain of expensive calls, included too much tool output, or carried unnecessary context into later steps.

Once everyone internally could see the breakdown, patterns became obvious.

  • A tool returned 40 fields when 6 were needed.

  • A search returned 30 results when 5 would have been enough.

  • An integration included every comment, timestamp, and metadata field.

  • A tool call bypassed a cache.

  • An agent made 15 calls when 4 should have worked.

These were not philosophical problems. They were visible in the trace.

Every time we used the trace view internally, we learned something. Sometimes we found obvious bugs. Sometimes we found inefficient tool descriptions. Sometimes we found that a tool was doing the right thing but returning the wrong shape of output.

That is what pushed us toward the output-budget mindset.

Without per-query cost breakdowns, “tool output optimization” sounds abstract. With them, it becomes obvious. You can see exactly where the tokens are going.

The Mistake We Made

Our mistake was not dramatic. We were not intentionally dumping entire databases into models. We were not sending millions of records into context. Many of the tools were reasonable. The system worked. The agents were useful.

The mistake was treating tool output as secondary.

If the tool returned the correct information, we initially tended to think the tool was working. But correctness is not enough. A tool can return the correct information and still return it inefficiently. It can include too many records, too many fields, too much metadata, too much surrounding context, or too little guidance about what to do next.

That was the shift in thinking for us.

We stopped asking only:

Did the tool work?

And started asking:

Did the tool return the right amount of information, in the right shape, at the right cost?

That is a different standard.

It is closer to performance optimization than basic feature development. The first version proves the tool works. The next version asks whether it works efficiently.

A tool would return a useful answer, but also include more fields than necessary. A search would return relevant results, but too many of them. An integration would return a valid API object, but the object was designed for software, not for an LLM context window. A tool description would say what the tool did, but not firmly enough constrain what should come back.

None of this looked catastrophic in isolation. But across many tools and many agent steps, the costs compounded quickly.

Once we started examining traces and token usage carefully, we found that a number of tool outputs could be reduced significantly. In some cases, the reductions were on the order-of-magnitude level. Not every tool had that much waste, and some of the savings came from fixing our own early mistakes. But the pattern was clear enough that we changed how we think about tools.

The lesson was simple:

Every LLM tool call needs an output budget.

Tool Outputs Become the Next Prompt

The key mental model is simple: a tool output is not just an API response. A tool output becomes part of the next prompt.

The model reads it. The provider charges for it. The context window has to hold it. The next step of the agent depends on it.

That means tool output design is not a secondary detail. It is prompt design, cost control, latency control, and context management all at once.

If a tool returns 50,000 unnecessary tokens, those tokens do not stay inside the tool. They become model input.

This is why “just use a bigger context window” is not a full answer. Bigger context windows help. They are useful. But they do not make excessive tool output free.

Even if a model can accept 200,000 tokens, sending 100,000 unnecessary tokens still costs money, adds latency, and increases the chance that the agent hits limits later in the task.

A bigger context window can absorb waste. It does not eliminate waste.

What an Output Budget Means

An output budget is not just a hard token cap. A hard cap is useful, but it is not enough.

A bad version of this idea is:

Return the first 10,000 characters and cut off the rest.

That is truncation. Sometimes it is necessary, but it is a crude last resort.

A better output budget asks:

What is the minimum useful output this tool should return by default?

Not the absolute minimum. Not a blindly shortened response. The minimum useful response.

That usually means enough information for the model to make the next decision, plus a way to ask for more if needed.

For example, a search tool often should not return every matching document by default. It can return something like:

A log tool often works better when it returns clusters, counts, and representative lines before raw logs:

A CRM or third-party integration often should not return every field the upstream API exposes. It should return the fields relevant to the task, with a way to fetch the full object only if needed.

The goal is not to hide information from the model. The goal is to avoid making the model pay to read information it does not need yet.

There are cases where the model really does need raw output. The point is not to forbid that. The point is to make raw output an explicit choice, not the default result of every integration.

The Output Adapter Pattern

One pattern we have found useful is putting an adapter between raw integrations and the LLM.

Instead of:

use:

The adapter’s job is to turn system-shaped output into model-shaped output.

That can include:

  • Projection, removing fields the model does not need.

  • Ranking, returning the most relevant items first.

  • Aggregation, returning counts, totals, or grouped results instead of raw rows.

  • Clustering, grouping logs, errors, documents, or records into meaningful buckets.

  • Sampling, returning representative examples instead of all examples.

  • Summarization, compressing verbose output into a task-relevant summary.

  • Handle generation, storing the raw result elsewhere and returning a reference the model can expand later.

This adapter does not always require a vector database or another LLM call. Sometimes the best adapter is just a better query. Sometimes it is a ranking function. Sometimes it is a summary. Sometimes it is a cached handle. Sometimes it is a tool description that more firmly constrains what the tool should return.

The important point is that the raw output from an integration is rarely the ideal input for a model.

Third-Party Integrations Make This More Important

This becomes especially important when using third-party integration layers.

These systems are valuable because they let you connect to many external services quickly. That is the point. You can suddenly give an agent access to many useful actions and data sources without building every integration yourself.

That is powerful. It is also exactly why output budgeting matters.

The default shape of an external API response is not necessarily the right shape for an LLM. An API response may be designed for another program, a dashboard, a backend workflow, or a human developer inspecting JSON. It may include every field because that is convenient for a general-purpose API.

But an LLM context window is a different environment.

When integrating third-party tools, the question should not only be:

Can the agent call this service?

It should also be:

What exactly comes back, and how much of it should the model see by default?

If you skip that question, the integration may work beautifully at small scale and become painful once the agent starts chaining calls together.

More Than A Tool Description Problem

Tool descriptions matter. We found that more explicit descriptions can help constrain what a tool should return.

But relying only on descriptions is fragile.

A tool description can say “return only the most relevant results,” but the underlying integration may still produce a verbose payload. A model may call the right tool, but the tool may still return the wrong shape. A third-party service may return a valid object that is useful for software but excessive for an LLM.

That is why we increasingly think of output budgeting as a system design problem, not only a prompt-writing problem.

The model should not be the first component that decides which parts of a huge response matter.

Where possible, that work should happen before the result enters the context window.

The Database and RAG Analogy

A useful analogy is database query optimization, but only up to a point.

In normal software systems, we try not to fetch far more data than we need. We push filtering, projection, aggregation, and ranking closer to the data. If we need a count, we ask for a count. If we need five records, we ask for five records. If we need three fields, we do not return every field in the table.

RAG systems apply a similar idea to documents. The point of retrieval is that we do not send the whole corpus to the model. We search, rank, filter, and send the most relevant chunks.

Tool-heavy agents need the same discipline, but across a wider range of systems: CRMs, ticketing systems, search tools, browser tools, log tools, calendars, email, databases, and third-party integrations.

The difference is that the penalty for over-fetching is much higher when the recipient is an LLM. Sending extra data to a normal backend service is usually wasteful. Sending extra data into a model is wasteful in several ways at once: it increases cost, adds latency, fills the context window, and gives the model more material to sift through.

That is why tool output design needs to be treated as a first-class part of agent architecture.

The goal is not to force every tool into a database pattern. The goal is to apply the same underlying principle:

Do as much filtering, ranking, aggregation, and shaping as possible before the result enters the model context.

What Changed For Us

The practical change was the workflow.

First, we instrumented real usage. For internal queries, we made it possible to inspect the trace: which tools were called, how many times, what each tool returned, how much context each step consumed, and where cost accumulated.

Then we used those traces to tune the system.

Sometimes the fix was a tool description that more clearly told the agent what to request or what not to request. Sometimes the fix was changing the default number of results. Sometimes it was removing fields. Sometimes it was returning a summary instead of raw records. Sometimes it was caching a result and returning a handle. Sometimes it was changing the tool itself so it performed more filtering before returning anything to the model.

The point is that we stopped treating tool outputs as incidental.

We made the tool output a first-class optimization target.

For each important tool, we started asking:

  • What does this tool return by default?

  • Is that default appropriate for the most common use case?

  • How many results should come back before the model asks for more?

  • Which fields are almost never useful to the model?

  • Should this return raw records, a summary, an aggregate, or a handle?

  • Can the tool perform filtering or ranking before the LLM sees the result?

  • Does the trace show the agent repeatedly calling this tool because the output is poorly shaped?

  • Is the tool output optimized for a software API, or for an LLM context window?

  • How will we inspect the cost and trace of this tool in real usage?

That last question matters. Many integrations return perfectly valid API responses that are still poor model inputs.

This is why I think every LLM tool call needs an output budget. Not just a maximum token cap, but an intentional default shape based on what the model usually needs next.

Tools Are Too Valuable To Waste Tokens On Bad Outputs

Tools and integrations are too valuable to treat their outputs casually.

If agents are going to use hundreds of tools across internal systems and third-party services, then tool output design has to become a first-class engineering concern.

Otherwise, we should not be surprised when agents become slow, expensive, or context-limited.

In our experience, fighting token maxing did not mean giving up on tools. It meant making tool outputs much more intentional.

Every LLM tool call needs an output budget because every unnecessary tool token is charged, processed, and carried over to the next model call.

At scale, that becomes one of the difference-makers between agents that feel magical and agents that feel impractical.

If you have seen good writing, tools, or patterns around this, I would appreciate links. I suspect many strong teams are already doing versions of this, but I would like to see the practice discussed more explicitly.