llm-echo 0.5 发布:不调用 LLM 的调试插件,升级模拟 token 统计
摘要
Simon Willison 发布 llm-echo 0.5,这个 LLM CLI 调试插件用一个不调用任何模型的“echo 模型”回显输入 prompt,新版让其模拟的 token 用量统计更贴近真实场景。
核心要点
- llm-echo 是 LLM 命令行工具的调试插件,其 echo“模型”完全不调用 LLM,只把喂给它的 prompt 原样返回
- 0.5 版的核心改动是更新模拟 token 计数逻辑,将工具调用、system prompt 和 reasoning token 一并计入
- 示例命令 `uvx --with llm-echo llm -m echo 'hi there' -o thinking 1 --usage` 会先输出一段模拟“思考”文本,再打印回显 JSON 和 token 用量
- 示例输出结构包含 prompt、system、attachments、stream、previous 等字段,token 用量显示为 2 input、24 output
- 这次更新是作者在准备新的 LLM 版本、测试相关 PR 时的附带产物,属于开发流程中的工具打磨
原文佐证
- This plugin provides a "model" which doesn't involve an LLM at all - it just repeats back the prompts that have been fed to it.
- The new release now updates the simulated token usage counts to take tool calls, system prompts, and reasoning tokens into account.
- Token usage: 2 input, 24 output
AI 洞察
这类“假模型”看似琐碎,却是 agent 工具链可测试性的关键基础设施:不花 API 费用、结果确定,就能验证流式输出、工具调用与用量统计是否正确。随着推理 token 和工具调用成为账单与调试的主要变量,把 token 计量做准已从边角需求变成工程刚需,也侧面反映出 LLM 应用开发正从“调通”走向“可观测、可回归测试”的成熟阶段。