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 these tokenizers for 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!
- 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
- Visual Studio Code: The extension is developed for VS Code and will not work with other editors.
The extension does not currently add any VS Code settings.
There are currently no known issues. If you encounter a problem, please report it on the issue tracker.
- Moved from
gpt-tokenizer
totiktoken
package. - Fixed the special tokens issue.
- Modified the code to increase security.
- Added support for GPT-4o tokenizer.
- Removed unused models from the tokenizer list.
- Added Claude-3 as option using approximate token count.
- Added support for Claude tokenizer.
- 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.