Skip to content

Commit

Permalink
feat(forge/llm): Add basic support for GPT-4o (#7169)
Browse files Browse the repository at this point in the history
* Add `gpt-4o`
* Add `gpt-4o-2024-05-13`

---------

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
  • Loading branch information
ntindle and Pwuts committed May 24, 2024
1 parent 4e02f7d commit 46c1762
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions forge/forge/llm/providers/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ class OpenAIModelName(str, enum.Enum):
GPT4_TURBO = "gpt-4-turbo"
GPT4_TURBO_PREVIEW = "gpt-4-turbo-preview"
GPT4_VISION = "gpt-4-vision-preview"
GPT4_O_v1 = "gpt-4o-2024-05-13"
GPT4_O_ROLLING = "gpt-4o"
GPT4 = GPT4_ROLLING
GPT4_32k = GPT4_ROLLING_32k
GPT4_O = GPT4_O_ROLLING


OPEN_AI_EMBEDDING_MODELS = {
Expand Down Expand Up @@ -169,6 +172,14 @@ class OpenAIModelName(str, enum.Enum):
max_tokens=128000,
has_function_call_api=True,
),
ChatModelInfo(
name=OpenAIModelName.GPT4_O,
provider_name=ModelProviderName.OPENAI,
prompt_token_cost=5 / 1_000_000,
completion_token_cost=15 / 1_000_000,
max_tokens=128_000,
has_function_call_api=True,
),
]
}
# Copy entries for models with equivalent specs
Expand All @@ -189,6 +200,7 @@ class OpenAIModelName(str, enum.Enum):
OpenAIModelName.GPT4_TURBO_PREVIEW,
OpenAIModelName.GPT4_v5,
],
OpenAIModelName.GPT4_O: [OpenAIModelName.GPT4_O_v1],
}
for base, copies in chat_model_mapping.items():
for copy in copies:
Expand Down

0 comments on commit 46c1762

Please sign in to comment.