gpt-tokenizer
A pure JavaScript implementation of a BPE tokenizer (Encoder/Decoder) for GPT-2 / GPT-3 / GPT-4 and other OpenAI models
llm-api
Fully typed chat APIs for OpenAI and Azure's chat models - with token checking and retries
openai-tokens
A service for calculating, managing, truncating openai prompt tokens
openai-gpt-token-counter
Count the number of OpenAI tokens in a string. Supports all OpenAI Text models (text-davinci-003, gpt-3.5-turbo, gpt-4)