Simon Willison·· 3 小時前AI 評分41
llm-echo 0.5 更新除錯插件的模擬 token 用量計算
llm-echo 0.5
AI 導讀
llm-echo 0.5 更新除錯插件的模擬 token 用量計算,並把工具呼叫、系統提示詞及推理 token 納入統計。插件提供一個不使用 LLM、只會重複輸入提示詞的「模型」;示例用量為輸入 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