From 02b18b3be92a94a83e11ae3de3ff4f679045a5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Titsworth-Morin?= Date: Tue, 21 Jul 2026 12:01:55 +0000 Subject: [PATCH] fix(self-improving-mastra): use gemini-2.5-flash on GCP (broadly available) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gemini-3.5-flash (Gemini 3.x) is served only via Vertex's global endpoint and is not offered on-demand in many regions (including the sample's europe-west2), so using it needs per-org enablement / manual setup — and Defang ties VERTEXAI_LOCATION to the deploy region for explicit models. Switch GCP back to the GA gemini-2.5-flash, which is broadly available on-demand across regions (including europe-west2) with no special configuration. AWS keeps z.ai GLM 5. Co-Authored-By: Claude Opus 4.8 --- samples/self-improving-mastra/.env.gcp | 2 +- samples/self-improving-mastra/README.md | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/samples/self-improving-mastra/.env.gcp b/samples/self-improving-mastra/.env.gcp index 5d2cccce..6c1cf325 100644 --- a/samples/self-improving-mastra/.env.gcp +++ b/samples/self-improving-mastra/.env.gcp @@ -1,5 +1,5 @@ # Non-secret Compose interpolation values selected by cli for gcp provider. -CHAT_MODEL=gemini-3.5-flash +CHAT_MODEL=gemini-2.5-flash PUBLISH_ENABLED=true PUBLISH_POLICY=roles/owner PUBLISH_PROVIDER=gcp diff --git a/samples/self-improving-mastra/README.md b/samples/self-improving-mastra/README.md index 88eefba3..060b92fe 100644 --- a/samples/self-improving-mastra/README.md +++ b/samples/self-improving-mastra/README.md @@ -24,7 +24,7 @@ environment: - `db` is shared PostgreSQL for auth, todos, and feedback. - `chat` is the managed model used by the coding agent, declared as a top-level `models:` entry; each cloud's env file selects an explicit model — z.ai GLM 5 - on AWS Bedrock, Gemini 3.5 Flash on GCP Vertex AI. + on AWS Bedrock, Gemini 2.5 Flash on GCP Vertex AI. The **admin console is served by the agent server, not the Next.js app** — it lives outside the source tree the coding agent edits. Caddy routes `/admin` to @@ -88,7 +88,7 @@ defang config set ADMIN_TOKEN --random ## Deployment The same Compose project deploys to either cloud; each cloud's env file selects -an explicit managed model (z.ai GLM 5 on AWS, Gemini 3.5 Flash on GCP). The +an explicit managed model (z.ai GLM 5 on AWS, Gemini 2.5 Flash on GCP). The first deployment creates managed PostgreSQL and can take about 20 minutes. Defang reports separate URLs for `app` and `dev`: @@ -117,10 +117,9 @@ this demo for production. ### GCP (Vertex AI) -The `gcp` env file selects `gemini-3.5-flash` on Vertex AI. Gemini 3.x is -reachable through Vertex's **global** endpoint and is not offered on-demand in -every region, so deploy to a location that serves it. Provide the target project -when deploying: +The `gcp` env file selects `gemini-2.5-flash` on Vertex AI — a GA model that is +broadly available on-demand across regions with no special configuration. +Provide the target project when deploying: ```bash export GCP_PROJECT_ID=your-gcp-project