Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Add model token limits to tiktoken_ruby #6

Closed
mattlindsey opened this issue Jun 6, 2023 · 1 comment
Closed

[Proposal] Add model token limits to tiktoken_ruby #6

mattlindsey opened this issue Jun 6, 2023 · 1 comment

Comments

@mattlindsey
Copy link

Would you be opposed to adding token limits to https://github.com/IAPark/tiktoken_ruby/blob/main/lib/tiktoken_ruby.rb and a get_token_limit method?
Seems better here than in the project I'm helping with (https://github.com/andreibondarev/langchainrb).

TOKEN_LIMITS = {
# Source:
# https://platform.openai.com/docs/api-reference/embeddings
# https://platform.openai.com/docs/models/gpt-4
"text-embedding-ada-002" => 8191,
"gpt-3.5-turbo" => 4096,
"gpt-3.5-turbo-0301" => 4096,
"text-davinci-003" => 4097,
"text-davinci-002" => 4097,
"code-davinci-002" => 8001,
"gpt-4" => 8192,
"gpt-4-0314" => 8192,
"gpt-4-32k" => 32768,
"gpt-4-32k-0314" => 32768,
"text-curie-001" => 2049,
"text-babbage-001" => 2049,
"text-ada-001" => 2049,
"davinci" => 2049,
"curie" => 2049,
"babbage" => 2049,
"ada" => 2049
}

@IAPark
Copy link
Owner

IAPark commented Sep 21, 2023

Ah, do you know if that's part of the python tiktoken library?

@mattlindsey mattlindsey closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants