Repository navigation
Replies: 2 comments 1 reply
1 reply
|
The Python SDK does not know the context window. Token limits live in model docs, not in the API. Anything you "get from Python" is a table you maintain (or a library that maintains one). LiteLLM, Practical options: from openai import OpenAI
client = OpenAI()
model = client.models.retrieve("gpt-4") # no context length here
There is no supported |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is it possible to see through openai library or other way how many maximum tokens can be in a model, for example gpt-4? I need to find out the maximum number of tokens in a model using python code.
For example, gpt-4 has a maximum of 8000 tokens, how can I get this number from the python code?
All reactions