@mastra/mcp-docs-server 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/docs/agents/agent-approval.md +61 -31
- package/.docs/docs/agents/supervisor-agents.md +1 -1
- package/.docs/docs/getting-started/manual-install.md +1 -1
- package/.docs/docs/index.md +68 -24
- package/.docs/docs/mastra-cloud/setup.md +1 -1
- package/.docs/docs/memory/observational-memory.md +9 -0
- package/.docs/docs/memory/semantic-recall.md +17 -1
- package/.docs/docs/workspace/skills.md +7 -5
- package/.docs/guides/deployment/aws-lambda.md +76 -165
- package/.docs/guides/deployment/azure-app-services.md +38 -61
- package/.docs/guides/deployment/cloudflare.md +1 -1
- package/.docs/guides/deployment/netlify.md +1 -1
- package/.docs/guides/deployment/vercel.md +1 -1
- package/.docs/models/gateways/netlify.md +5 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/anthropic.md +9 -9
- package/.docs/models/providers/deepseek.md +1 -1
- package/.docs/models/providers/google.md +11 -11
- package/.docs/models/providers/openai.md +19 -19
- package/.docs/models/providers/opencode.md +33 -33
- package/.docs/models/providers/xai.md +3 -3
- package/.docs/reference/agents/agent.md +20 -20
- package/.docs/reference/agents/generate.md +200 -66
- package/.docs/reference/agents/generateLegacy.md +77 -35
- package/.docs/reference/agents/getDefaultGenerateOptions.md +4 -6
- package/.docs/reference/agents/getDefaultOptions.md +4 -6
- package/.docs/reference/agents/getDefaultStreamOptions.md +4 -6
- package/.docs/reference/agents/getDescription.md +1 -1
- package/.docs/reference/agents/getInstructions.md +4 -6
- package/.docs/reference/agents/getLLM.md +6 -8
- package/.docs/reference/agents/getMemory.md +4 -6
- package/.docs/reference/agents/getModel.md +4 -6
- package/.docs/reference/agents/getTools.md +5 -7
- package/.docs/reference/agents/getVoice.md +4 -6
- package/.docs/reference/agents/listAgents.md +4 -6
- package/.docs/reference/agents/listScorers.md +4 -6
- package/.docs/reference/agents/listTools.md +4 -6
- package/.docs/reference/agents/listWorkflows.md +4 -6
- package/.docs/reference/agents/network.md +69 -23
- package/.docs/reference/ai-sdk/chat-route.md +7 -7
- package/.docs/reference/ai-sdk/handle-chat-stream.md +12 -12
- package/.docs/reference/ai-sdk/handle-network-stream.md +4 -4
- package/.docs/reference/ai-sdk/handle-workflow-stream.md +11 -11
- package/.docs/reference/ai-sdk/network-route.md +3 -3
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +9 -9
- package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +9 -9
- package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +5 -5
- package/.docs/reference/ai-sdk/with-mastra.md +12 -12
- package/.docs/reference/ai-sdk/workflow-route.md +3 -3
- package/.docs/reference/auth/auth0.md +6 -6
- package/.docs/reference/auth/better-auth.md +5 -5
- package/.docs/reference/auth/clerk.md +5 -5
- package/.docs/reference/auth/firebase.md +7 -7
- package/.docs/reference/auth/jwt.md +1 -1
- package/.docs/reference/auth/supabase.md +4 -4
- package/.docs/reference/auth/workos.md +6 -6
- package/.docs/reference/cli/create-mastra.md +14 -14
- package/.docs/reference/client-js/mastra-client.md +23 -23
- package/.docs/reference/client-js/workflows.md +3 -3
- package/.docs/reference/core/addGateway.md +2 -2
- package/.docs/reference/core/getAgent.md +2 -2
- package/.docs/reference/core/getAgentById.md +2 -2
- package/.docs/reference/core/getDeployer.md +1 -1
- package/.docs/reference/core/getGateway.md +2 -2
- package/.docs/reference/core/getGatewayById.md +2 -2
- package/.docs/reference/core/getLogger.md +1 -1
- package/.docs/reference/core/getMCPServer.md +2 -2
- package/.docs/reference/core/getMCPServerById.md +3 -3
- package/.docs/reference/core/getMemory.md +2 -2
- package/.docs/reference/core/getScorer.md +2 -2
- package/.docs/reference/core/getScorerById.md +2 -2
- package/.docs/reference/core/getServer.md +1 -1
- package/.docs/reference/core/getStorage.md +1 -1
- package/.docs/reference/core/getStoredAgentById.md +18 -20
- package/.docs/reference/core/getTelemetry.md +1 -1
- package/.docs/reference/core/getVector.md +2 -2
- package/.docs/reference/core/getWorkflow.md +3 -3
- package/.docs/reference/core/listAgents.md +1 -1
- package/.docs/reference/core/listGateways.md +1 -1
- package/.docs/reference/core/listLogs.md +9 -11
- package/.docs/reference/core/listLogsByRunId.md +9 -9
- package/.docs/reference/core/listMCPServers.md +1 -1
- package/.docs/reference/core/listMemory.md +1 -1
- package/.docs/reference/core/listScorers.md +1 -1
- package/.docs/reference/core/listStoredAgents.md +9 -11
- package/.docs/reference/core/listVectors.md +1 -1
- package/.docs/reference/core/listWorkflows.md +2 -2
- package/.docs/reference/core/mastra-class.md +17 -17
- package/.docs/reference/core/mastra-model-gateway.md +15 -15
- package/.docs/reference/core/setLogger.md +2 -4
- package/.docs/reference/core/setStorage.md +1 -1
- package/.docs/reference/datasets/addItem.md +20 -4
- package/.docs/reference/datasets/addItems.md +8 -2
- package/.docs/reference/datasets/compareExperiments.md +15 -3
- package/.docs/reference/datasets/create.md +6 -6
- package/.docs/reference/datasets/dataset.md +1 -1
- package/.docs/reference/datasets/delete.md +2 -2
- package/.docs/reference/datasets/deleteExperiment.md +2 -2
- package/.docs/reference/datasets/deleteItem.md +2 -2
- package/.docs/reference/datasets/deleteItems.md +2 -2
- package/.docs/reference/datasets/get.md +2 -2
- package/.docs/reference/datasets/getDetails.md +9 -9
- package/.docs/reference/datasets/getExperiment.md +2 -2
- package/.docs/reference/datasets/getItem.md +3 -3
- package/.docs/reference/datasets/getItemHistory.md +22 -2
- package/.docs/reference/datasets/list.md +7 -3
- package/.docs/reference/datasets/listExperimentResults.md +34 -4
- package/.docs/reference/datasets/listExperiments.md +41 -3
- package/.docs/reference/datasets/listItems.md +18 -6
- package/.docs/reference/datasets/listVersions.md +23 -3
- package/.docs/reference/datasets/startExperiment.md +62 -12
- package/.docs/reference/datasets/startExperimentAsync.md +5 -1
- package/.docs/reference/datasets/update.md +6 -6
- package/.docs/reference/datasets/updateItem.md +5 -5
- package/.docs/reference/deployer.md +8 -8
- package/.docs/reference/evals/answer-relevancy.md +11 -11
- package/.docs/reference/evals/answer-similarity.md +17 -19
- package/.docs/reference/evals/bias.md +10 -10
- package/.docs/reference/evals/completeness.md +3 -3
- package/.docs/reference/evals/content-similarity.md +6 -6
- package/.docs/reference/evals/context-precision.md +4 -4
- package/.docs/reference/evals/context-relevance.md +4 -4
- package/.docs/reference/evals/create-scorer.md +47 -49
- package/.docs/reference/evals/faithfulness.md +11 -11
- package/.docs/reference/evals/hallucination.md +17 -21
- package/.docs/reference/evals/keyword-coverage.md +4 -4
- package/.docs/reference/evals/mastra-scorer.md +14 -14
- package/.docs/reference/evals/noise-sensitivity.md +4 -4
- package/.docs/reference/evals/prompt-alignment.md +4 -4
- package/.docs/reference/evals/run-evals.md +16 -16
- package/.docs/reference/evals/scorer-utils.md +3 -3
- package/.docs/reference/evals/textual-difference.md +3 -3
- package/.docs/reference/evals/tone-consistency.md +3 -3
- package/.docs/reference/evals/tool-call-accuracy.md +5 -5
- package/.docs/reference/evals/toxicity.md +8 -8
- package/.docs/reference/harness/harness-class.md +34 -42
- package/.docs/reference/logging/pino-logger.md +5 -5
- package/.docs/reference/memory/clone-utilities.md +5 -5
- package/.docs/reference/memory/cloneThread.md +17 -21
- package/.docs/reference/memory/createThread.md +10 -10
- package/.docs/reference/memory/deleteMessages.md +2 -2
- package/.docs/reference/memory/getThreadById.md +2 -2
- package/.docs/reference/memory/listThreads.md +5 -5
- package/.docs/reference/memory/memory-class.md +12 -14
- package/.docs/reference/memory/observational-memory.md +102 -94
- package/.docs/reference/memory/recall.md +14 -16
- package/.docs/reference/observability/tracing/configuration.md +27 -10
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +4 -7
- package/.docs/reference/processors/batch-parts-processor.md +8 -10
- package/.docs/reference/processors/language-detector.md +14 -16
- package/.docs/reference/processors/message-history-processor.md +7 -9
- package/.docs/reference/processors/moderation-processor.md +13 -15
- package/.docs/reference/processors/pii-detector.md +14 -16
- package/.docs/reference/processors/processor-interface.md +62 -62
- package/.docs/reference/processors/prompt-injection-detector.md +11 -13
- package/.docs/reference/processors/semantic-recall-processor.md +14 -16
- package/.docs/reference/processors/system-prompt-scrubber.md +12 -14
- package/.docs/reference/processors/token-limiter-processor.md +11 -13
- package/.docs/reference/processors/tool-call-filter.md +5 -7
- package/.docs/reference/processors/tool-search-processor.md +9 -11
- package/.docs/reference/processors/unicode-normalizer.md +8 -10
- package/.docs/reference/processors/working-memory-processor.md +14 -18
- package/.docs/reference/rag/chunk.md +38 -38
- package/.docs/reference/rag/database-config.md +11 -7
- package/.docs/reference/rag/document.md +2 -2
- package/.docs/reference/rag/embeddings.md +12 -12
- package/.docs/reference/rag/extract-params.md +23 -23
- package/.docs/reference/rag/graph-rag.md +12 -12
- package/.docs/reference/rag/rerank.md +25 -17
- package/.docs/reference/rag/rerankWithScorer.md +25 -17
- package/.docs/reference/server/create-route.md +14 -14
- package/.docs/reference/server/express-adapter.md +10 -10
- package/.docs/reference/server/fastify-adapter.md +10 -10
- package/.docs/reference/server/hono-adapter.md +10 -10
- package/.docs/reference/server/koa-adapter.md +10 -10
- package/.docs/reference/server/mastra-server.md +10 -10
- package/.docs/reference/server/register-api-route.md +13 -13
- package/.docs/reference/storage/cloudflare-d1.md +5 -5
- package/.docs/reference/storage/cloudflare.md +6 -6
- package/.docs/reference/storage/composite.md +9 -9
- package/.docs/reference/storage/convex.md +3 -3
- package/.docs/reference/storage/dynamodb.md +9 -9
- package/.docs/reference/storage/lance.md +3 -3
- package/.docs/reference/storage/libsql.md +2 -2
- package/.docs/reference/storage/mongodb.md +5 -5
- package/.docs/reference/storage/mssql.md +2 -2
- package/.docs/reference/storage/postgresql.md +25 -25
- package/.docs/reference/storage/upstash.md +3 -3
- package/.docs/reference/streaming/ChunkType.md +251 -59
- package/.docs/reference/streaming/agents/MastraModelOutput.md +86 -16
- package/.docs/reference/streaming/agents/stream.md +155 -43
- package/.docs/reference/streaming/agents/streamLegacy.md +79 -39
- package/.docs/reference/streaming/workflows/resumeStream.md +18 -8
- package/.docs/reference/streaming/workflows/stream.md +21 -9
- package/.docs/reference/streaming/workflows/timeTravelStream.md +4 -4
- package/.docs/reference/tools/create-tool.md +25 -21
- package/.docs/reference/tools/document-chunker-tool.md +7 -7
- package/.docs/reference/tools/graph-rag-tool.md +16 -18
- package/.docs/reference/tools/mcp-client.md +38 -27
- package/.docs/reference/tools/mcp-server.md +45 -45
- package/.docs/reference/tools/vector-query-tool.md +34 -22
- package/.docs/reference/vectors/astra.md +22 -22
- package/.docs/reference/vectors/chroma.md +44 -44
- package/.docs/reference/vectors/convex.md +26 -26
- package/.docs/reference/vectors/couchbase.md +30 -30
- package/.docs/reference/vectors/duckdb.md +29 -29
- package/.docs/reference/vectors/elasticsearch.md +27 -27
- package/.docs/reference/vectors/lance.md +46 -38
- package/.docs/reference/vectors/libsql.md +31 -31
- package/.docs/reference/vectors/mongodb.md +32 -32
- package/.docs/reference/vectors/opensearch.md +27 -27
- package/.docs/reference/vectors/pg.md +60 -44
- package/.docs/reference/vectors/pinecone.md +38 -38
- package/.docs/reference/vectors/qdrant.md +36 -36
- package/.docs/reference/vectors/s3vectors.md +24 -24
- package/.docs/reference/vectors/turbopuffer.md +29 -29
- package/.docs/reference/vectors/upstash.md +25 -25
- package/.docs/reference/vectors/vectorize.md +27 -27
- package/.docs/reference/voice/azure.md +19 -15
- package/.docs/reference/voice/cloudflare.md +10 -12
- package/.docs/reference/voice/composite-voice.md +10 -10
- package/.docs/reference/voice/deepgram.md +20 -14
- package/.docs/reference/voice/elevenlabs.md +20 -22
- package/.docs/reference/voice/google-gemini-live.md +42 -44
- package/.docs/reference/voice/google.md +25 -21
- package/.docs/reference/voice/mastra-voice.md +20 -20
- package/.docs/reference/voice/murf.md +24 -28
- package/.docs/reference/voice/openai-realtime.md +26 -26
- package/.docs/reference/voice/openai.md +14 -12
- package/.docs/reference/voice/playai.md +13 -15
- package/.docs/reference/voice/sarvam.md +21 -25
- package/.docs/reference/voice/speechify.md +11 -13
- package/.docs/reference/voice/voice.addInstructions.md +1 -1
- package/.docs/reference/voice/voice.addTools.md +1 -1
- package/.docs/reference/voice/voice.answer.md +1 -1
- package/.docs/reference/voice/voice.connect.md +3 -3
- package/.docs/reference/voice/voice.events.md +11 -11
- package/.docs/reference/voice/voice.getSpeakers.md +30 -30
- package/.docs/reference/voice/voice.listen.md +9 -9
- package/.docs/reference/voice/voice.off.md +2 -2
- package/.docs/reference/voice/voice.on.md +2 -2
- package/.docs/reference/voice/voice.send.md +1 -1
- package/.docs/reference/voice/voice.speak.md +11 -11
- package/.docs/reference/voice/voice.updateConfig.md +3 -3
- package/.docs/reference/workflows/run-methods/cancel.md +2 -2
- package/.docs/reference/workflows/run-methods/restart.md +17 -5
- package/.docs/reference/workflows/run-methods/resume.md +23 -9
- package/.docs/reference/workflows/run-methods/start.md +22 -8
- package/.docs/reference/workflows/run-methods/startAsync.md +12 -6
- package/.docs/reference/workflows/run-methods/timeTravel.md +29 -13
- package/.docs/reference/workflows/run.md +12 -12
- package/.docs/reference/workflows/step.md +24 -26
- package/.docs/reference/workflows/workflow-methods/branch.md +2 -2
- package/.docs/reference/workflows/workflow-methods/commit.md +1 -1
- package/.docs/reference/workflows/workflow-methods/create-run.md +4 -4
- package/.docs/reference/workflows/workflow-methods/dountil.md +3 -3
- package/.docs/reference/workflows/workflow-methods/dowhile.md +3 -3
- package/.docs/reference/workflows/workflow-methods/foreach.md +9 -9
- package/.docs/reference/workflows/workflow-methods/map.md +2 -2
- package/.docs/reference/workflows/workflow-methods/parallel.md +2 -2
- package/.docs/reference/workflows/workflow-methods/sleep.md +2 -2
- package/.docs/reference/workflows/workflow-methods/sleepUntil.md +2 -2
- package/.docs/reference/workflows/workflow-methods/then.md +2 -2
- package/.docs/reference/workflows/workflow.md +40 -50
- package/.docs/reference/workspace/daytona-sandbox.md +33 -33
- package/.docs/reference/workspace/e2b-sandbox.md +20 -20
- package/.docs/reference/workspace/filesystem.md +22 -22
- package/.docs/reference/workspace/gcs-filesystem.md +15 -15
- package/.docs/reference/workspace/local-filesystem.md +35 -35
- package/.docs/reference/workspace/local-sandbox.md +26 -26
- package/.docs/reference/workspace/s3-filesystem.md +18 -18
- package/.docs/reference/workspace/sandbox.md +8 -8
- package/.docs/reference/workspace/workspace-class.md +30 -34
- package/CHANGELOG.md +16 -0
- package/package.json +6 -6
- package/.docs/docs/getting-started/start.md +0 -28
|
@@ -1,84 +1,64 @@
|
|
|
1
|
-
# AWS Lambda
|
|
1
|
+
# Deploy Mastra to AWS Lambda
|
|
2
2
|
|
|
3
|
-
Deploy your Mastra
|
|
3
|
+
Deploy your Mastra application to AWS Lambda using Docker containers and the [AWS Lambda Web Adapter](https://github.com/awslabs/aws-lambda-web-adapter). This approach runs your Mastra server as a containerized Lambda function with automatic scaling.
|
|
4
4
|
|
|
5
|
-
> **
|
|
5
|
+
> **Info:** This guide covers deploying the [Mastra server](https://mastra.ai/docs/server/mastra-server). If you're using a [server adapter](https://mastra.ai/docs/server/server-adapters) or [web framework](https://mastra.ai/docs/deployment/web-framework), deploy the way you normally would for that framework.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Before you begin
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
You'll need:
|
|
10
10
|
|
|
11
|
-
- [
|
|
12
|
-
- [
|
|
13
|
-
-
|
|
14
|
-
-
|
|
11
|
+
- A [Mastra application](https://mastra.ai/guides/getting-started/quickstart)
|
|
12
|
+
- An [AWS account](https://aws.amazon.com/) with permissions for Lambda, ECR, and IAM
|
|
13
|
+
- **[AWS CLI](https://aws.amazon.com/cli/)** installed — run `aws configure` to authenticate
|
|
14
|
+
- **[Docker](https://www.docker.com/)** installed and running
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
> **Warning:** On AWS Lambda, the filesystem is ephemeral, so any local database file will be lost between invocations. If you're using [LibSQLStore](https://mastra.ai/reference/storage/libsql) with a local file, configure it to use a remote LibSQL-compatible database (for example, [Turso](https://turso.tech/)) instead.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
## Create a Dockerfile
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### Option 1: In-Memory (Simplest)
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
import { LibSQLStore } from '@mastra/libsql'
|
|
26
|
-
|
|
27
|
-
const storage = new LibSQLStore({
|
|
28
|
-
id: 'mastra-storage',
|
|
29
|
-
url: ':memory:', // in-memory storage
|
|
30
|
-
})
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Option 2: External Storage Providers
|
|
34
|
-
|
|
35
|
-
For persistent memory across Lambda invocations, use external storage providers like `LibSQLStore` with Turso or other storage providers like `PostgreStore`:
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
import { LibSQLStore } from '@mastra/libsql'
|
|
39
|
-
|
|
40
|
-
const storage = new LibSQLStore({
|
|
41
|
-
id: 'mastra-storage',
|
|
42
|
-
url: 'libsql://your-database.turso.io', // External Turso database
|
|
43
|
-
authToken: process.env.TURSO_AUTH_TOKEN,
|
|
44
|
-
})
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
For more memory configuration options, see the [Memory documentation](https://mastra.ai/docs/memory/overview).
|
|
48
|
-
|
|
49
|
-
## Creating a Dockerfile
|
|
50
|
-
|
|
51
|
-
Create a `Dockerfile` in your Mastra project root directory:
|
|
20
|
+
Create a `Dockerfile` in your project root:
|
|
52
21
|
|
|
53
22
|
```dockerfile
|
|
54
23
|
FROM node:22-alpine
|
|
55
24
|
|
|
56
25
|
WORKDIR /app
|
|
26
|
+
|
|
27
|
+
# Install dependencies
|
|
57
28
|
COPY package*.json ./
|
|
58
29
|
RUN npm ci
|
|
30
|
+
|
|
31
|
+
# Copy source and build Mastra
|
|
59
32
|
COPY src ./src
|
|
60
33
|
RUN npx mastra build
|
|
34
|
+
|
|
35
|
+
# Alpine compatibility for some native deps
|
|
61
36
|
RUN apk add --no-cache gcompat
|
|
62
37
|
|
|
63
|
-
|
|
38
|
+
# Add the Lambda Web Adapter
|
|
39
|
+
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.9.1 /lambda-adapter /opt/extensions/lambda-adapter
|
|
40
|
+
|
|
41
|
+
# Run as non-root
|
|
64
42
|
RUN addgroup -g 1001 -S nodejs && \
|
|
65
43
|
adduser -S mastra -u 1001 && \
|
|
66
44
|
chown -R mastra:nodejs /app
|
|
67
45
|
|
|
68
46
|
USER mastra
|
|
69
47
|
|
|
48
|
+
# Adapter / app configuration
|
|
70
49
|
ENV PORT=8080
|
|
71
50
|
ENV NODE_ENV=production
|
|
72
|
-
ENV
|
|
73
|
-
|
|
74
|
-
EXPOSE 8080
|
|
51
|
+
ENV AWS_LWA_READINESS_CHECK_PATH="/api"
|
|
75
52
|
|
|
53
|
+
# Start the Mastra server
|
|
76
54
|
CMD ["node", ".mastra/output/index.mjs"]
|
|
77
55
|
```
|
|
78
56
|
|
|
79
|
-
|
|
57
|
+
> **Note:** This Dockerfile uses npm. If you're using pnpm, yarn, or another package manager, adjust the commands accordingly (e.g. `npm ci` won't work with pnpm lockfiles).
|
|
80
58
|
|
|
81
|
-
|
|
59
|
+
## Build and push the Docker image
|
|
60
|
+
|
|
61
|
+
1. Set up environment variables for the deployment. Use the same region for all AWS services (ECR, Lambda) to avoid issues with resources not appearing across regions:
|
|
82
62
|
|
|
83
63
|
```bash
|
|
84
64
|
export PROJECT_NAME="your-mastra-app"
|
|
@@ -86,12 +66,15 @@ CMD ["node", ".mastra/output/index.mjs"]
|
|
|
86
66
|
export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
|
|
87
67
|
```
|
|
88
68
|
|
|
89
|
-
2. Build your Docker image
|
|
69
|
+
2. Build your Docker image. Disable BuildKit to ensure the image is compatible with Lambda's container runtime:
|
|
90
70
|
|
|
91
71
|
```bash
|
|
92
|
-
|
|
72
|
+
export DOCKER_BUILDKIT=0
|
|
73
|
+
docker build --platform linux/arm64 -t "$PROJECT_NAME" .
|
|
93
74
|
```
|
|
94
75
|
|
|
76
|
+
> **Note:** BuildKit's default image format can cause compatibility issues with Lambda. Setting `DOCKER_BUILDKIT=0` uses the classic builder, which produces images in a format Lambda reliably accepts.
|
|
77
|
+
|
|
95
78
|
3. Create an Amazon ECR repository to store your Docker image:
|
|
96
79
|
|
|
97
80
|
```bash
|
|
@@ -101,148 +84,76 @@ CMD ["node", ".mastra/output/index.mjs"]
|
|
|
101
84
|
4. Log in to Amazon ECR:
|
|
102
85
|
|
|
103
86
|
```bash
|
|
104
|
-
aws ecr get-login-password --region "$AWS_REGION" |
|
|
87
|
+
aws ecr get-login-password --region "$AWS_REGION" | \
|
|
88
|
+
docker login --username AWS --password-stdin \
|
|
89
|
+
"$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com"
|
|
105
90
|
```
|
|
106
91
|
|
|
107
|
-
5. Tag your image
|
|
92
|
+
5. Tag your image and push it to ECR:
|
|
108
93
|
|
|
109
94
|
```bash
|
|
110
|
-
docker tag "$PROJECT_NAME":latest
|
|
111
|
-
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
6. Create a Lambda function using the AWS Console:
|
|
115
|
-
|
|
116
|
-
1. Navigate to the [AWS Lambda Console](https://console.aws.amazon.com/lambda/)
|
|
117
|
-
|
|
118
|
-
2. Click **Create function**
|
|
119
|
-
|
|
120
|
-
3. Select **Container image**
|
|
121
|
-
|
|
122
|
-
4. Configure the function:
|
|
123
|
-
|
|
124
|
-
- **Function name**: Your function name (e.g., `mastra-app`)
|
|
125
|
-
- **Container image URI**: Click **Browse images** and select your ECR repository, then choose the `latest` tag
|
|
126
|
-
- **Architecture**: Select the architecture that matches your Docker build (typically `x86_64`)
|
|
95
|
+
docker tag "$PROJECT_NAME":latest \
|
|
96
|
+
"$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$PROJECT_NAME":latest
|
|
127
97
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
2. Click **Create function URL**
|
|
133
|
-
|
|
134
|
-
3. Set **Auth type** to **NONE** (for public access)
|
|
135
|
-
|
|
136
|
-
4. Configure **CORS** settings:
|
|
137
|
-
|
|
138
|
-
- **Allow-Origin**: `*` (restrict to your domain in production)
|
|
139
|
-
- **Allow-Headers**: `content-type` (`x-amzn-request-context` is also required when used with services like Cloudfront/API Gateway)
|
|
140
|
-
- **Allow-Methods**: `*` (audit and restrict in production)
|
|
141
|
-
|
|
142
|
-
5. Click **Save**
|
|
143
|
-
|
|
144
|
-
8. Add your environment variables in the Lambda function configuration:
|
|
145
|
-
|
|
146
|
-
1. Go to **Configuration** > **Environment variables**
|
|
147
|
-
|
|
148
|
-
2. Add the required variables for your Mastra application:
|
|
149
|
-
|
|
150
|
-
- `OPENAI_API_KEY`: Your OpenAI API key (if using OpenAI)
|
|
151
|
-
- `ANTHROPIC_API_KEY`: Your Anthropic API key (if using Anthropic)
|
|
152
|
-
- `TURSO_AUTH_TOKEN`: Your Turso auth token (if using libSQL with Turso)
|
|
153
|
-
- Other provider-specific API keys as needed
|
|
154
|
-
|
|
155
|
-
9. Configure the function's memory and timeout settings:
|
|
156
|
-
|
|
157
|
-
1. Go to **Configuration** > **General configuration**
|
|
158
|
-
|
|
159
|
-
2. Set the following recommended values:
|
|
160
|
-
|
|
161
|
-
- **Memory**: 512 MB (adjust based on your application needs)
|
|
162
|
-
- **Timeout**: 30 seconds (adjust based on your application needs)
|
|
163
|
-
- **Ephemeral storage**: 512 MB (optional, for temporary files)
|
|
164
|
-
|
|
165
|
-
## Testing your deployment
|
|
166
|
-
|
|
167
|
-
Once deployed, test your Lambda function:
|
|
168
|
-
|
|
169
|
-
1. Copy the **Function URL** from the Lambda console
|
|
170
|
-
2. Visit the URL in your browser to see your Mastra's server home screen
|
|
171
|
-
3. Test your agents and workflows using the generated API endpoints
|
|
172
|
-
|
|
173
|
-
For more information about available API endpoints, see the [Server documentation](https://mastra.ai/docs/deployment/mastra-server).
|
|
174
|
-
|
|
175
|
-
## Connecting your client
|
|
176
|
-
|
|
177
|
-
Update your client application to use the Lambda function URL:
|
|
178
|
-
|
|
179
|
-
```typescript
|
|
180
|
-
import { MastraClient } from '@mastra/client-js'
|
|
98
|
+
docker push \
|
|
99
|
+
"$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$PROJECT_NAME":latest
|
|
100
|
+
```
|
|
181
101
|
|
|
182
|
-
|
|
183
|
-
baseUrl: 'https://your-function-url.lambda-url.us-east-1.on.aws',
|
|
184
|
-
})
|
|
185
|
-
```
|
|
102
|
+
## Create the Lambda function
|
|
186
103
|
|
|
187
|
-
|
|
104
|
+
1. Navigate to the [AWS Lambda Console](https://console.aws.amazon.com/lambda/) and click **Create function**. Make sure you have the same region selected as where you created your ECR repository.
|
|
188
105
|
|
|
189
|
-
|
|
106
|
+
2. Select **Container image** and configure the function:
|
|
190
107
|
|
|
191
|
-
|
|
108
|
+
- **Function name**: Enter a name (e.g. `mastra-app`)
|
|
109
|
+
- **Container image URI**: Click **Browse images**, select your ECR repository, and choose the `latest` tag
|
|
110
|
+
- **Architecture**: Select **arm64**
|
|
192
111
|
|
|
193
|
-
|
|
194
|
-
- Optimize your Mastra application for faster cold starts
|
|
195
|
-
- Consider using provisioned concurrency for consistent performance
|
|
112
|
+
Click **Create function** to create the Lambda function.
|
|
196
113
|
|
|
197
|
-
|
|
114
|
+
3. Configure memory and timeout. Go to **Configuration** > **General configuration** and click **Edit**:
|
|
198
115
|
|
|
199
|
-
|
|
116
|
+
- **Memory**: 512 MB (adjust based on your application needs)
|
|
117
|
+
- **Timeout**: 1 minute or higher (the default 3 seconds is too low for most Mastra applications)
|
|
200
118
|
|
|
201
|
-
|
|
202
|
-
- Monitor memory usage in CloudWatch Logs
|
|
203
|
-
- Optimize your application's memory usage
|
|
119
|
+
Click **Save**.
|
|
204
120
|
|
|
205
|
-
|
|
121
|
+
4. Add environment variables. Go to **Configuration** > **Environment variables** and click **Edit**. Add the variables your Mastra application needs:
|
|
206
122
|
|
|
207
|
-
|
|
123
|
+
- `OPENAI_API_KEY`: Your OpenAI API key (if using OpenAI)
|
|
124
|
+
- `ANTHROPIC_API_KEY`: Your Anthropic API key (if using Anthropic)
|
|
125
|
+
- Other provider-specific API keys as needed (e.g. `TURSO_DATABASE_URL` and `TURSO_AUTH_TOKEN` if using LibSQL with Turso)
|
|
208
126
|
|
|
209
|
-
|
|
210
|
-
- Check the Lambda Function URL CORS configuration
|
|
211
|
-
- Ensure your client is making requests to the correct URL
|
|
127
|
+
Click **Save**.
|
|
212
128
|
|
|
213
|
-
|
|
129
|
+
5. Enable a Function URL for external access. Go to **Configuration** > **Function URL** and click **Create function URL**:
|
|
214
130
|
|
|
215
|
-
|
|
131
|
+
- **Auth type**: Select **NONE** for public access
|
|
216
132
|
|
|
217
|
-
-
|
|
218
|
-
- Check that the `CMD` instruction in your Dockerfile is correct
|
|
219
|
-
- Review CloudWatch Logs for container startup errors
|
|
220
|
-
- Ensure the Lambda Web Adapter is properly installed in the container
|
|
133
|
+
- Under **Additional settings**, check **Configure cross-origin resource sharing (CORS)**, then configure:
|
|
221
134
|
|
|
222
|
-
|
|
135
|
+
- **Allow origin**: `*`
|
|
136
|
+
- **Allow headers**: `content-type` (`x-amzn-request-context` is also required when used with services like CloudFront/API Gateway)
|
|
137
|
+
- **Allow methods**: `*`
|
|
223
138
|
|
|
224
|
-
|
|
139
|
+
Click **Save**.
|
|
225
140
|
|
|
226
|
-
|
|
141
|
+
## Verify your deployment
|
|
227
142
|
|
|
228
|
-
-
|
|
229
|
-
- Use AWS IAM roles for secure access to other AWS services
|
|
230
|
-
- Store sensitive environment variables in AWS Secrets Manager or Parameter Store
|
|
143
|
+
1. Copy the **Function URL** from the Lambda console and visit `<your-function-url>/api/agents` in your browser. You should see a JSON list of your agents.
|
|
231
144
|
|
|
232
|
-
|
|
145
|
+
2. You can now call your Mastra endpoints over HTTP.
|
|
233
146
|
|
|
234
|
-
|
|
235
|
-
- Set up CloudWatch alarms for errors and performance metrics
|
|
236
|
-
- Use AWS X-Ray for distributed tracing
|
|
147
|
+
> **Warning:** For production deployments, set up [authentication](https://mastra.ai/docs/server/auth) before exposing your endpoints publicly, restrict CORS origins to your trusted domains, use AWS IAM roles for secure access to other AWS services, and store sensitive environment variables in AWS Secrets Manager or Parameter Store.
|
|
237
148
|
|
|
238
|
-
|
|
149
|
+
## Next steps
|
|
239
150
|
|
|
240
|
-
-
|
|
241
|
-
- Monitor concurrent executions and adjust limits as needed
|
|
242
|
-
- Consider using Application Load Balancer for more complex routing needs
|
|
151
|
+
This guide provides a quickstart for deploying Mastra to AWS Lambda. For production workloads, consider enabling [CloudWatch monitoring](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs.html) for your Lambda function, setting up [AWS X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) for distributed tracing, and configuring [provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html) for consistent performance.
|
|
243
152
|
|
|
244
|
-
##
|
|
153
|
+
## Related
|
|
245
154
|
|
|
246
|
-
- [
|
|
155
|
+
- [Deployment overview](https://mastra.ai/docs/deployment/overview)
|
|
156
|
+
- [Mastra server](https://mastra.ai/docs/server/mastra-server)
|
|
157
|
+
- [Server adapters](https://mastra.ai/docs/server/server-adapters)
|
|
247
158
|
- [AWS Lambda documentation](https://docs.aws.amazon.com/lambda/)
|
|
248
159
|
- [AWS Lambda Web Adapter](https://github.com/awslabs/aws-lambda-web-adapter)
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
# Azure App Services
|
|
1
|
+
# Deploy Mastra to Azure App Services
|
|
2
2
|
|
|
3
3
|
Deploy your Mastra applications to Azure App Services.
|
|
4
4
|
|
|
5
|
-
> **
|
|
5
|
+
> **Info:** This guide covers deploying the [Mastra server](https://mastra.ai/docs/server/mastra-server). If you're using a [server adapter](https://mastra.ai/docs/server/server-adapters) or [web framework](https://mastra.ai/docs/deployment/web-framework), deploy the way you normally would for that framework.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Before you begin
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
You'll need:
|
|
10
10
|
|
|
11
|
+
- A [Mastra application](https://mastra.ai/guides/getting-started/quickstart)
|
|
11
12
|
- An [Azure account](https://azure.microsoft.com/) with an active subscription
|
|
12
13
|
- A [GitHub repository](https://github.com/) containing your Mastra application
|
|
13
|
-
- Your Mastra application should be created using `npx create-mastra@latest`
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
> **Warning:** On Azure App Services, the filesystem is ephemeral for some pricing tiers, so any local database file will be lost between deployments. If you're using [LibSQLStore](https://mastra.ai/reference/storage/libsql) with a local file, configure it to use a remote LibSQL-compatible database (for example, [Turso](https://turso.tech/)) instead.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
## Create a new app service
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
- Navigate to **[App Services](https://docs.microsoft.com/en-us/azure/app-service/)** or search for it in the top search bar
|
|
21
|
-
- Click **Create** to create a new App Service
|
|
22
|
-
- In the drop-down, select **Web App**
|
|
19
|
+
In these steps you'll learn how to create a new Azure App Service for hosting your Mastra application. This will set up the necessary infrastructure and environment for your application to run.
|
|
23
20
|
|
|
24
|
-
|
|
21
|
+
1. Log in to the [Azure Portal](https://portal.azure.com) and navigate to **[App Services](https://docs.microsoft.com/en-us/azure/app-service/)** or search for it in the top search bar. Select **Create** to create a new App Service, and in the drop-down, select **Web App**.
|
|
22
|
+
|
|
23
|
+
2. Configure the app service settings:
|
|
25
24
|
|
|
26
25
|
- **Subscription**: Select your Azure subscription
|
|
27
26
|
- **Resource Group**: Create a new resource group or select an existing one
|
|
@@ -31,80 +30,58 @@ Deploy your Mastra applications to Azure App Services.
|
|
|
31
30
|
- **Operating System**: Select **Linux**
|
|
32
31
|
- **Region**: Choose a region close to your users
|
|
33
32
|
- **Linux Plan**: You may have the option of choosing a plan depending on the region you chose, pick an appropriate one for your needs.
|
|
34
|
-
-
|
|
35
|
-
- Wait for validation to complete, then click **Create**
|
|
33
|
+
- Select **Review + Create** and wait for validation to complete, then select **Create**.
|
|
36
34
|
|
|
37
|
-
3. Wait for deployment
|
|
35
|
+
3. A new deployment has been triggered. Wait for the deployment to complete, then select **Go to resource** under the next steps section.
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
- Once finished, click **Go to resource** under the next steps section
|
|
37
|
+
4. Before setting up GitHub deployment, configure your environment variables. Navigate to **Settings** > **Environment variables** in the left sidebar. Add your required environment variables, such as:
|
|
41
38
|
|
|
42
|
-
|
|
39
|
+
- Model provider API keys (e.g., `OPENAI_API_KEY`)
|
|
40
|
+
- Database connection strings
|
|
41
|
+
- Any other configuration values your Mastra application requires
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
Select **Apply** to save the changes.
|
|
45
44
|
|
|
46
|
-
|
|
45
|
+
## GitHub deployment
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
- Database connection strings
|
|
50
|
-
- Any other configuration values your Mastra application requires
|
|
47
|
+
In these steps, you'll connect your Azure App Service to your GitHub repository to enable continuous deployment. This means that every time you push changes to your repository, Azure will automatically build and deploy your application.
|
|
51
48
|
|
|
52
|
-
|
|
49
|
+
1. Navigate to **Deployment Center** in the left sidebar and select **GitHub** as your source. Sign in to GitHub if you're not already authenticated with Azure.
|
|
53
50
|
|
|
54
|
-
|
|
51
|
+
In this example, you'll keep [GitHub Actions](https://docs.github.com/en/actions) as your provider. Select your organization, repository, and branch.
|
|
55
52
|
|
|
56
|
-
|
|
57
|
-
- Select **GitHub** as your source
|
|
58
|
-
- Sign in to GitHub if you're not already authenticated with Azure
|
|
59
|
-
- In this example, we will keep [GitHub Actions](https://docs.github.com/en/actions) as our provider
|
|
60
|
-
- Select your organization, repository, and branch
|
|
61
|
-
- Azure will generate a GitHub workflow file and you can preview it before proceeding
|
|
62
|
-
- Click **Save** (the save button is located at the top of the page)
|
|
53
|
+
Azure will generate a GitHub workflow file and you can preview it before proceeding. Select **Save** (the save button is located at the top of the page).
|
|
63
54
|
|
|
64
|
-
|
|
55
|
+
2. After Azure creates the workflow, it will trigger a GitHub Actions run and merge the workflow file into your branch. **Cancel this initial run** as it will fail without the necessary modifications.
|
|
65
56
|
|
|
66
57
|
> **Warning:** The default workflow generated by Azure will fail for Mastra applications and needs to be modified.
|
|
67
58
|
|
|
68
59
|
Pull the latest changes to your local repository and modify the generated workflow file (`.github/workflows/main_<your-app-name>.yml`):
|
|
69
60
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
- Change the step name to "npm install and build"
|
|
73
|
-
- If you haven't set up proper tests in your Mastra application, remove the `npm test` command from the run section as the default test script will fail and disrupt deployment. If you have working tests, you can keep the test command.
|
|
74
|
-
|
|
75
|
-
2. **Update the zip artifact step**: Find the "Zip artifact for deployment" step and replace the zip command with:
|
|
76
|
-
|
|
77
|
-
```yaml
|
|
78
|
-
run: (cd .mastra/output && zip ../../release.zip -r .)
|
|
79
|
-
```
|
|
61
|
+
3. Find the step named "npm install, build, and test" and:
|
|
80
62
|
|
|
81
|
-
|
|
63
|
+
- Change the step name to "npm install and build"
|
|
64
|
+
- If you haven't set up proper tests in your Mastra application, remove the `npm test` command from the run section as the default test script will fail and disrupt deployment. If you have working tests, you can keep the test command.
|
|
82
65
|
|
|
83
|
-
|
|
66
|
+
4. Find the "Zip artifact for deployment" step and replace the zip command with:
|
|
84
67
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
68
|
+
```yaml
|
|
69
|
+
run: (cd .mastra/output && zip ../../release.zip -r .)
|
|
70
|
+
```
|
|
88
71
|
|
|
89
|
-
|
|
72
|
+
This ensures only the build outputs from `.mastra/output` are included in the deployment package.
|
|
90
73
|
|
|
91
|
-
|
|
92
|
-
- Access your deployed application using the default URL provided in the **Overview** tab in the Azure portal
|
|
93
|
-
- Your application will be available at `https://<your-app-name>.azurewebsites.net`
|
|
74
|
+
5. Commit and push your workflow modifications. The build will be automatically triggered in the **Deployment Center** in your Azure dashboard. Monitor the deployment progress until it completes successfully.
|
|
94
75
|
|
|
95
|
-
##
|
|
76
|
+
## Verify your deployment
|
|
96
77
|
|
|
97
|
-
|
|
78
|
+
Once the build is successful, wait a few moments for the application to start. You can access your deployed application using the default URL provided in the **Overview** tab in the Azure portal. Your application will be available at `https://<your-app-name>.azurewebsites.net`.
|
|
98
79
|
|
|
99
|
-
|
|
80
|
+
Copy the URL from the Azure portal and visit `https://<your-app-name>.azurewebsites.net/api/agents` in your browser. You should see a JSON list of your agents.
|
|
100
81
|
|
|
101
|
-
|
|
102
|
-
import { MastraClient } from '@mastra/client-js'
|
|
82
|
+
You can now call your Mastra endpoints over HTTP.
|
|
103
83
|
|
|
104
|
-
|
|
105
|
-
baseUrl: 'https://<your-app-name>.azurewebsites.net',
|
|
106
|
-
})
|
|
107
|
-
```
|
|
84
|
+
> **Warning:** Set up [authentication](https://mastra.ai/docs/server/auth) before exposing your endpoints publicly.
|
|
108
85
|
|
|
109
86
|
## Next steps
|
|
110
87
|
|
|
@@ -8,7 +8,7 @@ Use `@mastra/deployer-cloudflare` to deploy your Mastra server to Cloudflare Wor
|
|
|
8
8
|
|
|
9
9
|
You'll need a [Mastra application](https://mastra.ai/guides/getting-started/quickstart) and a [Cloudflare](https://cloudflare.com/) account.
|
|
10
10
|
|
|
11
|
-
Cloudflare Workers use an ephemeral filesystem, so any storage you configure (including observability storage) must be hosted externally. If you're using [LibSQLStore](https://mastra.ai/reference/storage/libsql) with a file URL, switch to a remotely hosted database.
|
|
11
|
+
> **Warning:** Cloudflare Workers use an ephemeral filesystem, so any storage you configure (including observability storage) must be hosted externally. If you're using [LibSQLStore](https://mastra.ai/reference/storage/libsql) with a file URL, switch to a remotely hosted database.
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@ Use `@mastra/deployer-netlify` to deploy your Mastra server as serverless functi
|
|
|
8
8
|
|
|
9
9
|
You'll need a [Mastra application](https://mastra.ai/guides/getting-started/quickstart) and a [Netlify](https://www.netlify.com/) account.
|
|
10
10
|
|
|
11
|
-
Netlify Functions use an ephemeral filesystem, so any storage you configure (including observability storage) must be hosted externally. If you're using [LibSQLStore](https://mastra.ai/reference/storage/libsql) with a file URL, switch to a remotely hosted database.
|
|
11
|
+
> **Warning:** Netlify Functions use an ephemeral filesystem, so any storage you configure (including observability storage) must be hosted externally. If you're using [LibSQLStore](https://mastra.ai/reference/storage/libsql) with a file URL, switch to a remotely hosted database.
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@ Use `@mastra/deployer-vercel` to deploy your Mastra server as serverless functio
|
|
|
8
8
|
|
|
9
9
|
You'll need a [Mastra application](https://mastra.ai/guides/getting-started/quickstart) and a [Vercel](https://vercel.com/) account.
|
|
10
10
|
|
|
11
|
-
Vercel Functions use an ephemeral filesystem, so any storage you configure (including observability storage) must be hosted externally. If you're using [LibSQLStore](https://mastra.ai/reference/storage/libsql) with a file URL, switch to a remotely hosted database.
|
|
11
|
+
> **Warning:** Vercel Functions use an ephemeral filesystem, so any storage you configure (including observability storage) must be hosted externally. If you're using [LibSQLStore](https://mastra.ai/reference/storage/libsql) with a file URL, switch to a remotely hosted database.
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Netlify
|
|
2
2
|
|
|
3
|
-
Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access
|
|
3
|
+
Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 60 models through Mastra's model router.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Netlify documentation](https://docs.netlify.com/build/ai-gateway/overview/).
|
|
6
6
|
|
|
@@ -88,6 +88,10 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
88
88
|
| `openai/gpt-5.2-pro-2025-12-11` |
|
|
89
89
|
| `openai/gpt-5.3-chat-latest` |
|
|
90
90
|
| `openai/gpt-5.3-codex` |
|
|
91
|
+
| `openai/gpt-5.4` |
|
|
92
|
+
| `openai/gpt-5.4-2026-03-05` |
|
|
93
|
+
| `openai/gpt-5.4-pro` |
|
|
94
|
+
| `openai/gpt-5.4-pro-2026-03-05` |
|
|
91
95
|
| `openai/o3` |
|
|
92
96
|
| `openai/o3-mini` |
|
|
93
97
|
| `openai/o4-mini` |
|
package/.docs/models/index.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Model Providers
|
|
2
2
|
|
|
3
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
3
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 2613 models from 88 providers through a single API.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -105,23 +105,23 @@ const response = await agent.generate("Hello!", {
|
|
|
105
105
|
|
|
106
106
|
### Available Options
|
|
107
107
|
|
|
108
|
-
**sendReasoning
|
|
108
|
+
**sendReasoning** (`boolean | undefined`)
|
|
109
109
|
|
|
110
|
-
**structuredOutputMode
|
|
110
|
+
**structuredOutputMode** (`"outputFormat" | "jsonTool" | "auto" | undefined`)
|
|
111
111
|
|
|
112
|
-
**thinking
|
|
112
|
+
**thinking** (`{ type: "adaptive"; } | { type: "enabled"; budgetTokens?: number | undefined; } | { type: "disabled"; } | undefined`)
|
|
113
113
|
|
|
114
|
-
**disableParallelToolUse
|
|
114
|
+
**disableParallelToolUse** (`boolean | undefined`)
|
|
115
115
|
|
|
116
|
-
**cacheControl
|
|
116
|
+
**cacheControl** (`{ type: "ephemeral"; ttl?: "5m" | "1h" | undefined; } | undefined`)
|
|
117
117
|
|
|
118
|
-
**container
|
|
118
|
+
**container** (`{ id?: string | undefined; skills?: { type: "anthropic" | "custom"; skillId: string; version?: string | undefined; }[] | undefined; } | undefined`)
|
|
119
119
|
|
|
120
|
-
**effort
|
|
120
|
+
**effort** (`"low" | "medium" | "high" | "max" | undefined`)
|
|
121
121
|
|
|
122
|
-
**speed
|
|
122
|
+
**speed** (`"fast" | undefined`)
|
|
123
123
|
|
|
124
|
-
**contextManagement
|
|
124
|
+
**contextManagement** (`{ edits: ({ type: "clear_01"; trigger?: { type: "input_tokens"; value: number; } | undefined; keep?: "all" | { type: "thinking_turns"; value: number; } | undefined; } | { type: "compact_20260112"; trigger?: { ...; } | undefined; pauseAfterCompaction?: boolean | undefined; instructions?: string | undefined; })[]; } |...`)
|
|
125
125
|
|
|
126
126
|
## Direct Provider Installation
|
|
127
127
|
|
|
@@ -110,27 +110,27 @@ const response = await agent.generate("Hello!", {
|
|
|
110
110
|
|
|
111
111
|
### Available Options
|
|
112
112
|
|
|
113
|
-
**responseModalities
|
|
113
|
+
**responseModalities** (`("TEXT" | "IMAGE")[] | undefined`)
|
|
114
114
|
|
|
115
|
-
**thinkingConfig
|
|
115
|
+
**thinkingConfig** (`{ thinkingBudget?: number | undefined; includeThoughts?: boolean | undefined; thinkingLevel?: "minimal" | "low" | "medium" | "high" | undefined; } | undefined`)
|
|
116
116
|
|
|
117
|
-
**cachedContent
|
|
117
|
+
**cachedContent** (`string | undefined`)
|
|
118
118
|
|
|
119
|
-
**structuredOutputs
|
|
119
|
+
**structuredOutputs** (`boolean | undefined`)
|
|
120
120
|
|
|
121
|
-
**safetySettings
|
|
121
|
+
**safetySettings** (`{ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY"; threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | ... 4 more ... | "OFF"; }[] | undefined`)
|
|
122
122
|
|
|
123
|
-
**threshold
|
|
123
|
+
**threshold** (`"HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF" | undefined`)
|
|
124
124
|
|
|
125
|
-
**audioTimestamp
|
|
125
|
+
**audioTimestamp** (`boolean | undefined`)
|
|
126
126
|
|
|
127
|
-
**labels
|
|
127
|
+
**labels** (`Record<string, string> | undefined`)
|
|
128
128
|
|
|
129
|
-
**mediaResolution
|
|
129
|
+
**mediaResolution** (`"MEDIA_RESOLUTION_UNSPECIFIED" | "MEDIA_RESOLUTION_LOW" | "MEDIA_RESOLUTION_MEDIUM" | "MEDIA_RESOLUTION_HIGH" | undefined`)
|
|
130
130
|
|
|
131
|
-
**imageConfig
|
|
131
|
+
**imageConfig** (`{ aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | undefined; imageSize?: "1K" | "2K" | "4K" | undefined; } | undefined`)
|
|
132
132
|
|
|
133
|
-
**retrievalConfig
|
|
133
|
+
**retrievalConfig** (`{ latLng?: { latitude: number; longitude: number; } | undefined; } | undefined`)
|
|
134
134
|
|
|
135
135
|
## Direct Provider Installation
|
|
136
136
|
|