Simon Willison·· 4 小时前AI 评分12
llm-echo 0.5 发布:模拟 token 用量计入工具调用、系统提示词与推理 token
llm-echo 0.5
AI 导读
Simon Willison 发布 llm-echo 0.5,该调试插件提供一个不涉及任何 LLM 的“模型”,只把收到的提示词原样回显。新版本更新了模拟 token 用量统计,将工具调用、系统提示词和推理 token 纳入计算。示例中执行 `uvx --with llm-echo llm -m echo 'hi there' -o thinking 1 --usage` 会输出提示词 JSON,并显示 Token usage: 2 input, 24 output。该插件用于在开发新的 LLM 版本时测试 PR。
正文
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
来源:Simon Willison · simonwillison.net