Skip to content

Token Usage #979

Closed Answered by dluc
nurkmez2 asked this question in 1. Q&A
Jan 16, 2025 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

Total Consumed Token is "serviceTokensIn": 6519 + "serviceTokensOut": 454 = 6973 or not ?

That's correct, though you should also consider serviceReasoningTokens. In other words, tokens whose name start with "service" are the values being billed by the remote service (Azure, OpenAI, Anthropic, etc):

  • "serviceTokensIn": 6519,
  • "serviceTokensOut": 454,
  • "serviceReasoningTokens": 0

The other two values:

  • "tokenizerTokensIn": 6512,
  • "tokenizerTokensOut": 454,

are local measurements done by KM tokenizers, which can be useful in case the remote model doesn't expose any metrics, such as Ollama.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@dluc
Comment options

dluc Jan 16, 2025
Maintainer

@marcominerva
Comment options

@dluc
Comment options

dluc Jan 17, 2025
Maintainer

Answer selected by dluc
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
1. Q&A
Labels
None yet
3 participants