Merge pull request #1402 from KennyDizi/main

Add support for OpenAI `o1` model and snapshot version `o1-2024-12-17`
This commit is contained in:
Tal
2024-12-22 09:36:04 +02:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@ -24,6 +24,8 @@ MAX_TOKENS = {
'o1-mini-2024-09-12': 128000, # 128K, but may be limited by config.max_model_tokens
'o1-preview': 128000, # 128K, but may be limited by config.max_model_tokens
'o1-preview-2024-09-12': 128000, # 128K, but may be limited by config.max_model_tokens
'o1-2024-12-17': 204800, # 200K, but may be limited by config.max_model_tokens
'o1': 204800, # 200K, but may be limited by config.max_model_tokens
'claude-instant-1': 100000,
'claude-2': 100000,
'command-nightly': 4096,

View File

@ -193,8 +193,8 @@ class LiteLLMAIHandler(BaseAiHandler):
messages[1]["content"] = [{"type": "text", "text": messages[1]["content"]},
{"type": "image_url", "image_url": {"url": img_path}}]
# Currently O1 does not support separate system and user prompts
O1_MODEL_PREFIX = 'o1-'
# Currently, model OpenAI o1 series does not support a separate system and user prompts
O1_MODEL_PREFIX = 'o1'
model_type = model.split('/')[-1] if '/' in model else model
if model_type.startswith(O1_MODEL_PREFIX):
user = f"{system}\n\n\n{user}"