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
Copy file name to clipboardExpand all lines: samples/mastra-nextjs/README.md
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,14 @@ To run the application locally for development, use the development compose file
26
26
docker compose -f compose.dev.yaml up
27
27
```
28
28
29
+
### `GOOGLE_GENERATIVE_AI_API_KEY`
30
+
31
+
When running locally with Docker Compose, you will need to set the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable to your GCP API key. You can get the API key from the [Google AI Studio](https://aistudio.google.com/).
32
+
33
+
### `LLM_MODEL`
34
+
35
+
When running locally with Docker Compose, you are limited to the models on this list: [Google models](https://mastra.ai/models/providers/google).
36
+
29
37
This will:
30
38
31
39
- Start PostgreSQL with volume persistence for local development
@@ -38,26 +46,26 @@ You can access mastra-nextjs at `http://localhost:3000` once the containers are
38
46
39
47
For this sample, you will need to provide the following [configuration](https://docs.defang.io/docs/concepts/configuration). Note that if you are using the 1-click deploy option, you can set these values as secrets in your GitHub repository and the action will automatically deploy them for you.
40
48
41
-
### `GOOGLE_GENERATIVE_AI_API_KEY`
42
-
43
-
Your Google Generative AI API key for accessing the Gemini Flash model. You can get this from the [Google AI Studio](https://aistudio.google.com/).
44
-
45
49
### `POSTGRES_PASSWORD`
46
50
47
51
The password for your Postgres database. You need to set this before deploying for the first time.
48
52
49
53
_You can easily set this to a random string using `defang config set POSTGRES_PASSWORD --random`_
50
54
51
-
### `DB_URL`
55
+
### `LLM_MODEL`
56
+
57
+
_You can easily set this using `defang config set LLM_MODEL=<SELECTED_MODEL>`_
52
58
53
-
The [PostgreSQL database connection string](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING). This will be automatically configured when using BYOC managed database services. It should look something like this: `postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...]`.
59
+
The large language model to use for the AI-powered chat. This can be set to models like `anthropic.claude-3-5-sonnet-20241022-v2:0` for AWS or `gemini-2.5-flash` for Google Cloud. Here is a list of supported models for [GCP](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex#model-capabilities) and [AWS](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock#model-capabilities). For AWS make sure you [request access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html) to the model in AWS Bedrock console and for GCP make sure you have [request access](https://docs.cloud.google.com/marketplace/docs/enable-ai-models#get-ai-models) to the model in GCP Vertex AI console.
54
60
55
61
### `DB_SSL`
56
62
57
63
Set to `true` to enable SSL. Set to `false` to disable SSL, which is used for Defang Playground. (Can be set directly in the Docker Compose file.)
58
64
59
65
### `GITHUB_TOKEN` (Optional)
60
66
67
+
_You can easily set this using `defang config set GITHUB_TOKEN=<YOUR_GITHUB_TOKEN>`_
68
+
61
69
A [GitHub personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) to increase API rate limits when fetching repository data. This is optional but recommended for better performance.
62
70
Setting the permissions to public repositories only is sufficient, unless you want to access private repositories that you have access to.
63
71
@@ -89,6 +97,8 @@ The large context window of Gemini Flash allows the agent to hold more code in m
89
97
90
98
### Defang Playground
91
99
100
+
When deploying, the Playground environment is limited by resource constraints, so only Google Gemini flash or flash-lite models are supported. That said, I recommend using one of the flash models from this [list](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex#model-capabilities). If you want to use other models, please use [Defang BYOC](https://docs.defang.io/docs/tutorials/deploy-to-your-cloud).
101
+
92
102
Deploy your application to the Defang Playground by opening up your terminal and typing:
0 commit comments