Skip to content
Discussion options

You must be logged in to vote

Thanks for the source-level writeup — every link in the chain checks out against master, and the plugin-shaped half of your suggestion now exists.

The gap, confirmed

packages/llm/token-meter/src/estimate.ts prices a retained image by the JSON length of its own reference:

if (block.type === 'image') {
  const { offloaded: _offloaded, ...reference } = block
  return BLOCK_OVERHEAD + Math.ceil(JSON.stringify(reference).length / CHARS_PER_TOKEN)
}

The doc comment on that function already names the reason this is a placeholder rather than a price — "image references, whose request price is route-owned rather than fixed" — and the route-owned answer is resolved one call away, in packages/llm/to…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@matrikslee
Comment options

Answer selected by matrikslee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants