Skip to content

Commit

Permalink
fix: gemini 1.5 pro alias
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Apr 12, 2024
1 parent 3e28efe commit 399bc7e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions aider/models/litellm.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def is_litellm_installed():
"sonnet": "claude-3-sonnet-20240229",
"haiku": "claude-3-haiku-20240307",
# gemini-1.5-pro
"gemini": "gemini-1.5-pro-preview-0409",
"gemini": "gemini/gemini-1.5-pro-latest",
# gpt-3.5
"gpt-3.5": "gpt-3.5-turbo-0613",
"gpt-3.5-turbo": "gpt-3.5-turbo-0613",
Expand All @@ -48,7 +48,15 @@ def __init__(self, name):

model_data = models_info.get(model_id)
if not model_data:
raise ValueError(f"Unsupported model: {model_id}")
# HACK: for gemini 1.5 pro to work, LiteLLM needs the "-latest" part
# included in the model name, but it's not included in the list of
# supported models that way, so finesse it here
if model_id == "gemini/gemini-1.5-pro-latest":
model_data = models_info.get("gemini/gemini-1.5-pro")
if not model_data:
raise ValueError(f"Unsupported model: {model_id}")
else:
raise ValueError(f"Unsupported model: {model_id}")

self.tokenizer = tiktoken.get_encoding("cl100k_base")

Expand Down

0 comments on commit 399bc7e

Please sign in to comment.