@mastra/mcp-docs-server 1.2.11-alpha.1 → 1.2.11-alpha.4
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/agent-controller/channels.md +109 -0
- package/.docs/docs/capabilities/channels/overview.md +1 -0
- package/.docs/docs/deployment/cloud-providers.md +1 -0
- package/.docs/docs/deployment/overview.md +1 -0
- package/.docs/docs/mastra-platform/overview.md +4 -2
- package/.docs/docs/mastra-platform/trace-intelligence.md +123 -0
- package/.docs/docs/rag/vector-databases.md +17 -0
- package/.docs/docs/voice/overview.md +5 -0
- package/.docs/docs/voice/{livekit.md → realtime-voice.md} +5 -3
- package/.docs/docs/workspace/filesystem.md +1 -0
- package/.docs/docs/workspace/sandbox.md +5 -0
- package/.docs/guides/deployment/kubernetes.md +298 -0
- package/.docs/guides/deployment/netlify.md +1 -1
- package/.docs/models/environment-variables.md +1 -0
- package/.docs/models/gateways/openrouter.md +2 -2
- package/.docs/models/gateways/vercel.md +8 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/abliteration-ai.md +6 -5
- package/.docs/models/providers/aiand.md +2 -1
- package/.docs/models/providers/ambient.md +2 -2
- package/.docs/models/providers/anthropic.md +1 -1
- package/.docs/models/providers/anyapi.md +1 -1
- package/.docs/models/providers/baseten.md +5 -4
- package/.docs/models/providers/crof.md +2 -1
- package/.docs/models/providers/deepinfra.md +5 -4
- package/.docs/models/providers/digitalocean.md +1 -1
- package/.docs/models/providers/fireworks-ai.md +4 -2
- package/.docs/models/providers/google.md +1 -1
- package/.docs/models/providers/huggingface.md +2 -1
- package/.docs/models/providers/hyper.md +92 -0
- package/.docs/models/providers/llmgateway.md +7 -5
- package/.docs/models/providers/mistral.md +1 -1
- package/.docs/models/providers/nebius.md +2 -1
- package/.docs/models/providers/nvidia.md +23 -9
- package/.docs/models/providers/ollama-cloud.md +2 -1
- package/.docs/models/providers/openai.md +1 -1
- package/.docs/models/providers/opencode-go.md +1 -1
- package/.docs/models/providers/opencode.md +3 -2
- package/.docs/models/providers/poe.md +1 -1
- package/.docs/models/providers/scaleway.md +1 -1
- package/.docs/models/providers/synthetic.md +2 -1
- package/.docs/models/providers/togetherai.md +2 -1
- package/.docs/models/providers/wandb.md +1 -1
- package/.docs/models/providers/xiaomi-token-plan-ams.md +4 -4
- package/.docs/models/providers/xiaomi-token-plan-cn.md +4 -4
- package/.docs/models/providers/xiaomi-token-plan-sgp.md +4 -4
- package/.docs/models/providers/xiaomi.md +4 -4
- package/.docs/models/providers.md +1 -0
- package/.docs/reference/agents/channels.md +10 -0
- package/.docs/reference/evals/mastra-scorer.md +56 -0
- package/.docs/reference/storage/duckdb.md +4 -0
- package/.docs/reference/vectors/mongodb.md +185 -4
- package/.docs/reference/voice/livekit.md +3 -3
- package/CHANGELOG.md +14 -0
- package/dist/index.js +2 -3
- package/dist/src-BZcgzbk9.js +1774 -0
- package/dist/src-BZcgzbk9.js.map +1 -0
- package/dist/stdio.js +28 -30
- package/dist/stdio.js.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-GLPCVXXO.js +0 -2075
- package/dist/chunk-GLPCVXXO.js.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Deploy Mastra to Kubernetes
|
|
4
|
+
|
|
5
|
+
Run a Mastra application across multiple pods on [Kubernetes](https://kubernetes.io/), so it scales horizontally behind a load balancer. Because each pod is a separate process, the pods must share a pub/sub backend and a database, otherwise work started on one pod is invisible to the others.
|
|
6
|
+
|
|
7
|
+
> **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.
|
|
8
|
+
|
|
9
|
+
> **Warning:** Multi-pod support relies on [durable agents](https://mastra.ai/docs/long-running-agents/durable-agents), which are currently in **beta**. APIs may change in minor versions. Read [Known limitations](#known-limitations) before you rely on this in production.
|
|
10
|
+
|
|
11
|
+
## Before you begin
|
|
12
|
+
|
|
13
|
+
You'll need:
|
|
14
|
+
|
|
15
|
+
- A [Mastra application](https://mastra.ai/guides/getting-started/quickstart)
|
|
16
|
+
- A [Kubernetes](https://kubernetes.io/docs/setup/) cluster and [`kubectl`](https://kubernetes.io/docs/tasks/tools/)
|
|
17
|
+
- A container registry your cluster can pull from
|
|
18
|
+
- A shared [Redis](https://redis.io/) instance, reachable from every pod
|
|
19
|
+
- A shared [PostgreSQL](https://www.postgresql.org/) database, reachable from every pod
|
|
20
|
+
|
|
21
|
+
## Why multiple pods need shared infrastructure
|
|
22
|
+
|
|
23
|
+
A single pod keeps run state in its own memory. With one pod that's fine, because every request reaches the same process. Across pods it breaks: a browser might stream from pod A while the user's next request is routed to pod B, and pod B has no record of the run on pod A.
|
|
24
|
+
|
|
25
|
+
Redis and Postgres close that gap:
|
|
26
|
+
|
|
27
|
+
- **Pub/sub** carries events between pods. When an event is published on one pod, the others receive it. Mastra uses [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams), which also provides the per-thread leasing that keeps a single pod as the owner of a conversation at a time. See [PubSub](https://mastra.ai/docs/server/pubsub).
|
|
28
|
+
- **Storage** persists run state. [Durable agents](https://mastra.ai/docs/long-running-agents/durable-agents) save each run as a workflow snapshot, so any pod can resume a run from the database after a restart or when a request is routed elsewhere.
|
|
29
|
+
|
|
30
|
+
## Configure shared infrastructure
|
|
31
|
+
|
|
32
|
+
Point the `Mastra` instance at Redis and Postgres. Read the connection details from environment variables so the same image runs in every pod.
|
|
33
|
+
|
|
34
|
+
Install the backends:
|
|
35
|
+
|
|
36
|
+
**npm**:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install @mastra/redis-streams @mastra/pg @mastra/redis ioredis
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**pnpm**:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pnpm add @mastra/redis-streams @mastra/pg @mastra/redis ioredis
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Yarn**:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
yarn add @mastra/redis-streams @mastra/pg @mastra/redis ioredis
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Bun**:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
bun add @mastra/redis-streams @mastra/pg @mastra/redis ioredis
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Configure pub/sub, storage, and a shared cache on the `Mastra` instance:
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import { Mastra } from '@mastra/core'
|
|
64
|
+
import { RedisStreamsPubSub } from '@mastra/redis-streams'
|
|
65
|
+
import { RedisServerCache } from '@mastra/redis'
|
|
66
|
+
import { PostgresStore } from '@mastra/pg'
|
|
67
|
+
import Redis from 'ioredis'
|
|
68
|
+
|
|
69
|
+
export const mastra = new Mastra({
|
|
70
|
+
// Carries events between pods, and provides
|
|
71
|
+
// per-thread leases so one pod owns a conversation at a time.
|
|
72
|
+
pubsub: new RedisStreamsPubSub({
|
|
73
|
+
url: process.env.REDIS_URL!,
|
|
74
|
+
}),
|
|
75
|
+
// Persists run state so any pod can resume a run.
|
|
76
|
+
storage: new PostgresStore({
|
|
77
|
+
id: 'mastra-storage',
|
|
78
|
+
connectionString: process.env.DATABASE_URL!,
|
|
79
|
+
}),
|
|
80
|
+
// Shared event cache so a reconnecting client can replay missed chunks
|
|
81
|
+
// from any pod, not only the one that started the run.
|
|
82
|
+
cache: new RedisServerCache({ client: new Redis(process.env.REDIS_URL!) }),
|
|
83
|
+
})
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The `cache` is what makes resumable streams work across pods. A reconnecting client replays missed events from this cache, so it must be shared. The default in-memory cache only serves replays within one process.
|
|
87
|
+
|
|
88
|
+
## Use durable agents
|
|
89
|
+
|
|
90
|
+
A plain [`Agent`](https://mastra.ai/docs/agents/overview) keeps its stream and approval state in one pod's memory, so those don't survive a request landing on another pod. A [durable agent](https://mastra.ai/docs/long-running-agents/durable-agents) runs the agentic loop inside a workflow and persists its state, so any pod can observe or resume the same run.
|
|
91
|
+
|
|
92
|
+
Wrap the agent with `createDurableAgent()`:
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
import { Agent } from '@mastra/core/agent'
|
|
96
|
+
import { createDurableAgent } from '@mastra/core/agent/durable'
|
|
97
|
+
|
|
98
|
+
const agent = new Agent({
|
|
99
|
+
id: 'assistant',
|
|
100
|
+
name: 'Assistant',
|
|
101
|
+
instructions: 'You are a helpful assistant.',
|
|
102
|
+
model: 'openai/gpt-5.5',
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
export const durableAssistant = createDurableAgent({ agent })
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Register the durable agent with the `Mastra` instance above. Its run state now lives in Postgres and its events flow through Redis, so the run is reachable from every pod.
|
|
109
|
+
|
|
110
|
+
## Deploy
|
|
111
|
+
|
|
112
|
+
1. Build and containerize the Mastra server, then push the image to your registry. Follow the [Mastra server](https://mastra.ai/docs/server/mastra-server) guide for the build, and ensure the server reads `process.env.PORT` and listens on `0.0.0.0`.
|
|
113
|
+
|
|
114
|
+
2. Store the shared connection strings as a Secret:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
kubectl create secret generic mastra-secrets \
|
|
118
|
+
--from-literal=REDIS_URL='redis://redis:6379' \
|
|
119
|
+
--from-literal=DATABASE_URL='postgresql://user:pass@postgres:5432/mastra'
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
3. Apply a Deployment that runs the image, reading the shared Secret. Start with one replica so the first pod creates the database schema on its own, then scale up in the next step:
|
|
123
|
+
|
|
124
|
+
```yaml
|
|
125
|
+
apiVersion: apps/v1
|
|
126
|
+
kind: Deployment
|
|
127
|
+
metadata:
|
|
128
|
+
name: mastra
|
|
129
|
+
spec:
|
|
130
|
+
replicas: 1
|
|
131
|
+
selector:
|
|
132
|
+
matchLabels:
|
|
133
|
+
app: mastra
|
|
134
|
+
template:
|
|
135
|
+
metadata:
|
|
136
|
+
labels:
|
|
137
|
+
app: mastra
|
|
138
|
+
spec:
|
|
139
|
+
containers:
|
|
140
|
+
- name: mastra
|
|
141
|
+
image: your-registry/mastra:latest
|
|
142
|
+
ports:
|
|
143
|
+
- containerPort: 8080
|
|
144
|
+
env:
|
|
145
|
+
- name: PORT
|
|
146
|
+
value: '8080'
|
|
147
|
+
envFrom:
|
|
148
|
+
- secretRef:
|
|
149
|
+
name: mastra-secrets
|
|
150
|
+
readinessProbe:
|
|
151
|
+
tcpSocket:
|
|
152
|
+
port: 8080
|
|
153
|
+
livenessProbe:
|
|
154
|
+
tcpSocket:
|
|
155
|
+
port: 8080
|
|
156
|
+
resources:
|
|
157
|
+
requests:
|
|
158
|
+
cpu: 500m
|
|
159
|
+
memory: 512Mi
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The `resources.requests.cpu` value is required for the HorizontalPodAutoscaler below. Kubernetes calculates CPU utilization as usage divided by the requested amount, so without a CPU request the autoscaler can't compute a target and won't scale.
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
kubectl apply -f deployment.yaml
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Once the first pod is ready, scale up:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
kubectl wait --for=condition=available deployment/mastra
|
|
172
|
+
kubectl scale deployment/mastra --replicas=3
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
> **Note:** Every replica runs the same image and connects to the same Redis and Postgres. That shared infrastructure, not the pod count, is what lets runs cross pods.
|
|
176
|
+
|
|
177
|
+
4. Expose the Deployment with a Service:
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
apiVersion: v1
|
|
181
|
+
kind: Service
|
|
182
|
+
metadata:
|
|
183
|
+
name: mastra
|
|
184
|
+
spec:
|
|
185
|
+
selector:
|
|
186
|
+
app: mastra
|
|
187
|
+
ports:
|
|
188
|
+
- port: 80
|
|
189
|
+
targetPort: 8080
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
kubectl apply -f service.yaml
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
5. Scale the replicas automatically with a HorizontalPodAutoscaler:
|
|
197
|
+
|
|
198
|
+
```yaml
|
|
199
|
+
apiVersion: autoscaling/v2
|
|
200
|
+
kind: HorizontalPodAutoscaler
|
|
201
|
+
metadata:
|
|
202
|
+
name: mastra
|
|
203
|
+
spec:
|
|
204
|
+
scaleTargetRef:
|
|
205
|
+
apiVersion: apps/v1
|
|
206
|
+
kind: Deployment
|
|
207
|
+
name: mastra
|
|
208
|
+
minReplicas: 3
|
|
209
|
+
maxReplicas: 10
|
|
210
|
+
metrics:
|
|
211
|
+
- type: Resource
|
|
212
|
+
resource:
|
|
213
|
+
name: cpu
|
|
214
|
+
target:
|
|
215
|
+
type: Utilization
|
|
216
|
+
averageUtilization: 70
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
kubectl apply -f hpa.yaml
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
> **Note:** CPU-based autoscaling needs the [metrics-server](https://github.com/kubernetes-sigs/metrics-server) running in the cluster. Managed clusters like GKE, EKS, and AKS include it. Local clusters like kind and minikube don't, so enable it there first (for example, `minikube addons enable metrics-server`).
|
|
224
|
+
|
|
225
|
+
6. Verify the pods are running:
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
kubectl get pods -l app=mastra
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Forward the service in one terminal. This command stays in the foreground:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
kubectl port-forward service/mastra 8080:80
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
In a second terminal, call the API:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
curl http://localhost:8080/api/agents
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
A JSON list of your agents means the deployment is serving.
|
|
244
|
+
|
|
245
|
+
> **Warning:** Set up [authentication](https://mastra.ai/docs/server/auth) before exposing your endpoints publicly.
|
|
246
|
+
|
|
247
|
+
## Streaming and reconnection
|
|
248
|
+
|
|
249
|
+
A durable agent publishes stream chunks to a per-run topic through the shared pub/sub. A client that disconnects reconnects by calling `observe()` with the run's ID, and replays the chunks it missed from the shared cache:
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
const { output, cleanup } = await durableAssistant.observe(runId)
|
|
253
|
+
|
|
254
|
+
for await (const chunk of output.fullStream) {
|
|
255
|
+
// Chunks from the run, including any missed while disconnected
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
cleanup()
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Because the run state is in Postgres and the events are in Redis, the reconnecting request can be served by any pod, not only the one that started the run. See [Resumable streams](https://mastra.ai/docs/long-running-agents/durable-agents).
|
|
262
|
+
|
|
263
|
+
Multiple clients can observe the same run at once. Each `observe()` call receives the full stream, so a user watching from two devices, or two people following the same run, stay in sync.
|
|
264
|
+
|
|
265
|
+
## Tool approval across pods
|
|
266
|
+
|
|
267
|
+
A durable agent pauses on a tool call until a human approves it. Because the suspended run is saved to Postgres, the approval can arrive on any pod, not only the one that started the run.
|
|
268
|
+
|
|
269
|
+
Start a run that requires approval:
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
const { runId } = await durableAssistant.stream('Delete the archived records', {
|
|
273
|
+
requireToolApproval: true,
|
|
274
|
+
memory: { thread: 'thread-1', resource: 'user-1' },
|
|
275
|
+
})
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
The run suspends before the tool runs. Approve it later, from any pod:
|
|
279
|
+
|
|
280
|
+
```typescript
|
|
281
|
+
await durableAssistant.resume(runId, { approved: true })
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
The pod that handles the approval loads the suspended run from Postgres. It then runs the approved tool and publishes the result over the shared pub/sub, so a client observing the run receives the continuation. See [Tool approval](https://mastra.ai/docs/long-running-agents/durable-agents).
|
|
285
|
+
|
|
286
|
+
## Known limitations
|
|
287
|
+
|
|
288
|
+
- The default in-process setup keeps run state in one pod's memory and doesn't share it across pods. Use [durable agents](https://mastra.ai/docs/long-running-agents/durable-agents) with shared Redis and Postgres so streaming, approvals, and reconnection work across pods.
|
|
289
|
+
- Cross-pod streaming, approvals, and reconnection require the durable-agent path. A plain agent keeps run state in memory and doesn't resume on another pod.
|
|
290
|
+
- When multiple pods start at once against an uninitialized database, they can race to create the schema and a pod may fail to start. Start with one replica so the schema is created once, then scale up.
|
|
291
|
+
- For a stricter setup, initialize the schema outside the app (for example, a one-off Kubernetes Job) and set `disableInit: true` on the `PostgresStore` in every pod.
|
|
292
|
+
|
|
293
|
+
## Related
|
|
294
|
+
|
|
295
|
+
- [PubSub](https://mastra.ai/docs/server/pubsub)
|
|
296
|
+
- [Durable agents](https://mastra.ai/docs/long-running-agents/durable-agents)
|
|
297
|
+
- [Mastra server](https://mastra.ai/docs/server/mastra-server)
|
|
298
|
+
- [Deployment overview](https://mastra.ai/docs/deployment/overview)
|
|
@@ -28,6 +28,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
28
28
|
| [Berget.AI](https://mastra.ai/models/providers/berget) | `berget/*` | `BERGET_API_KEY` |
|
|
29
29
|
| [Blue Claw](https://mastra.ai/models/providers/blueclaw) | `blueclaw/*` | `BLUECLAW_API_KEY` |
|
|
30
30
|
| [Cerebras](https://mastra.ai/models/providers/cerebras) | `cerebras/*` | `CEREBRAS_API_KEY` |
|
|
31
|
+
| [Charm Hyper](https://mastra.ai/models/providers/hyper) | `hyper/*` | `HYPER_API_KEY` |
|
|
31
32
|
| [Chutes](https://mastra.ai/models/providers/chutes) | `chutes/*` | `CHUTES_API_KEY` |
|
|
32
33
|
| [Clarifai](https://mastra.ai/models/providers/clarifai) | `clarifai/*` | `CLARIFAI_PAT` |
|
|
33
34
|
| [Claudinio](https://mastra.ai/models/providers/claudinio) | `claudinio/*` | `CLAUDINIO_API_KEY` |
|
|
@@ -164,6 +164,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
164
164
|
| `minimax/minimax-m2.7` |
|
|
165
165
|
| `minimax/minimax-m3` |
|
|
166
166
|
| `mistralai/codestral-2508` |
|
|
167
|
+
| `mistralai/devstral-2512` |
|
|
167
168
|
| `mistralai/ministral-14b-2512` |
|
|
168
169
|
| `mistralai/ministral-3b-2512` |
|
|
169
170
|
| `mistralai/ministral-8b-2512` |
|
|
@@ -222,9 +223,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
222
223
|
| `openai/gpt-4o-2024-11-20` |
|
|
223
224
|
| `openai/gpt-4o-mini` |
|
|
224
225
|
| `openai/gpt-4o-mini-2024-07-18` |
|
|
225
|
-
| `openai/gpt-4o-search-preview` |
|
|
226
226
|
| `openai/gpt-5` |
|
|
227
|
-
| `openai/gpt-5-chat` |
|
|
228
227
|
| `openai/gpt-5-codex` |
|
|
229
228
|
| `openai/gpt-5-image` |
|
|
230
229
|
| `openai/gpt-5-image-mini` |
|
|
@@ -334,6 +333,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
334
333
|
| `qwen/qwen3.6-flash` |
|
|
335
334
|
| `qwen/qwen3.6-max-preview` |
|
|
336
335
|
| `qwen/qwen3.6-plus` |
|
|
336
|
+
| `qwen/qwen3.7-flash` |
|
|
337
337
|
| `qwen/qwen3.7-max` |
|
|
338
338
|
| `qwen/qwen3.7-plus` |
|
|
339
339
|
| `rekaai/reka-edge` |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Vercel
|
|
4
4
|
|
|
5
|
-
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
5
|
+
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 307 models through Mastra's model router.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Vercel documentation](https://ai-sdk.dev/providers/ai-sdk-providers).
|
|
8
8
|
|
|
@@ -80,6 +80,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
80
80
|
| `anthropic/claude-fable-5` |
|
|
81
81
|
| `anthropic/claude-haiku-4.5` |
|
|
82
82
|
| `anthropic/claude-opus-4` |
|
|
83
|
+
| `anthropic/claude-opus-4.1` |
|
|
83
84
|
| `anthropic/claude-opus-4.5` |
|
|
84
85
|
| `anthropic/claude-opus-4.6` |
|
|
85
86
|
| `anthropic/claude-opus-4.7` |
|
|
@@ -209,6 +210,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
209
210
|
| `moonshotai/kimi-k2.7-code` |
|
|
210
211
|
| `moonshotai/kimi-k2.7-code-highspeed` |
|
|
211
212
|
| `moonshotai/kimi-k3` |
|
|
213
|
+
| `moonshotai/kimi-k3-fast` |
|
|
212
214
|
| `morph/morph-v3-fast` |
|
|
213
215
|
| `morph/morph-v3-large` |
|
|
214
216
|
| `nvidia/nemotron-3-nano-30b-a3b` |
|
|
@@ -217,8 +219,10 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
217
219
|
| `nvidia/nemotron-nano-12b-v2-vl` |
|
|
218
220
|
| `nvidia/nemotron-nano-9b-v2` |
|
|
219
221
|
| `openai/gpt-3.5-turbo` |
|
|
222
|
+
| `openai/gpt-4-turbo` |
|
|
220
223
|
| `openai/gpt-4.1` |
|
|
221
224
|
| `openai/gpt-4.1-mini` |
|
|
225
|
+
| `openai/gpt-4.1-nano` |
|
|
222
226
|
| `openai/gpt-4o` |
|
|
223
227
|
| `openai/gpt-4o-mini` |
|
|
224
228
|
| `openai/gpt-4o-mini-search-preview` |
|
|
@@ -260,9 +264,12 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
260
264
|
| `openai/gpt-realtime-2.1` |
|
|
261
265
|
| `openai/gpt-realtime-mini` |
|
|
262
266
|
| `openai/gpt-realtime-whisper` |
|
|
267
|
+
| `openai/o1` |
|
|
263
268
|
| `openai/o3` |
|
|
264
269
|
| `openai/o3-deep-research` |
|
|
270
|
+
| `openai/o3-mini` |
|
|
265
271
|
| `openai/o3-pro` |
|
|
272
|
+
| `openai/o4-mini` |
|
|
266
273
|
| `openai/text-embedding-3-large` |
|
|
267
274
|
| `openai/text-embedding-3-small` |
|
|
268
275
|
| `openai/text-embedding-ada-002` |
|
package/.docs/models/index.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Model Providers
|
|
4
4
|
|
|
5
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
5
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 5107 models from 162 providers through a single API.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# abliteration.ai
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 2 abliteration.ai models through Mastra's model router. Authentication is handled automatically using the `ABLIT_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [abliteration.ai documentation](https://docs.abliteration.ai/models).
|
|
8
8
|
|
|
@@ -34,9 +34,10 @@ for await (const chunk of stream) {
|
|
|
34
34
|
|
|
35
35
|
## Models
|
|
36
36
|
|
|
37
|
-
| Model
|
|
38
|
-
|
|
|
39
|
-
| `abliteration-ai/abliterated-model`
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| ----------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `abliteration-ai/abliterated-model` | 150K | | | | | | $3 | $3 |
|
|
40
|
+
| `abliteration-ai/abliterated-model-large` | 1.0M | | | | | | $5 | $5 |
|
|
40
41
|
|
|
41
42
|
## Advanced configuration
|
|
42
43
|
|
|
@@ -66,7 +67,7 @@ const agent = new Agent({
|
|
|
66
67
|
model: ({ requestContext }) => {
|
|
67
68
|
const useAdvanced = requestContext.task === "complex";
|
|
68
69
|
return useAdvanced
|
|
69
|
-
? "abliteration-ai/abliterated-model"
|
|
70
|
+
? "abliteration-ai/abliterated-model-large"
|
|
70
71
|
: "abliteration-ai/abliterated-model";
|
|
71
72
|
}
|
|
72
73
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# ai&
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 10 ai& models through Mastra's model router. Authentication is handled automatically using the `AIAND_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [ai& documentation](https://docs.aiand.com/).
|
|
8
8
|
|
|
@@ -41,6 +41,7 @@ for await (const chunk of stream) {
|
|
|
41
41
|
| `aiand/google/gemma-4-31b-it` | 262K | | | | | | $0.20 | $0.50 |
|
|
42
42
|
| `aiand/moonshotai/kimi-k2.6` | 262K | | | | | | $0.85 | $4 |
|
|
43
43
|
| `aiand/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.75 | $4 |
|
|
44
|
+
| `aiand/moonshotai/kimi-k3` | 1.0M | | | | | | $3 | $13 |
|
|
44
45
|
| `aiand/openai/gpt-oss-120b` | 131K | | | | | | $0.15 | $0.60 |
|
|
45
46
|
| `aiand/qwen/qwen3.6-27b` | 262K | | | | | | — | — |
|
|
46
47
|
| `aiand/zai-org/glm-5.1` | 200K | | | | | | $1 | $4 |
|
|
@@ -36,13 +36,13 @@ for await (const chunk of stream) {
|
|
|
36
36
|
|
|
37
37
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
38
|
| ------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
-
| `ambient/ambient/large` | 101K | | | | | | $
|
|
39
|
+
| `ambient/ambient/large` | 101K | | | | | | $1 | $4 |
|
|
40
40
|
| `ambient/deepseek/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
41
41
|
| `ambient/moonshotai/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
|
|
42
42
|
| `ambient/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.73 | $4 |
|
|
43
43
|
| `ambient/stepfun/step-3.7-flash` | 262K | | | | | | $0.19 | $1 |
|
|
44
44
|
| `ambient/xiaomi/mimo-v2.5` | 1.0M | | | | | | $0.40 | $2 |
|
|
45
|
-
| `ambient/z-ai/glm-5.2` | 101K | | | | | | $
|
|
45
|
+
| `ambient/z-ai/glm-5.2` | 101K | | | | | | $1 | $4 |
|
|
46
46
|
| `ambient/zai-org/GLM-5.1-FP8` | 203K | | | | | | $1 | $4 |
|
|
47
47
|
| `ambient/zai-org/GLM-5.2-FP8` | 203K | | | | | | $1 | $4 |
|
|
48
48
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Anthropic
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 15 Anthropic models through Mastra's model router. Authentication is handled automatically using the `ANTHROPIC_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Anthropic documentation](https://docs.anthropic.com/en/docs/about-claude/models).
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# AnyAPI
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 30 AnyAPI models through Mastra's model router. Authentication is handled automatically using the `ANYAPI_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [AnyAPI documentation](https://docs.anyapi.ai).
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Baseten
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 16 Baseten models through Mastra's model router. Authentication is handled automatically using the `BASETEN_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Baseten documentation](https://docs.baseten.co).
|
|
8
8
|
|
|
@@ -17,7 +17,7 @@ const agent = new Agent({
|
|
|
17
17
|
id: "my-agent",
|
|
18
18
|
name: "My Agent",
|
|
19
19
|
instructions: "You are a helpful assistant",
|
|
20
|
-
model: "baseten/
|
|
20
|
+
model: "baseten/MiniMaxAI/MiniMax-M2.5"
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
// Generate a response
|
|
@@ -40,6 +40,7 @@ for await (const chunk of stream) {
|
|
|
40
40
|
| `baseten/moonshotai/Kimi-K2.5` | 262K | | | | | | $0.60 | $3 |
|
|
41
41
|
| `baseten/moonshotai/Kimi-K2.6` | 262K | | | | | | $0.95 | $4 |
|
|
42
42
|
| `baseten/moonshotai/Kimi-K2.7-Code` | 262K | | | | | | $0.95 | $4 |
|
|
43
|
+
| `baseten/moonshotai/Kimi-K3` | 1.0M | | | | | | $3 | $15 |
|
|
43
44
|
| `baseten/nvidia/Nemotron-120B-A12B` | 203K | | | | | | $0.30 | $0.75 |
|
|
44
45
|
| `baseten/nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B` | 203K | | | | | | $0.60 | $2 |
|
|
45
46
|
| `baseten/openai/gpt-oss-120b` | 128K | | | | | | $0.10 | $0.50 |
|
|
@@ -60,7 +61,7 @@ const agent = new Agent({
|
|
|
60
61
|
name: "custom-agent",
|
|
61
62
|
model: {
|
|
62
63
|
url: "https://inference.baseten.co/v1",
|
|
63
|
-
id: "baseten/
|
|
64
|
+
id: "baseten/MiniMaxAI/MiniMax-M2.5",
|
|
64
65
|
apiKey: process.env.BASETEN_API_KEY,
|
|
65
66
|
headers: {
|
|
66
67
|
"X-Custom-Header": "value"
|
|
@@ -79,7 +80,7 @@ const agent = new Agent({
|
|
|
79
80
|
const useAdvanced = requestContext.task === "complex";
|
|
80
81
|
return useAdvanced
|
|
81
82
|
? "baseten/zai-org/GLM-5.2-Fast"
|
|
82
|
-
: "baseten/
|
|
83
|
+
: "baseten/MiniMaxAI/MiniMax-M2.5";
|
|
83
84
|
}
|
|
84
85
|
});
|
|
85
86
|
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# CrofAI
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 24 CrofAI models through Mastra's model router. Authentication is handled automatically using the `CROF_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [CrofAI documentation](https://crof.ai/docs).
|
|
8
8
|
|
|
@@ -54,6 +54,7 @@ for await (const chunk of stream) {
|
|
|
54
54
|
| `crof/kimi-k2.5-lightning` | 131K | | | | | | $1 | $3 |
|
|
55
55
|
| `crof/kimi-k2.6` | 262K | | | | | | $0.50 | $2 |
|
|
56
56
|
| `crof/kimi-k2.7-code` | 262K | | | | | | $0.55 | $2 |
|
|
57
|
+
| `crof/kimi-k3` | 1.0M | | | | | | $2 | $8 |
|
|
57
58
|
| `crof/mimo-v2.5-pro` | 1.0M | | | | | | $0.40 | $0.80 |
|
|
58
59
|
| `crof/minimax-m2.5` | 205K | | | | | | $0.11 | $0.95 |
|
|
59
60
|
| `crof/qwen3.5-397b-a17b` | 262K | | | | | | $0.35 | $2 |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Deep Infra
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 41 Deep Infra models through Mastra's model router. Authentication is handled automatically using the `DEEPINFRA_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Deep Infra documentation](https://deepinfra.com/models).
|
|
8
8
|
|
|
@@ -17,7 +17,7 @@ const agent = new Agent({
|
|
|
17
17
|
id: "my-agent",
|
|
18
18
|
name: "My Agent",
|
|
19
19
|
instructions: "You are a helpful assistant",
|
|
20
|
-
model: "deepinfra/MiniMaxAI/MiniMax-M2.
|
|
20
|
+
model: "deepinfra/MiniMaxAI/MiniMax-M2.5"
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
// Generate a response
|
|
@@ -48,6 +48,7 @@ for await (const chunk of stream) {
|
|
|
48
48
|
| `deepinfra/moonshotai/Kimi-K2.5` | 262K | | | | | | $0.45 | $2 |
|
|
49
49
|
| `deepinfra/moonshotai/Kimi-K2.6` | 262K | | | | | | $0.75 | $4 |
|
|
50
50
|
| `deepinfra/moonshotai/Kimi-K2.7-Code` | 262K | | | | | | $0.74 | $4 |
|
|
51
|
+
| `deepinfra/moonshotai/Kimi-K3` | 1.0M | | | | | | $3 | $14 |
|
|
51
52
|
| `deepinfra/nvidia/Nemotron-3-Nano-30B-A3B` | 262K | | | | | | $0.05 | $0.20 |
|
|
52
53
|
| `deepinfra/openai/gpt-oss-120b` | 131K | | | | | | $0.04 | $0.17 |
|
|
53
54
|
| `deepinfra/openai/gpt-oss-20b` | 131K | | | | | | $0.03 | $0.14 |
|
|
@@ -81,7 +82,7 @@ const agent = new Agent({
|
|
|
81
82
|
id: "custom-agent",
|
|
82
83
|
name: "custom-agent",
|
|
83
84
|
model: {
|
|
84
|
-
id: "deepinfra/MiniMaxAI/MiniMax-M2.
|
|
85
|
+
id: "deepinfra/MiniMaxAI/MiniMax-M2.5",
|
|
85
86
|
apiKey: process.env.DEEPINFRA_API_KEY,
|
|
86
87
|
headers: {
|
|
87
88
|
"X-Custom-Header": "value"
|
|
@@ -100,7 +101,7 @@ const agent = new Agent({
|
|
|
100
101
|
const useAdvanced = requestContext.task === "complex";
|
|
101
102
|
return useAdvanced
|
|
102
103
|
? "deepinfra/zai-org/GLM-5.2"
|
|
103
|
-
: "deepinfra/MiniMaxAI/MiniMax-M2.
|
|
104
|
+
: "deepinfra/MiniMaxAI/MiniMax-M2.5";
|
|
104
105
|
}
|
|
105
106
|
});
|
|
106
107
|
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# DigitalOcean
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 82 DigitalOcean models through Mastra's model router. Authentication is handled automatically using the `DIGITALOCEAN_ACCESS_TOKEN` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [DigitalOcean documentation](https://docs.digitalocean.com/products/gradient-ai-platform/details/models/).
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Fireworks AI
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 16 Fireworks AI models through Mastra's model router. Authentication is handled automatically using the `FIREWORKS_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Fireworks AI documentation](https://fireworks.ai/docs/).
|
|
8
8
|
|
|
@@ -43,6 +43,7 @@ for await (const chunk of stream) {
|
|
|
43
43
|
| `fireworks-ai/accounts/fireworks/models/gpt-oss-20b` | 131K | | | | | | $0.07 | $0.30 |
|
|
44
44
|
| `fireworks-ai/accounts/fireworks/models/kimi-k2p6` | 262K | | | | | | $0.95 | $4 |
|
|
45
45
|
| `fireworks-ai/accounts/fireworks/models/kimi-k2p7-code` | 262K | | | | | | $0.95 | $4 |
|
|
46
|
+
| `fireworks-ai/accounts/fireworks/models/kimi-k3` | 1.0M | | | | | | $3 | $15 |
|
|
46
47
|
| `fireworks-ai/accounts/fireworks/models/minimax-m2p7` | 197K | | | | | | $0.30 | $1 |
|
|
47
48
|
| `fireworks-ai/accounts/fireworks/models/minimax-m3` | 512K | | | | | | $0.30 | $1 |
|
|
48
49
|
| `fireworks-ai/accounts/fireworks/models/qwen3p7-plus` | 262K | | | | | | $0.40 | $2 |
|
|
@@ -50,6 +51,7 @@ for await (const chunk of stream) {
|
|
|
50
51
|
| `fireworks-ai/accounts/fireworks/routers/kimi-k2p6-fast` | 262K | | | | | | $2 | $8 |
|
|
51
52
|
| `fireworks-ai/accounts/fireworks/routers/kimi-k2p6-turbo` | 262K | | | | | | $2 | $8 |
|
|
52
53
|
| `fireworks-ai/accounts/fireworks/routers/kimi-k2p7-code-fast` | 262K | | | | | | $2 | $8 |
|
|
54
|
+
| `fireworks-ai/accounts/fireworks/routers/kimi-k3-fast` | 1.0M | | | | | | $5 | $23 |
|
|
53
55
|
|
|
54
56
|
## Advanced configuration
|
|
55
57
|
|
|
@@ -79,7 +81,7 @@ const agent = new Agent({
|
|
|
79
81
|
model: ({ requestContext }) => {
|
|
80
82
|
const useAdvanced = requestContext.task === "complex";
|
|
81
83
|
return useAdvanced
|
|
82
|
-
? "fireworks-ai/accounts/fireworks/routers/kimi-
|
|
84
|
+
? "fireworks-ai/accounts/fireworks/routers/kimi-k3-fast"
|
|
83
85
|
: "fireworks-ai/accounts/fireworks/models/deepseek-v4-flash";
|
|
84
86
|
}
|
|
85
87
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Google
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 41 Google models through Mastra's model router. Authentication is handled automatically using one of the following environment variables: `GOOGLE_API_KEY`, `GOOGLE_GENERATIVE_AI_API_KEY`.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Google documentation](https://ai.google.dev/gemini-api/docs/models).
|
|
8
8
|
|