-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/new models #248
Feat/new models #248
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,7 +262,7 @@ def build_buy_tx( | |
|
||
except Exception as e: | ||
traceback.print_exception(e) | ||
return f"exception occurred - {e}", None, None, None | ||
return f"exception occurred - {e}", "", None, None | ||
|
||
|
||
def build_return_from_tx_params( | ||
|
@@ -303,7 +303,7 @@ def build_sell_tx( | |
|
||
except Exception as e: | ||
traceback.print_exception(e) | ||
return f"exception occurred - {e}", None, None, None | ||
return f"exception occurred - {e}", "", None, None | ||
|
||
|
||
def with_key_rotation(func: Callable): | ||
|
@@ -348,6 +348,11 @@ def error_response(msg: str) -> Tuple[str, None, None, None]: | |
"limit_max_tokens": 8192, | ||
"temperature": 0, | ||
}, | ||
"gpt-4o-2024-05-13": { | ||
"default_max_tokens": 500, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this limit on 500? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just copied over from above. |
||
"limit_max_tokens": 4096, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. limit max tokens = 128_000 you can check it here |
||
"temperature": 0, | ||
}, | ||
} | ||
|
||
ALLOWED_MODELS = list(LLM_SETTINGS.keys()) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -278,6 +278,11 @@ def count_tokens(text: str, model: str) -> int: | |
"default_max_tokens": 500, | ||
"limit_max_tokens": 8192, | ||
"temperature": 0, | ||
}, | ||
"gpt-4o-2024-05-13": { | ||
"default_max_tokens": 500, | ||
"limit_max_tokens": 4096, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. limit max tokens = 128_000 you can check it here |
||
"temperature": 0, | ||
} | ||
} | ||
ALLOWED_TOOLS = [ | ||
|
@@ -287,7 +292,7 @@ def count_tokens(text: str, model: str) -> int: | |
ALLOWED_MODELS = list(LLM_SETTINGS.keys()) | ||
TOOL_TO_ENGINE = { | ||
"prediction-sentence-embedding-conservative": "gpt-3.5-turbo-0125", | ||
"prediction-sentence-embedding-bold": "gpt-4-0125-preview", | ||
"prediction-sentence-embedding-bold": "gpt-4o-2024-05-13", | ||
} | ||
|
||
PREDICTION_PROMPT = """ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,6 +254,11 @@ def embeddings(self, model, input): | |
"limit_max_tokens": 8192, | ||
"temperature": 0, | ||
}, | ||
"gpt-4o-2024-05-13": { | ||
"default_max_tokens": 500, | ||
"limit_max_tokens": 4096, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. limit max tokens = 128_000 you can check it here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think thats for the input no? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in the url that I shared.... search for sonnet and check the config that is there and the one you wrote for limit_max_tokens you put the max input tokens value, not the max_output tokens value. Then why for the gpt model you are putting in limit_max_tokens the max output tokens instead of the input max? |
||
"temperature": 0, | ||
}, | ||
"claude-3-haiku-20240307": { | ||
"default_max_tokens": 1000, | ||
"limit_max_tokens": 200_000, | ||
|
@@ -264,6 +269,11 @@ def embeddings(self, model, input): | |
"limit_max_tokens": 200_000, | ||
"temperature": 0, | ||
}, | ||
"claude-3-5-sonnet-20240620": { | ||
"default_max_tokens": 1000, | ||
"limit_max_tokens": 200_000, | ||
"temperature": 0, | ||
}, | ||
"claude-3-opus-20240229": { | ||
"default_max_tokens": 1000, | ||
"limit_max_tokens": 200_000, | ||
|
@@ -364,10 +374,10 @@ def multi_queries( | |
model: str, | ||
num_queries: int, | ||
counter_callback: Optional[Callable[[int, int, str], None]] = None, | ||
temperature: Optional[float] = LLM_SETTINGS["claude-3-sonnet-20240229"][ | ||
temperature: Optional[float] = LLM_SETTINGS["claude-3-5-sonnet-20240620"][ | ||
"temperature" | ||
], | ||
max_tokens: Optional[int] = LLM_SETTINGS["claude-3-sonnet-20240229"][ | ||
max_tokens: Optional[int] = LLM_SETTINGS["claude-3-5-sonnet-20240620"][ | ||
"default_max_tokens" | ||
], | ||
) -> List[str]: | ||
|
@@ -612,10 +622,10 @@ def fetch_additional_information( | |
source_links: Optional[List[str]] = None, | ||
num_urls: Optional[int] = DEFAULT_NUM_URLS, | ||
num_queries: Optional[int] = DEFAULT_NUM_QUERIES, | ||
temperature: Optional[float] = LLM_SETTINGS["claude-3-sonnet-20240229"][ | ||
temperature: Optional[float] = LLM_SETTINGS["claude-3-5-sonnet-20240620"][ | ||
"temperature" | ||
], | ||
max_tokens: Optional[int] = LLM_SETTINGS["claude-3-sonnet-20240229"][ | ||
max_tokens: Optional[int] = LLM_SETTINGS["claude-3-5-sonnet-20240620"][ | ||
"default_max_tokens" | ||
], | ||
) -> Tuple[str, Callable[[int, int, str], None]]: | ||
|
@@ -745,7 +755,7 @@ def run(**kwargs) -> Tuple[Optional[str], Any, Optional[Dict[str, Any]], Any]: | |
tool = kwargs["tool"] | ||
model = kwargs.get("model") | ||
if "claude" in tool: # maintain backwards compatibility | ||
model = "claude-3-sonnet-20240229" | ||
model = "claude-3-5-sonnet-20240620" | ||
print(f"MODEL: {model}") | ||
with LLMClientManager(kwargs["api_keys"], model, embedding_provider="openai"): | ||
prompt = extract_question(kwargs["prompt"]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "gpt-4o-2024-08-06" model is cheaper...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will replace.