Phoenix may not be displaying the number of tokens due to several potential issues. One common reason is a bug in the integration with specific models or instrumentors, such as the issue with Anthropic models where token usage was not displayed correctly in the Phoenix dashboard despite being present in the response message. This was resolved by updating the `openinference-instrumentation-langchain` package to version 0.1.23, which fixed the token count display issue (<https://github.com/Arize-ai/phoenix/issues/3814|source>).
Another reason could be related to the configuration of the `TokenCountingHandler` or the UI component responsible for displaying token counts. For instance, in the case of VertexAI, the token count was visible in logs but not in the UI, suggesting a possible disconnect in how the data was passed from the backend to the frontend (<https://github.com/Arize-ai/openinference/issues/1287|source>). Additionally, issues with the GraphQL query fetching token counts could also lead to missing token data in the UI (<https://github.com/Arize-ai/phoenix/issues/6148|source>).
Would you like more detail on any specific aspect?
Sources:
- <https://github.com/Arize-ai/phoenix/issues/3814|https://github.com/Arize-ai/phoenix/issues/3814>
- <https://github.com/Arize-ai/openinference/issues/1287|https://github.com/Arize-ai/openinference/issues/1287>
- <https://github.com/Arize-ai/phoenix/issues/6148|https://github.com/Arize-ai/phoenix/issues/6148>