Skip to content

feat(self-improving-mastra): explicit per-cloud models (GLM 5 / Gemini 3.5 Flash)#651

Merged
raphaeltm merged 1 commit into
mainfrom
sam/self-improving-mastra-explicit-models
Jul 21, 2026
Merged

feat(self-improving-mastra): explicit per-cloud models (GLM 5 / Gemini 3.5 Flash)#651
raphaeltm merged 1 commit into
mainfrom
sam/self-improving-mastra-explicit-models

Conversation

@defang-sam

@defang-sam defang-sam Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #648.

What

Switches the sample from the chat-default alias to explicit per-cloud model IDs in the committed env files:

Cloud CHAT_MODEL Gateway resolves to
AWS zai.glm-5 bedrock/zai.glm-5 (z.ai GLM 5)
GCP gemini-3.5-flash vertex_ai/gemini-3.5-flash

README model references updated to match.

Validation

  • AWS: GLM 5 is GA on Bedrock (2026-03-18) and available in us-east-1 (the aws stack region). zai.glm-5 is also Defang's existing chat-large mapping, so the LiteLLM gateway path (bedrock/zai.glm-5) is already exercised.
  • docker compose config resolves the top-level model correctly for both stacks.

⚠️ GCP location caveat (needs a decision)

gemini-3.5-flash (GA) is served through Vertex's global endpoint and is not offered on-demand in every regioneurope-west2 (the sample's GCP region) only offers Single-Zone Provisioned Throughput for it. Defang's CLI sets VERTEXAI_LOCATION to the compute region for explicit models (only the chat-large alias forces global, see fixup.go), so this GCP change won't deploy on-demand as-is.

Options:

  1. Deploy GCP in a full on-demand region (e.g. us-central1).
  2. Small CLI change (defang): route explicit gemini-3.x models to the global Vertex endpoint (generalize the existing chat-large special-case).

AWS is unaffected and ready.

🤖 Generated with Claude Code

Samples Checklist

✅ All good!

…i 3.5 Flash)

Replace the chat-default alias with explicit model IDs in the committed env files:
- AWS: CHAT_MODEL=zai.glm-5   (z.ai GLM 5; GA on Bedrock, available in us-east-1)
- GCP: CHAT_MODEL=gemini-3.5-flash   (GA on Vertex AI)

Refresh the README model references to match.

GCP caveat: Gemini 3.x is served via Vertex's global endpoint and is not offered
on-demand in every region (europe-west2 is provisioned-throughput only). Defang
sets VERTEXAI_LOCATION to the compute region for explicit models (only the
chat-large alias forces global), so the GCP deploy needs a location that serves
gemini-3.5-flash: a full on-demand region, or a CLI change routing gemini-3.x to
the global endpoint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@defang-sam
defang-sam Bot temporarily deployed to deploy-changed-samples July 21, 2026 09:58 Inactive
@raphaeltm
raphaeltm merged commit ba7652e into main Jul 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant