Products

llm-echo 0.5 发布:模拟 token 用量更精确

llm-echo 0.5

Why we picked it

Simon Willison 更新了他的 llm 调试插件 llm-echo,不花一分钱调 API 就能测 token 统计和工具调用,写插件调试时很好用。

Simon Willison 发布 llm-echo 0.5,这是 LLM 工具的调试插件,提供一个完全不调用 LLM 的 echo 模型,只回显收到的提示词。0.5 版本更新了模拟的 token 用量统计,现在会考虑工具调用、system 提示词和 reasoning token。用户可通过 uvx --with llm-echo 一条命令运行,配合 --usage 参数查看输入输出 token 计数。该插件主要用于测试 PR 时验证 prompt 传递是否正确。

Original · Simon Willison’s Weblog

llm-echo 0.5

Release: llm-echo 0.5 I'm working towards a new LLM release, and testing PRs caused me to revisit the llm-echo debug plugin. 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. Example usage: uvx --with llm-echo llm -m echo 'hi there' -o thinking 1 --usage Outputs: First I consider the prompt, then I decide what to say. { "prompt": "hi there", "system": "", "attachments": [], "stream": true, "previous": [] } Token usage: 2 input, 24 output Tags: llm