Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/self-improving-mastra/.env.aws
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Non-secret Compose interpolation values selected by cli for aws provider.
CHAT_MODEL=chat-default
CHAT_MODEL=zai.glm-5
PUBLISH_ENABLED=true
PUBLISH_POLICY=arn:aws:iam::aws:policy/AdministratorAccess
PUBLISH_PROVIDER=aws
Expand Down
2 changes: 1 addition & 1 deletion samples/self-improving-mastra/.env.gcp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Non-secret Compose interpolation values selected by cli for gcp provider.
CHAT_MODEL=chat-default
CHAT_MODEL=gemini-3.5-flash
PUBLISH_ENABLED=true
PUBLISH_POLICY=roles/owner
PUBLISH_PROVIDER=gcp
Expand Down
18 changes: 10 additions & 8 deletions samples/self-improving-mastra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ environment:
- `dev` contains the source, Caddy, the Next.js dev server, and the Mastra agent.
- `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 with the `chat-default` alias, so Defang maps it to the
cloud's native inference — Gemini on GCP Vertex AI, Amazon Nova on AWS Bedrock.
`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.

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
Expand Down Expand Up @@ -87,8 +87,8 @@ defang config set ADMIN_TOKEN --random

## Deployment

The `chat` model is `chat-default`, so the same Compose project deploys to
either cloud — Defang resolves it to that provider's managed inference. The
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
first deployment creates managed PostgreSQL and can take about 20 minutes.
Defang reports separate URLs for `app` and `dev`:

Expand All @@ -107,7 +107,7 @@ stack files select different non-secret interpolation files:
| `aws` | `.env.aws` | `AdministratorAccess` |
| `gcp` | `.env.gcp` | `roles/owner` |

The two env files are the place to customize the managed-model alias and other
The two env files are the place to customize the managed model and other
cloud-specific scalar settings. Secrets still belong in `defang config`, never
in these committed files.

Expand All @@ -117,8 +117,10 @@ this demo for production.

### GCP (Vertex AI)

`chat-default` resolves to Gemini on Vertex AI. The `gcp` stack selects
`europe-west2`; provide the target project when deploying:
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:

```bash
export GCP_PROJECT_ID=your-gcp-project
Expand All @@ -127,7 +129,7 @@ defang compose up --stack gcp

### AWS (Bedrock)

`chat-default` resolves to an Amazon Nova model on Bedrock. Enable model access
The `aws` env file selects z.ai GLM 5 (`zai.glm-5`) on Bedrock. Enable model access
for it in the Bedrock console first. The `aws` stack selects `us-east-1`:

```bash
Expand Down
Loading