From 2d2b50575ee54477c9f9cbe0c46afbc07d7cf3f0 Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Wed, 30 Apr 2025 14:51:24 +1000 Subject: [PATCH 1/2] Add gemini 2.5 flash --- llm_toolkit/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/llm_toolkit/models.py b/llm_toolkit/models.py index 34a249f92..1ce75281b 100644 --- a/llm_toolkit/models.py +++ b/llm_toolkit/models.py @@ -761,6 +761,14 @@ class GeminiV2Think(GeminiV1D5): _vertex_ai_model = 'gemini-2.0-flash-thinking-exp-01-21' +class GeminiV2D5Flash(GeminiModel): + """Gemini 2.5 flash.""" + _max_output_tokens = 65536 + context_window = 1048576 + name = 'vertex_ai_gemini-2-5-flash' + _vertex_ai_model = 'gemini-2.5-flash-preview-04-17' + + class GeminiV1D5Chat(GeminiV1D5): """Gemini 1.5 for chat session.""" name = 'vertex_ai_gemini-1-5-chat' From 492ff60ccb745e384a4ffcb0482fca240c15111c Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Wed, 7 May 2025 23:20:59 +1000 Subject: [PATCH 2/2] fix output size and upgrade aiplatform --- llm_toolkit/models.py | 2 +- requirements.in | 2 +- requirements.txt | 33 +++++++++++++++++---------------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/llm_toolkit/models.py b/llm_toolkit/models.py index 1ce75281b..3a105a9ed 100644 --- a/llm_toolkit/models.py +++ b/llm_toolkit/models.py @@ -763,7 +763,7 @@ class GeminiV2Think(GeminiV1D5): class GeminiV2D5Flash(GeminiModel): """Gemini 2.5 flash.""" - _max_output_tokens = 65536 + _max_output_tokens = 65535 context_window = 1048576 name = 'vertex_ai_gemini-2-5-flash' _vertex_ai_model = 'gemini-2.5-flash-preview-04-17' diff --git a/requirements.in b/requirements.in index 148fc6eb0..ac802b528 100644 --- a/requirements.in +++ b/requirements.in @@ -3,7 +3,7 @@ chardet==5.2.0 cxxfilt==0.3.0 GitPython==3.1.43 google-api-python-client==2.143.0 -google-cloud-aiplatform==1.64.0 +google-cloud-aiplatform==1.91.0 google-cloud-storage==2.9.0 google-cloud-logging==3.11.2 Jinja2==3.1.6 diff --git a/requirements.txt b/requirements.txt index 467f48927..b85a3c9de 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # pip-compile requirements.in @@ -17,20 +17,20 @@ astroid==3.2.4 # via pylint cachetools==5.5.2 # via google-auth -certifi==2025.1.31 +certifi==2025.4.26 # via # httpcore # httpx # requests chardet==5.2.0 # via -r requirements.in -charset-normalizer==3.4.1 +charset-normalizer==3.4.2 # via requests cxxfilt==0.3.0 # via -r requirements.in deprecated==1.2.18 # via opentelemetry-api -dill==0.3.9 +dill==0.4.0 # via pylint distro==1.9.0 # via @@ -58,7 +58,7 @@ google-api-core[grpc]==2.24.2 # google-cloud-storage google-api-python-client==2.143.0 # via -r requirements.in -google-auth==2.38.0 +google-auth==2.40.1 # via # google-api-core # google-api-python-client @@ -72,7 +72,7 @@ google-auth==2.38.0 # google-cloud-storage google-auth-httplib2==0.2.0 # via google-api-python-client -google-cloud-aiplatform==1.64.0 +google-cloud-aiplatform==1.91.0 # via -r requirements.in google-cloud-appengine-logging==1.6.1 # via google-cloud-logging @@ -99,7 +99,7 @@ google-resumable-media==2.7.2 # via # google-cloud-bigquery # google-cloud-storage -googleapis-common-protos[grpc]==1.69.2 +googleapis-common-protos[grpc]==1.70.0 # via # google-api-core # google-cloud-audit-log @@ -109,7 +109,7 @@ grpc-google-iam-v1==0.14.2 # via # google-cloud-logging # google-cloud-resource-manager -grpcio==1.72.0rc1 +grpcio==1.71.0 # via # google-api-core # googleapis-common-protos @@ -117,9 +117,9 @@ grpcio==1.72.0rc1 # grpcio-status grpcio-status==1.71.0 # via google-api-core -h11==0.14.0 +h11==0.16.0 # via httpcore -httpcore==1.0.8 +httpcore==1.0.9 # via httpx httplib2==0.22.0 # via @@ -154,15 +154,15 @@ mccabe==0.7.0 # via pylint nodeenv==1.9.1 # via pyright -numpy==2.2.4 +numpy==2.2.5 # via # pandas # shapely openai==1.72.0 # via -r requirements.in -opentelemetry-api==1.32.0 +opentelemetry-api==1.32.1 # via google-cloud-logging -packaging==24.2 +packaging==25.0 # via # google-cloud-aiplatform # google-cloud-bigquery @@ -198,12 +198,12 @@ pyasn1==0.6.1 # rsa pyasn1-modules==0.4.2 # via google-auth -pydantic==2.11.3 +pydantic==2.11.4 # via # anthropic # google-cloud-aiplatform # openai -pydantic-core==2.33.1 +pydantic-core==2.33.2 # via pydantic pylint==3.2.5 # via -r requirements.in @@ -231,7 +231,7 @@ requests==2.32.3 # google-cloud-storage # huggingface-hub # tiktoken -rsa==4.9 +rsa==4.9.1 # via google-auth rust-demangler==1.0 # via -r requirements.in @@ -262,6 +262,7 @@ typing-extensions==4.13.2 # via # anthropic # anyio + # google-cloud-aiplatform # huggingface-hub # openai # pydantic