openai[patch], community[patch]: add pricing and max context window for GPT-4o (#21673)

# Add pricing and max context window for GPT-4o
- community: add cost per 1k tokens and max context window
- partners: add max context window

**Description:** adds static information about GPT-4o based on
https://openai.com/api/pricing/ and
https://platform.openai.com/docs/models/gpt-4o so that GPT-4o reporting
is accurate.

---------

Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
Alex Riina 2024-05-20 19:47:43 -04:00 committed by GitHub
parent bd39b2ccdf
commit c0e3c3a350
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -661,6 +661,8 @@ class BaseOpenAI(BaseLLM):
max_tokens = openai.modelname_to_contextsize("gpt-3.5-turbo-instruct")
"""
model_token_mapping = {
"gpt-4o": 128_000,
"gpt-4o-2024-05-13": 128_000,
"gpt-4": 8192,
"gpt-4-0314": 8192,
"gpt-4-0613": 8192,

View File

@ -537,6 +537,8 @@ class BaseOpenAI(BaseLLM):
max_tokens = openai.modelname_to_contextsize("gpt-3.5-turbo-instruct")
"""
model_token_mapping = {
"gpt-4o": 128_000,
"gpt-4o-2024-05-13": 128_000,
"gpt-4": 8192,
"gpt-4-0314": 8192,
"gpt-4-0613": 8192,