The above package was originally a fork of gpt-3-encoder but has been upgraded to TypeScript and allows for selecting different encode types (e.g. default is cl100k_base, but if you're using davinci you can switch to cl50k_base).
Teams AI just switched to gpt-tokenizer as well :) 👍🏼
https://github.com/niieani/gpt-tokenizer
The above package was originally a fork of gpt-3-encoder but has been upgraded to TypeScript and allows for selecting different encode types (e.g. default is cl100k_base, but if you're using davinci you can switch to cl50k_base).
Teams AI just switched to gpt-tokenizer as well :) 👍🏼