How to measure the credits used in each call to the Parse, Extract, and Classify services? #20260
Replies: 1 comment
-
|
Hi @PedroRodriguezx! I'm Dosu and I’m helping the llama_index team. There isn’t currently a built-in way to measure credits used per call for all three services. For Parse, the API exposes The recommended approach is to implement your own tracking by accessing raw LLM responses (where available) and extracting token usage or cost information. This requires custom logic and may not be possible for every service or provider, since reporting varies widely (source). LlamaIndex provides a callback/event system that you can extend for observability, but it doesn’t natively track credits for these services. If you need per-call credit tracking, you’ll need to rely on upstream API responses (if available) or instrument your workflow to capture token usage at the LLM level. There’s an open feature request to improve this for Parse, but it depends on changes in the upstream To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, I have a workflow for extracting data from documents that involves three LlamaIndex services: Parse, Classify, and Extract. For each document, I end up running jobs across these three services. For debugging and to follow best practices, I need a way to measure how many credits are spent on each call made to these services. I tested using the API to look up previously executed jobs, but it seems that only for the Parse service I can retrieve this data. However, those fields are deprecated and will soon be removed from the API output. Extract does not provide credit consumption information, and Classify, being in beta, is not available yet. I need a way to access this information.
Beta Was this translation helpful? Give feedback.
All reactions