Update model references from gemini-pro to gemini-2.5-pro

This commit is contained in:
மனோஜ்குமார் பழனிச்சாமி
2025-09-22 15:28:11 +05:30
committed by GitHub
parent 52a56bd5fe
commit ed4c2b6883
+24 -24
View File
@@ -45,7 +45,7 @@ vertex_credentials_json = json.dumps(vertex_credentials)
## COMPLETION CALL
response = completion(
model="vertex_ai/gemini-pro",
model="vertex_ai/gemini-2.5-pro",
messages=[{ "content": "Hello, how are you?","role": "user"}],
vertex_credentials=vertex_credentials_json
)
@@ -69,7 +69,7 @@ vertex_credentials_json = json.dumps(vertex_credentials)
response = completion(
model="vertex_ai/gemini-pro",
model="vertex_ai/gemini-2.5-pro",
messages=[{"content": "You are a good bot.","role": "system"}, {"content": "Hello, how are you?","role": "user"}],
vertex_credentials=vertex_credentials_json
)
@@ -189,7 +189,7 @@ print(json.loads(completion.choices[0].message.content))
1. Add model to config.yaml
```yaml
model_list:
- model_name: gemini-pro
- model_name: gemini-2.5-pro
litellm_params:
model: vertex_ai/gemini-1.5-pro
vertex_project: "project-id"
@@ -210,7 +210,7 @@ curl -X POST 'http://0.0.0.0:4000/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-1234' \
-D '{
"model": "gemini-pro",
"model": "gemini-2.5-pro",
"messages": [
{"role": "user", "content": "List 5 popular cookie recipes."}
],
@@ -262,7 +262,7 @@ except JSONSchemaValidationError as e:
1. Add model to config.yaml
```yaml
model_list:
- model_name: gemini-pro
- model_name: gemini-2.5-pro
litellm_params:
model: vertex_ai/gemini-1.5-pro
vertex_project: "project-id"
@@ -283,7 +283,7 @@ curl -X POST 'http://0.0.0.0:4000/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-1234' \
-D '{
"model": "gemini-pro",
"model": "gemini-2.5-pro",
"messages": [
{"role": "user", "content": "List 5 popular cookie recipes."}
],
@@ -391,7 +391,7 @@ client = OpenAI(
)
response = client.chat.completions.create(
model="gemini-pro",
model="gemini-2.5-pro",
messages=[{"role": "user", "content": "Who won the world cup?"}],
tools=[{"googleSearch": {}}],
)
@@ -406,7 +406,7 @@ curl http://localhost:4000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-d '{
"model": "gemini-pro",
"model": "gemini-2.5-pro",
"messages": [
{"role": "user", "content": "Who won the world cup?"}
],
@@ -527,7 +527,7 @@ client = OpenAI(
)
response = client.chat.completions.create(
model="gemini-pro",
model="gemini-2.5-pro",
messages=[{"role": "user", "content": "Who won the world cup?"}],
tools=[{"enterpriseWebSearch": {}}],
)
@@ -542,7 +542,7 @@ curl http://localhost:4000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-d '{
"model": "gemini-pro",
"model": "gemini-2.5-pro",
"messages": [
{"role": "user", "content": "Who won the world cup?"}
],
@@ -835,7 +835,7 @@ import litellm
litellm.vertex_project = "hardy-device-38811" # Your Project ID
litellm.vertex_location = "us-central1" # proj location
response = litellm.completion(model="gemini-pro", messages=[{"role": "user", "content": "write code for saying hi from LiteLLM"}])
response = litellm.completion(model="gemini-2.5-pro", messages=[{"role": "user", "content": "write code for saying hi from LiteLLM"}])
```
## Usage with LiteLLM Proxy Server
@@ -876,9 +876,9 @@ Here's how to use Vertex AI with the LiteLLM Proxy Server
vertex_location: "us-central1" # proj location
model_list:
-model_name: team1-gemini-pro
-model_name: team1-gemini-2.5-pro
litellm_params:
model: gemini-pro
model: gemini-2.5-pro
```
</TabItem>
@@ -905,7 +905,7 @@ Here's how to use Vertex AI with the LiteLLM Proxy Server
)
response = client.chat.completions.create(
model="team1-gemini-pro",
model="team1-gemini-2.5-pro",
messages = [
{
"role": "user",
@@ -925,7 +925,7 @@ Here's how to use Vertex AI with the LiteLLM Proxy Server
--header 'Authorization: Bearer sk-1234' \
--header 'Content-Type: application/json' \
--data '{
"model": "team1-gemini-pro",
"model": "team1-gemini-2.5-pro",
"messages": [
{
"role": "user",
@@ -975,7 +975,7 @@ vertex_credentials_json = json.dumps(vertex_credentials)
response = completion(
model="vertex_ai/gemini-pro",
model="vertex_ai/gemini-2.5-pro",
messages=[{"content": "You are a good bot.","role": "system"}, {"content": "Hello, how are you?","role": "user"}],
vertex_credentials=vertex_credentials_json,
vertex_project="my-special-project",
@@ -1039,7 +1039,7 @@ In certain use-cases you may need to make calls to the models and pass [safety s
```python
response = completion(
model="vertex_ai/gemini-pro",
model="vertex_ai/gemini-2.5-pro",
messages=[{"role": "user", "content": "write code for saying hi from LiteLLM"}]
safety_settings=[
{
@@ -1153,7 +1153,7 @@ litellm.vertex_ai_safety_settings = [
},
]
response = completion(
model="vertex_ai/gemini-pro",
model="vertex_ai/gemini-2.5-pro",
messages=[{"role": "user", "content": "write code for saying hi from LiteLLM"}]
)
```
@@ -1212,7 +1212,7 @@ litellm.vertex_location = "us-central1 # Your Location
## Gemini Pro
| Model Name | Function Call |
|------------------|--------------------------------------|
| gemini-pro | `completion('gemini-pro', messages)`, `completion('vertex_ai/gemini-pro', messages)` |
| gemini-2.5-pro | `completion('gemini-2.5-pro', messages)`, `completion('vertex_ai/gemini-2.5-pro', messages)` |
## Fine-tuned Models
@@ -1307,7 +1307,7 @@ curl --location 'https://0.0.0.0:4000/v1/chat/completions' \
## Gemini Pro Vision
| Model Name | Function Call |
|------------------|--------------------------------------|
| gemini-pro-vision | `completion('gemini-pro-vision', messages)`, `completion('vertex_ai/gemini-pro-vision', messages)`|
| gemini-2.5-pro-vision | `completion('gemini-2.5-pro-vision', messages)`, `completion('vertex_ai/gemini-2.5-pro-vision', messages)`|
## Gemini 1.5 Pro (and Vision)
| Model Name | Function Call |
@@ -1321,7 +1321,7 @@ curl --location 'https://0.0.0.0:4000/v1/chat/completions' \
#### Using Gemini Pro Vision
Call `gemini-pro-vision` in the same input/output format as OpenAI [`gpt-4-vision`](https://docs.litellm.ai/docs/providers/openai#openai-vision-models)
Call `gemini-2.5-pro-vision` in the same input/output format as OpenAI [`gpt-4-vision`](https://docs.litellm.ai/docs/providers/openai#openai-vision-models)
LiteLLM Supports the following image types passed in `url`
- Images with Cloud Storage URIs - gs://cloud-samples-data/generative-ai/image/boats.jpeg
@@ -1339,7 +1339,7 @@ LiteLLM Supports the following image types passed in `url`
import litellm
response = litellm.completion(
model = "vertex_ai/gemini-pro-vision",
model = "vertex_ai/gemini-2.5-pro-vision",
messages=[
{
"role": "user",
@@ -1377,7 +1377,7 @@ image_path = "cached_logo.jpg"
# Getting the base64 string
base64_image = encode_image(image_path)
response = litellm.completion(
model="vertex_ai/gemini-pro-vision",
model="vertex_ai/gemini-2.5-pro-vision",
messages=[
{
"role": "user",
@@ -1433,7 +1433,7 @@ tools = [
messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]
response = completion(
model="vertex_ai/gemini-pro-vision",
model="vertex_ai/gemini-2.5-pro-vision",
messages=messages,
tools=tools,
)