Skip to content

Feature Request: Add Token Count Estimation to Output #1

@not-an-llm

Description

@not-an-llm

I'd like to propose adding an estimated token count to the generated output. This would help users know if their generated text fits within their LLM's context window limits.

Proposed Feature:

  • Add an estimated token count at the beginning of both llms.txt and llms-full.txt files
  • Display format could be something like:
    Estimated Tokens: 12,345

Why this would be useful:

  • Helps users immediately know if the generated text will fit their LLM's context window
  • Prevents trial-and-error when loading large text files into LLMs
  • Makes it easier to split content into appropriate chunk sizes if needed

Implementation Suggestions:

  • Could use libraries like tiktoken or a simple character-based approximation
  • Token count could be placed in a header section or metadata block at the start of the file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions