Simon Willison 博客·· 4 小时前AI 评分33
llm-echo 0.5 更新模拟 token 用量统计
llm-echo 0.5
AI 导读
Simon Willison 为配合新的 LLM 发布,更新了调试插件 llm-echo 至 0.5,该插件的“模型”不涉及任何 LLM,仅回显输入的提示词。新版模拟 token 用量统计现在会计入工具调用、系统提示词和 reasoning token。示例中一次调用显示 2 个输入 token、24 个输出 token。
正文
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
来源:Simon Willison 博客 · simonwillison.net