GitHub - jamierpond/tokencount: counts tokens! like wc, but for tokens!

1 min read Original article ↗

Token counter CLI. Like wc but for LLM tokens.

   475  counts.py
   878  test_main.py
 1,565  main.py

  386 lines, 11.36 KB

  2,918 tokens (o200k_base)
  Somewhere between The Cat in the Hat and The Waste Land
  139% of The Cat in the Hat, 69% of The Waste Land

2918

Sorted by token count. Total on stdout for piping. Warns if over 1M tokens.