You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Vertex AI model routing and v1beta1 for preview models (#29)
* fix: Include model name in Vertex AI request params and use v1beta1 for preview models
Three fixes for Vertex AI provider:
1. Include "model" key in build_request_params output so chat/chat_stream
use the correct model name in URL construction instead of falling back
to the default "gemini-2.0-flash"
2. Use v1beta1 API version for preview/experimental models which require
it (v1 returns 404 for these models)
3. Add debug logging for request URLs to aid troubleshooting
* chore: Bump version to 0.12.7, add changelog entry
Changelog documents the Vertex AI model routing fix and v1beta1 support
for preview/experimental models.
* fix: Correct changelog version numbers (0.13.x → 0.12.x)
* fix: Vertex AI v1/v1beta1 bug, global endpoint support, input validation
The v1beta1 fix from 584f569 had a critical bug: Model.parse stored a
hardcoded v1 URL in model.base_url when GOOGLE_CLOUD_PROJECT was set,
bypassing the provider's v1beta1 selection logic. Preview models still
404'd in the most common setup.
Fix: default_base_url(:vertex_ai) now returns nil — URL is built at
request time by the provider with proper v1/v1beta1 selection.
Also adds:
- Global endpoint support (required for Gemini 3.x preview models)
- GOOGLE_CLOUD_LOCATION env var as fallback for GOOGLE_CLOUD_REGION
- Input validation for project ID and region with helpful error messages
- Comprehensive docs (README + moduledoc) with model table, setup guide
- Integration test exercising Flash + Pro on global endpoint
- Multi-region example script
Tested: 782 tests, 0 failures. Integration-tested with service account
against gemini-3.1-pro-preview and gemini-3-flash-preview on global endpoint.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+27-2Lines changed: 27 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,32 @@
2
2
3
3
All notable changes to this project will be documented in this file.
4
4
5
-
## [0.13.2] - 2026-03-07
5
+
## [0.12.8] - 2026-03-12
6
+
7
+
### Fixed
8
+
9
+
-**Vertex AI v1/v1beta1 bug**: `Model.parse("vertex_ai:gemini-2.5-pro-preview-06-05")` with `GOOGLE_CLOUD_PROJECT` set was storing a hardcoded `v1` URL in `model.base_url`, causing the provider's `v1beta1` selection logic to be bypassed. Preview models now correctly use `v1beta1` at request time.
10
+
11
+
### Added
12
+
13
+
-**Vertex AI input validation**: Project ID and region from environment variables are now validated with helpful error messages instead of producing opaque DNS/HTTP errors.
14
+
-**`GOOGLE_CLOUD_LOCATION` support**: Added as a fallback for `GOOGLE_CLOUD_REGION`, consistent with other Google Cloud libraries and tooling.
15
+
- Multi-region example script: `examples/providers/vertex_ai_multi_region.exs`
16
+
17
+
## [0.12.7] - 2026-03-10
18
+
19
+
### Fixed
20
+
21
+
-**Vertex AI model routing**: Fixed `build_request_params/3` not including the `"model"` key in the params map, causing `chat/2` and `chat_stream/2` to always fall back to `"gemini-2.0-flash"` regardless of the requested model.
22
+
-**Vertex AI 404 on preview models**: Use `v1beta1` API version for preview and experimental models (e.g., `gemini-3.1-pro-preview`). The `v1` endpoint returns 404 for these models.
23
+
24
+
### Added
25
+
26
+
-`Nous.Providers.VertexAI.api_version_for_model/1` — returns `"v1beta1"` for preview/experimental models, `"v1"` for stable models.
27
+
-`Nous.Providers.VertexAI.endpoint/3` now accepts an optional model name to select the correct API version.
28
+
- Debug logging for Vertex AI request URLs.
29
+
30
+
## [0.12.6] - 2026-03-07
6
31
7
32
### Added
8
33
@@ -12,7 +37,7 @@ All notable changes to this project will be documented in this file.
12
37
- New config options: `:auto_update_memory`, `:auto_update_every`, `:reflection_model`, `:reflection_max_tokens`, `:reflection_max_messages`, `:reflection_max_memories`
0 commit comments