Ollama token counts #1179
-
Describe the bugGreat product! easy to setup without the overheads. Thanks! To reproduceNA Additional informationNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @aiseei, Ollama returns token counts at the end of the stream or together with the response when not streaming. Just tried this locally and it worked well.
You can then add these token counts to the generation object in Langfuse to track them (docs). |
Beta Was this translation helpful? Give feedback.
Hi @aiseei,
Tracking token usage when using Ollama works well with Langfuse.
Ollama returns token counts at the end of the stream or together with the response when not streaming. Just tried this locally and it worked well.
Example from the api reference:
You can then add these token counts to the generation object in Langfuse to track them (docs).