4 ms·
NOTE: this is only valid for the old models (GPT-3 and Codex). IIRC, there is no simple way to know the token usage for the new models (gpt3.5-turbo and beyond)
by yewenjie 4y ago
NOTE: this is only valid for the old models (GPT-3 and Codex). IIRC, there is no simple way to know the token usage for the new models (gpt3.5-turbo and beyond).
- NameError 4y agoThe API does tell you how many prompt and completion tokens each request used, if you're okay knowing after-the-fact
- sebzim4500 4y agoAssuming the API docs are honest, all the publicly available GPTs use the same tokens.
- tedsanders 4y agoDifferent GPTs use different tokens: https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb https://github.com/openai/openai-cookbook/blob/main/examples...
- iamjackg 4y agoYou can use https://github.com/openai/tiktoken https://github.com/openai/tiktoken
- tedsanders 4y agoThis guide explains how to count tokens for 3.5-turbo and beyond: https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb https://github.com/openai/openai-cookbook/blob/main/examples...