LightRAG icon indicating copy to clipboard operation
LightRAG copied to clipboard

[Question]:单文件token统计

Open wukl001 opened this issue 1 month ago • 3 comments

Do you need to ask a question?

  • [x] I have searched the existing question and discussions and this question is not already answered.
  • [x] I believe this is a legitimate question, not just a bug or feature request.

Your Question

现在有单个文档统计token的功能嘛?

Additional Context

No response

wukl001 avatar Nov 22 '25 09:11 wukl001

没有诶。这个功能有什作用,使用场景是什么?

danielaskdd avatar Nov 22 '25 13:11 danielaskdd

没有诶。这个功能有什作用,使用场景是什么? LightRAG使用线上模型时,发现token消耗很大,所以想看看这个单个文档的token消耗,但是这块改如何取,现在还没思路

wukl001 avatar Nov 25 '25 06:11 wukl001

使用 Langfuse 可以统计 Token使用量

###########################################################
### Langfuse Observability Configuration
### Only works with LLM provided by OpenAI compatible API
### Install with: pip install lightrag-hku[observability]
### Sign up at: https://cloud.langfuse.com or self-host
###########################################################
LANGFUSE_SECRET_KEY=""
LANGFUSE_PUBLIC_KEY=""
LANGFUSE_HOST="https://cloud.langfuse.com"  # 或您的自托管实例地址
LANGFUSE_ENABLE_TRACE=true

danielaskdd avatar Nov 25 '25 09:11 danielaskdd