Simon Willison·· 5 小时前AI 评分33
llm-echo 0.5 发布:模拟 token 用量计入工具调用、系统提示词与推理 token
llm-echo 0.5
AI 导读
llm-echo 0.5 更新了模拟 token 用量统计,把工具调用、系统提示词和推理 token 一并计入。Simon Willison 正在筹备 llm 新版本,测试 PR 时重新查看了这个调试插件。
正文 · AI 翻译
我正在推进一个新的 LLM 版本发布,测试 PR 让我重新审视了 llm-echo 调试插件。这个插件提供了一个完全不涉及 LLM 的“模型”——它只是把喂给它的提示词原样返回。新版本现在会更新模拟的 token 用量计数,把工具调用、系统提示词和推理 token 也计算在内。
示例用法:
uvx --with llm-echo llm -m echo 'hi there' -o thinking 1 --usage
输出:
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