Skip to content

BedirT/LLM-Token-Counter-VSCode

Repository files navigation

Live LLM Token Counter

The "gpt-token-counter-live" is a Visual Studio Code extension that displays the token count of selected text or the entire open document in the status bar. The token count is determined using the official tokenizers of GPT and Claude.

This tool is built to get a speedy token counting result right on VS Code while you are working on prompting files. I personally needed a lot while working on many LLM projects, so I decided to make one for myself. I hope this helps you too!

Features

  • Token Count Display: The extension provides a real-time token count of the currently selected text or the entire document if no text is selected. The token count is displayed on the right side of the status bar.
count_display.mp4
  • Auto-Update: The token count is automatically updated as you edit or select text, ensuring that the count is always accurate.

  • Easy Activation: The extension is activated as soon as VS Code starts up, so you don't have to manually activate it every time you start your editor.

  • Model Selection: The extension allows you to select the model you want to use for token counting. The default model is the OpenAI's GPT-4 model. All OpenAI and Anthropic models are available. You can change the model by clicking on the token count in the status bar and selecting the model you want to use.

selection.mp4

Requirements

  • Visual Studio Code: The extension is developed for VS Code and will not work with other editors.

Extension Settings

The extension does not currently add any VS Code settings.

Known Issues

There are currently no known issues. If you encounter a problem, please report it on the issue tracker.

Release Notes

1.1.0

  • Added support for Claude tokenizer.

1.0.0

  • Initial release of gpt-token-counter-live.
  • Provides a token count in the status bar for the selected text or the entire document.
  • Automatically updates the token count as text is edited or selected.
  • Allows the user to select the model to use for token counting.

About

VSCode Extension that shows token count of the selected text

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published