Skip to content

Conversation

@DankerMu
Copy link

Summary

Add optional token-usage reporting so you can estimate per-document LLM cost.

Changes

  • Add UsageTracker and global hook in pageindex/utils.py
  • Record response.usage for sync + async OpenAI calls
  • Add --if-report-usage yes to run_pageindex.py to print a usage breakdown at the end
  • Add a small unit test for the tracker

Addresses #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant