Skip to content

Commit 6207bcd

Browse files
Update models.md to make it clear GLA is production ready (#1030)
1 parent fb51a5f commit 6207bcd

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

docs/models.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,6 @@ agent = Agent(model)
155155

156156
## Gemini
157157

158-
!!! warning "For prototyping only"
159-
Google themselves refer to this API as the "hobby" API, I've received 503 responses from it a number of times.
160-
The API is easy to use and useful for prototyping and simple demos, but I would not rely on it in production.
161-
162-
If you want to run Gemini models in production, you should use the [VertexAI API](#gemini-via-vertexai) described below.
163-
164158
### Install
165159

166160
To use [`GeminiModel`][pydantic_ai.models.gemini.GeminiModel] models, you just need to install [`pydantic-ai`](install.md) or [`pydantic-ai-slim`](install.md#slim-install), no extra dependencies are required.
@@ -171,7 +165,7 @@ To use [`GeminiModel`][pydantic_ai.models.gemini.GeminiModel] models, you just n
171165

172166
[`GeminiModelName`][pydantic_ai.models.gemini.GeminiModelName] contains a list of available Gemini models that can be used through this interface.
173167

174-
To use `GeminiModel`, go to [aistudio.google.com](https://aistudio.google.com/) and follow your nose until you find the place to generate an API key.
168+
To use `GeminiModel`, go to [aistudio.google.com](https://aistudio.google.com/apikey) and select "Create API key".
175169

176170
### Environment variable
177171

@@ -186,7 +180,7 @@ You can then use [`GeminiModel`][pydantic_ai.models.gemini.GeminiModel] by name:
186180
```python {title="gemini_model_by_name.py"}
187181
from pydantic_ai import Agent
188182

189-
agent = Agent('google-gla:gemini-1.5-flash')
183+
agent = Agent('google-gla:gemini-2.0-flash')
190184
...
191185
```
192186

@@ -200,7 +194,7 @@ Or initialise the model directly with just the model name:
200194
from pydantic_ai import Agent
201195
from pydantic_ai.models.gemini import GeminiModel
202196

203-
model = GeminiModel('gemini-1.5-flash')
197+
model = GeminiModel('gemini-2.0-flash')
204198
agent = Agent(model)
205199
...
206200
```
@@ -213,14 +207,14 @@ If you don't want to or can't set the environment variable, you can pass it at r
213207
from pydantic_ai import Agent
214208
from pydantic_ai.models.gemini import GeminiModel
215209

216-
model = GeminiModel('gemini-1.5-flash', api_key='your-api-key')
210+
model = GeminiModel('gemini-2.0-flash', api_key='your-api-key')
217211
agent = Agent(model)
218212
...
219213
```
220214

221215
## Gemini via VertexAI
222216

223-
To run Google's Gemini models in production, you should use [`VertexAIModel`][pydantic_ai.models.vertexai.VertexAIModel] which uses the `*-aiplatform.googleapis.com` API.
217+
If you are an enterprise user, you should use [`VertexAIModel`][pydantic_ai.models.vertexai.VertexAIModel] which uses the `*-aiplatform.googleapis.com` API.
224218

225219
[`GeminiModelName`][pydantic_ai.models.gemini.GeminiModelName] contains a list of available Gemini models that can be used through this interface.
226220

@@ -236,7 +230,7 @@ pip/uv-add 'pydantic-ai-slim[vertexai]'
236230

237231
This interface has a number of advantages over `generativelanguage.googleapis.com` documented above:
238232

239-
1. The VertexAI API is more reliably and marginally lower latency in our experience.
233+
1. The VertexAI API comes with more enterprise readiness guarantees.
240234
2. You can
241235
[purchase provisioned throughput](https://cloud.google.com/vertex-ai/generative-ai/docs/provisioned-throughput#purchase-provisioned-throughput)
242236
with VertexAI to guarantee capacity.
@@ -258,7 +252,7 @@ To use `VertexAIModel`, with [application default credentials](https://cloud.goo
258252
from pydantic_ai import Agent
259253
from pydantic_ai.models.vertexai import VertexAIModel
260254

261-
model = VertexAIModel('gemini-1.5-flash')
255+
model = VertexAIModel('gemini-2.0-flash')
262256
agent = Agent(model)
263257
...
264258
```
@@ -282,7 +276,7 @@ from pydantic_ai import Agent
282276
from pydantic_ai.models.vertexai import VertexAIModel
283277

284278
model = VertexAIModel(
285-
'gemini-1.5-flash',
279+
'gemini-2.0-flash',
286280
service_account_file='path/to/service-account.json',
287281
)
288282
agent = Agent(model)
@@ -299,7 +293,7 @@ Using a region close to your application can improve latency and might be import
299293
from pydantic_ai import Agent
300294
from pydantic_ai.models.vertexai import VertexAIModel
301295

302-
model = VertexAIModel('gemini-1.5-flash', region='asia-east1')
296+
model = VertexAIModel('gemini-2.0-flash', region='asia-east1')
303297
agent = Agent(model)
304298
...
305299
```

0 commit comments

Comments
 (0)