@mastra/mcp-docs-server 1.2.26-alpha.1 → 1.2.26-alpha.14
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/guardrails.md +3 -0
- package/.docs/docs/agents/overview.md +1 -1
- package/.docs/docs/agents/processors.md +21 -0
- package/.docs/docs/connections/connect-mcp-client.md +211 -0
- package/.docs/docs/deployment/mastra-server.md +8 -2
- package/.docs/docs/evals/datasets.md +5 -1
- package/.docs/docs/guides/context-engineering.md +2 -2
- package/.docs/docs/harness/background-tasks.md +30 -24
- package/.docs/docs/harness/durable-agents.md +1 -1
- package/.docs/docs/harness/signals.md +39 -0
- package/.docs/docs/index.md +1 -1
- package/.docs/docs/memory/message-history.md +6 -2
- package/.docs/docs/memory/observational-memory.md +2 -2
- package/.docs/docs/studio/overview.md +4 -0
- package/.docs/docs/subagents.md +25 -0
- package/.docs/integrations/agentic-ui/ai-sdk-ui.md +7 -0
- package/.docs/integrations/file-storage/amazon-s3.md +7 -1
- package/.docs/integrations/file-storage/archil.md +3 -3
- package/.docs/integrations/frameworks/electron.md +1 -1
- package/.docs/integrations/observability/langfuse.md +11 -1
- package/.docs/integrations/sandboxes/cloudflare-sandbox.md +28 -1
- package/.docs/integrations/sandboxes/daytona.md +33 -0
- package/.docs/integrations/sandboxes/docker.md +13 -0
- package/.docs/integrations/voice/livekit.md +26 -2
- package/.docs/integrations/voice/openai.md +19 -7
- package/.docs/models/environment-variables.md +4 -0
- package/.docs/models/gateways/merge-gateway.md +6 -1
- package/.docs/models/gateways/netlify.md +6 -1
- package/.docs/models/gateways/openrouter.md +12 -4
- package/.docs/models/gateways/vercel.md +6 -2
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/302ai.md +2 -1
- package/.docs/models/providers/above.md +1 -1
- package/.docs/models/providers/agentrouter.md +8 -6
- package/.docs/models/providers/aki-io.md +1 -1
- package/.docs/models/providers/alibaba-token-plan-cn.md +2 -1
- package/.docs/models/providers/amd.md +4 -2
- package/.docs/models/providers/baseten.md +2 -1
- package/.docs/models/providers/bothub.md +2 -1
- package/.docs/models/providers/cline-pass.md +18 -17
- package/.docs/models/providers/coralbricks.md +10 -9
- package/.docs/models/providers/cortecs.md +13 -12
- package/.docs/models/providers/deepinfra.md +8 -7
- package/.docs/models/providers/digitalocean.md +3 -2
- package/.docs/models/providers/edenai.md +34 -12
- package/.docs/models/providers/empiriolabs.md +4 -1
- package/.docs/models/providers/fireworks-ai.md +2 -1
- package/.docs/models/providers/friendli.md +3 -2
- package/.docs/models/providers/greenpt.md +2 -1
- package/.docs/models/providers/huggingface.md +4 -1
- package/.docs/models/providers/hyper.md +8 -7
- package/.docs/models/providers/infer.md +78 -0
- package/.docs/models/providers/kilo.md +27 -20
- package/.docs/models/providers/kimi-for-coding.md +1 -1
- package/.docs/models/providers/llmgateway-providers.md +33 -5
- package/.docs/models/providers/llmgateway.md +9 -2
- package/.docs/models/providers/melious.md +91 -0
- package/.docs/models/providers/nan.md +1 -1
- package/.docs/models/providers/nano-gpt.md +95 -100
- package/.docs/models/providers/nvidia.md +3 -2
- package/.docs/models/providers/ofox.md +30 -3
- package/.docs/models/providers/ollama-cloud.md +23 -21
- package/.docs/models/providers/pioneer.md +11 -2
- package/.docs/models/providers/requesty.md +5 -6
- package/.docs/models/providers/tinfoil.md +5 -4
- package/.docs/models/providers/togetherai.md +2 -1
- package/.docs/models/providers/vancine.md +11 -13
- package/.docs/models/providers/vispark.md +79 -0
- package/.docs/models/providers/volcengine-coding-plan.md +3 -1
- package/.docs/models/providers/wallaby.md +77 -0
- package/.docs/models/providers/wandb.md +2 -2
- package/.docs/models/providers.md +4 -0
- package/.docs/reference/agents/agent.md +47 -1
- package/.docs/reference/agents/generate.md +2 -0
- package/.docs/reference/agents/inngest-agent.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +16 -0
- package/.docs/reference/cli/mastra.md +52 -0
- package/.docs/reference/client-js/datasets.md +1 -1
- package/.docs/reference/configuration.md +2 -2
- package/.docs/reference/datasets/purgeItem.md +3 -3
- package/.docs/reference/index.md +3 -0
- package/.docs/reference/memory/cloneThread.md +2 -0
- package/.docs/reference/memory/copyThread.md +65 -0
- package/.docs/reference/memory/memory-class.md +2 -1
- package/.docs/reference/memory/observational-memory.md +3 -2
- package/.docs/reference/memory/recall.md +51 -0
- package/.docs/reference/memory/updateThreadResourceId.md +46 -0
- package/.docs/reference/observability/tracing/interfaces.md +27 -5
- package/.docs/reference/processors/agents-md-injector.md +55 -0
- package/.docs/reference/processors/language-detector.md +2 -0
- package/.docs/reference/processors/moderation-processor.md +2 -0
- package/.docs/reference/processors/pii-detector.md +2 -0
- package/.docs/reference/processors/processor-interface.md +4 -0
- package/.docs/reference/processors/prompt-injection-detector.md +2 -0
- package/.docs/reference/processors/provider-history-compat.md +7 -6
- package/.docs/reference/processors/system-prompt-scrubber.md +2 -0
- package/.docs/reference/pubsub/redis-streams.md +6 -0
- package/.docs/reference/pubsub/valkey-streams.md +6 -0
- package/.docs/reference/streaming/agents/stream.md +30 -0
- package/.docs/reference/tools/mcp-server.md +28 -0
- package/.docs/reference/workspace/filesystem.md +72 -0
- package/package.json +4 -4
|
@@ -1362,6 +1362,11 @@ export function NestedAgentChat() {
|
|
|
1362
1362
|
<div key={index} className="nested-agent">
|
|
1363
1363
|
<strong>Nested Agent: {id}</strong>
|
|
1364
1364
|
{data.text && <p>{data.text}</p>}
|
|
1365
|
+
{data.toolErrors?.map(toolError => (
|
|
1366
|
+
<p key={toolError.toolCallId} className="nested-agent-error">
|
|
1367
|
+
{toolError.toolName} failed: {toolError.errorText}
|
|
1368
|
+
</p>
|
|
1369
|
+
))}
|
|
1365
1370
|
</div>
|
|
1366
1371
|
)
|
|
1367
1372
|
}
|
|
@@ -1388,6 +1393,8 @@ Key points:
|
|
|
1388
1393
|
- Piping `fullStream` to `context.writer` creates `data-tool-agent` parts
|
|
1389
1394
|
- Read `data-tool-agent-step` when you need the full payload for the nested step that finished
|
|
1390
1395
|
- The `AgentDataPart` has `id` (on the part) and `data.text` (the current nested-agent text snapshot)
|
|
1396
|
+
- A tool that throws inside the nested agent is reported in `data.toolErrors`, each entry `{ toolCallId, toolName, args?, errorText, providerExecuted? }`. `errorText` is a JSON-safe string, so the failure survives serialization to the client instead of arriving as `{}`
|
|
1397
|
+
- `toolErrors` resets at each nested step boundary, like `toolCalls` and `toolResults`. For a finished step, read it from `data-tool-agent-step` (`data.step.toolErrors`) or from `data.steps[]` on the final snapshot
|
|
1391
1398
|
- The tool still returns its own output after the stream completes
|
|
1392
1399
|
|
|
1393
1400
|
For a complete implementation, see the [tool-nested-streams example](https://github.com/mastra-ai/ui-dojo/blob/main/src/pages/ai-sdk/tool-nested-streams.tsx) in UI Dojo.
|
|
@@ -111,7 +111,13 @@ const filesystem = new S3Filesystem({
|
|
|
111
111
|
})
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
Provider functions only apply to `S3Filesystem` API calls. When mounting the filesystem into an E2B sandbox, mount configuration only supports static `accessKeyId`, `secretAccessKey`, and `sessionToken` values, so credential refresh must be handled outside the mount.
|
|
114
|
+
Provider functions only apply to `S3Filesystem` API calls. When mounting the filesystem into an E2B or Daytona sandbox, mount configuration only supports static `accessKeyId`, `secretAccessKey`, and `sessionToken` values, so credential refresh must be handled outside the mount. See [temporary credentials in Daytona](https://mastra.ai/integrations/sandboxes/daytona) for mount lifetime and isolation requirements.
|
|
115
|
+
|
|
116
|
+
### Prefix-scoped permissions
|
|
117
|
+
|
|
118
|
+
When `prefix` is set, initialization calls `ListObjectsV2` with the normalized prefix, including its trailing `/`, and `MaxKeys: 1`. Credentials must permit listing that prefix. Without a prefix, initialization uses `HeadBucket`. These checks verify access, not whether a directory exists.
|
|
119
|
+
|
|
120
|
+
The prefix limits which keys the filesystem addresses; it isn't an authorization boundary. For isolation, use credentials whose storage-provider policy restricts access to that prefix. Keep parent credentials on your backend. Read and write permissions alone aren't sufficient for prefixed filesystem initialization.
|
|
115
121
|
|
|
116
122
|
### Cloudflare R2
|
|
117
123
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Archil
|
|
6
6
|
|
|
7
|
-
Stores files on [Archil](https://docs.archil.com) elastic, serverless disks. Combines an S3-compatible object API for fast reads/writes with `exec()` for POSIX shell operations and `
|
|
7
|
+
Stores files on [Archil](https://docs.archil.com) elastic, serverless disks. Combines an S3-compatible object API for fast reads/writes with `exec()` for POSIX shell operations and `diskGrep()` for parallel server-side search. For interface details, see [WorkspaceFilesystem Interface](https://mastra.ai/reference/workspace/filesystem).
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -173,12 +173,12 @@ const result = await filesystem.exec('ls -la /data')
|
|
|
173
173
|
// { exitCode: 0, stdout: '...', stderr: '' }
|
|
174
174
|
```
|
|
175
175
|
|
|
176
|
-
#### `
|
|
176
|
+
#### `diskGrep(options)`
|
|
177
177
|
|
|
178
178
|
Run a parallel server-side search across files on the disk.
|
|
179
179
|
|
|
180
180
|
```typescript
|
|
181
|
-
const results = await filesystem.
|
|
181
|
+
const results = await filesystem.diskGrep({
|
|
182
182
|
directory: '/logs',
|
|
183
183
|
pattern: 'ERROR',
|
|
184
184
|
recursive: true,
|
|
@@ -430,7 +430,7 @@ export default function App(): React.JSX.Element {
|
|
|
430
430
|
}
|
|
431
431
|
```
|
|
432
432
|
|
|
433
|
-
This connects [`useChat()`](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-chat) to the `/chat/weather-agent` endpoint, sending
|
|
433
|
+
This connects [`useChat()`](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-chat) to the `/chat/weather-agent` endpoint, sending prompts there and streaming the response back in chunks.
|
|
434
434
|
|
|
435
435
|
## Test your agent
|
|
436
436
|
|
|
@@ -216,7 +216,7 @@ const tracingOptions = {
|
|
|
216
216
|
|
|
217
217
|
This example produces `langfuse.trace.metadata.customerId` and `langfuse.trace.metadata.tier`.
|
|
218
218
|
|
|
219
|
-
Metadata on the root span is also forwarded. Mastra sets `runId` and `resourceId` on every agent and workflow root span, and you can add your own keys through `tracingOptions.metadata`. The exporter forwards each of these root span keys to `langfuse.trace.metadata.<key>`. Keys that map to a dedicated Langfuse field (`userId`, `sessionId`, `threadId`, `traceName`, and `version`) are not duplicated as trace metadata.
|
|
219
|
+
Metadata on the root span is also forwarded. Mastra sets `runId` and `resourceId` on every agent and workflow root span, and you can add your own keys through `tracingOptions.metadata`. The exporter forwards each of these root span keys to `langfuse.trace.metadata.<key>`. Keys that map to a dedicated Langfuse field (`userId`, `sessionId`, `threadId`, `traceName`, and `version`) are not duplicated as trace metadata. Other metadata on child spans stays on the observation. Dedicated fields such as session IDs follow their own mapping rules.
|
|
220
220
|
|
|
221
221
|
Notes:
|
|
222
222
|
|
|
@@ -225,6 +225,16 @@ Notes:
|
|
|
225
225
|
- Keys under `langfuse` take precedence over root span metadata with the same name.
|
|
226
226
|
- Values are sent as strings, because Langfuse maps trace metadata attributes as strings. Numbers, booleans, and objects are serialized with JSON. Langfuse Cloud restores them to their original types on ingestion.
|
|
227
227
|
|
|
228
|
+
## Conversation sessions
|
|
229
|
+
|
|
230
|
+
The exporter maps span metadata to Langfuse sessions using `sessionId`, or `threadId` when `sessionId` is absent or `null`. An explicit empty `sessionId` suppresses this fallback and sends no session ID.
|
|
231
|
+
|
|
232
|
+
For [Observational Memory](https://mastra.ai/docs/memory/observational-memory), the Langfuse exporter keeps observer and reflector spans in the caller's session, even when child spans arrive before their parents. An explicit `sessionId`, including an empty string, takes precedence. Otherwise, the exporter uses the original caller thread carried by Observational Memory before falling back to the span's own `threadId`. Observational Memory captures that caller identity from the caller span's non-empty `threadId`, or the original request's thread ID. Nested observation preserves the outer caller identity.
|
|
233
|
+
|
|
234
|
+
This thread-to-session fallback is specific to Langfuse. Observational Memory doesn't synthesize generic `sessionId` metadata from a thread ID for other exporters.
|
|
235
|
+
|
|
236
|
+
Internal observer and reflector execution threads remain separate. Multi-thread observation uses the invoking caller's session, not the first thread in the batch. This session behavior applies regardless of the `bufferOnIdle` setting and doesn't change buffering or span parentage.
|
|
237
|
+
|
|
228
238
|
## Prompt linking
|
|
229
239
|
|
|
230
240
|
You can link LLM generations to prompts stored in [Langfuse Prompt Management](https://langfuse.com/docs/prompt-management). It enables version tracking and metrics for your prompts.
|
|
@@ -82,6 +82,8 @@ const result = await workspace.sandbox?.executeCommand?.('npm', ['test'], {
|
|
|
82
82
|
|
|
83
83
|
Relative paths are resolved under `/workspace`. Absolute paths must also resolve within `/workspace`. Each file is sent as its own bridge request, and the bridge caps a single file at 32 MiB.
|
|
84
84
|
|
|
85
|
+
The Cloudflare sandbox cannot set per-file permissions, so a `writeFiles` call that includes a `mode` is rejected rather than silently ignored.
|
|
86
|
+
|
|
85
87
|
```typescript
|
|
86
88
|
await workspace.sandbox?.writeFiles?.([
|
|
87
89
|
{ path: 'src/index.ts', content: "console.log('hello')\n" },
|
|
@@ -89,6 +91,31 @@ await workspace.sandbox?.writeFiles?.([
|
|
|
89
91
|
])
|
|
90
92
|
```
|
|
91
93
|
|
|
94
|
+
## Read files
|
|
95
|
+
|
|
96
|
+
Read a single file back from `/workspace` as raw bytes. Relative paths resolve under `/workspace`, and absolute paths must also resolve within it.
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
const bytes = await workspace.sandbox?.readFile?.('src/index.ts')
|
|
100
|
+
const source = new TextDecoder().decode(bytes)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Persist and restore the workspace
|
|
104
|
+
|
|
105
|
+
`persistWorkspace()` archives `/workspace` and returns the raw tar bytes; `hydrateWorkspace()` restores it from those bytes. Store the archive between sessions to resume work after a container sleeps or is recreated.
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
// Back up before the container can sleep
|
|
109
|
+
const archive = await workspace.sandbox?.persistWorkspace?.({ excludes: ['node_modules'] })
|
|
110
|
+
await myStorage.put('workspace-backup', archive)
|
|
111
|
+
|
|
112
|
+
// Later, on a fresh or reconnected sandbox
|
|
113
|
+
const archive = await myStorage.get('workspace-backup')
|
|
114
|
+
await workspace.sandbox?.hydrateWorkspace?.(archive)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
For bucket mounts and execution sessions, use the corresponding `CloudflareSandboxBridgeClient` methods (`mountBucket`, `unmountBucket`, `createSession`, `deleteSession`) directly.
|
|
118
|
+
|
|
92
119
|
## Constructor parameters
|
|
93
120
|
|
|
94
121
|
**baseUrl** (`string`): URL of the deployed Cloudflare Sandbox Bridge Worker.
|
|
@@ -117,4 +144,4 @@ await workspace.sandbox?.writeFiles?.([
|
|
|
117
144
|
|
|
118
145
|
## Limitations
|
|
119
146
|
|
|
120
|
-
The provider
|
|
147
|
+
The provider surfaces command execution, streamed output, file reads and writes, and workspace persistence directly on the sandbox. Bucket mounts and sessions are available on the bridge client (`CloudflareSandboxBridgeClient`) but not on the `CloudflareSandbox` surface. PTY terminals are not exposed, and the provider doesn't support background process management, stdin, snapshots, or port URLs.
|
|
@@ -200,6 +200,39 @@ const workspace = new Workspace({
|
|
|
200
200
|
|
|
201
201
|
When the workspace starts, the filesystems are automatically mounted at the specified paths. Code running in the sandbox can then access files at `/s3-data` and `/gcs-data` as if they were local directories.
|
|
202
202
|
|
|
203
|
+
#### Temporary S3 credentials
|
|
204
|
+
|
|
205
|
+
Pass all three credential values to `S3Filesystem` when using temporary credentials. Daytona forwards the session token to s3fs:
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
import { Workspace } from '@mastra/core/workspace'
|
|
209
|
+
import { DaytonaSandbox } from '@mastra/daytona'
|
|
210
|
+
import { S3Filesystem } from '@mastra/s3'
|
|
211
|
+
|
|
212
|
+
const workspace = new Workspace({
|
|
213
|
+
mounts: {
|
|
214
|
+
'/s3-data': new S3Filesystem({
|
|
215
|
+
bucket: process.env.S3_BUCKET!,
|
|
216
|
+
region: process.env.S3_REGION ?? 'us-east-1',
|
|
217
|
+
endpoint: process.env.S3_ENDPOINT,
|
|
218
|
+
prefix: 'resource-123/thread-456/',
|
|
219
|
+
accessKeyId: process.env.SCOPED_S3_ACCESS_KEY_ID!,
|
|
220
|
+
secretAccessKey: process.env.SCOPED_S3_SECRET_ACCESS_KEY!,
|
|
221
|
+
sessionToken: process.env.SCOPED_S3_SESSION_TOKEN!,
|
|
222
|
+
}),
|
|
223
|
+
},
|
|
224
|
+
sandbox: new DaytonaSandbox({ language: 'python', ephemeral: true }),
|
|
225
|
+
})
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Before starting the workspace, obtain credentials from your storage provider that authorize only the intended prefix. Credential issuance is provider-specific; Mastra doesn't mint or restrict credentials. A `prefix` selects a directory but doesn't enforce authorization. Authenticate each request, authorize its resource and thread, and use separate sandboxes for separate security scopes.
|
|
229
|
+
|
|
230
|
+
Temporary credentials are loaded when the mount starts and aren't automatically refreshed. Host-side credential provider functions don't refresh the mount. Keep runs within the credential lifetime and create a new sandbox with fresh credentials for later runs. Reconnecting to a sandbox doesn't renew its credentials.
|
|
231
|
+
|
|
232
|
+
Credentials are uploaded into owner-only files inside private directories. After launching s3fs, Daytona removes the temporary-credential staging file and directory. The daemon retains the credentials in its environment, which sandbox code running as the same user or root can still read. Never supply broader credentials than the sandbox needs. Mounts using long-lived credentials retain their password files while s3fs needs them. Unmount and reconnect cleanup remove those files after verifying that the daemon has exited. If a daemon is still active, including after a mount is moved aside, or its status can't be checked, the files are retained and a warning is logged. Cleanup on a later unmount of the same path retries removal; deleting the sandbox removes any remaining files.
|
|
233
|
+
|
|
234
|
+
Prefixed filesystems require permission to list their prefix during initialization. With s3fs, a prefixed mount may also require a zero-byte object at the exact `<prefix>/` key. Provision that directory marker before mounting. After launching s3fs, Daytona checks the mounted directory's metadata without listing its contents, with a 15-second timeout and forced termination after another 5 seconds. A failed check reports a mount failure. Cleanup attempts to unmount the failed mount, moving a stuck mount aside if necessary to free the original path for retry. Moved stale mounts may remain until sandbox deletion. This startup check doesn't guarantee read or write access to individual files or ongoing daemon health; verify a read and write through the mounted path.
|
|
235
|
+
|
|
203
236
|
#### Via `sandbox.mount()`
|
|
204
237
|
|
|
205
238
|
Mount manually at any point after the sandbox has started:
|
|
@@ -162,6 +162,19 @@ const sandbox = new DockerSandbox({
|
|
|
162
162
|
})
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
+
## Write files
|
|
166
|
+
|
|
167
|
+
Upload multiple files in one call with `writeFiles`. Relative paths resolve under the working directory. Set an optional per-file `mode` to control POSIX permissions; it must be an integer between `0o001` and `0o777`. When `mode` is omitted, new files are created with `0644`.
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
await sandbox.writeFiles([
|
|
171
|
+
{ path: 'src/index.js', content: "console.log('hello')\n" },
|
|
172
|
+
{ path: 'run.sh', content: '#!/bin/sh\n', mode: 0o755 },
|
|
173
|
+
])
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Docker is the only built-in sandbox that applies an explicit `mode`. Providers that cannot honor per-file permissions (Vercel, E2B, Daytona, Cloudflare) reject a `writeFiles` call that includes a `mode` instead of silently dropping it.
|
|
177
|
+
|
|
165
178
|
## Bind mounts
|
|
166
179
|
|
|
167
180
|
Mount host directories into the container using the `volumes` option:
|
|
@@ -205,6 +205,28 @@ export default createLiveKitWorker({
|
|
|
205
205
|
|
|
206
206
|
`configuration.stt` works the same way for per-call transcription, for example a different transcription model or language per tenant. The greeting has a matching per-call form: `configuration.greeting.text` accepts a resolver with the same call context, so one worker can open with each tenant's own phrasing.
|
|
207
207
|
|
|
208
|
+
### Per-call turn detection
|
|
209
|
+
|
|
210
|
+
LiveKit's `TurnDetector` classes read the job's inference executor when constructed, so they can only be created inside a LiveKit job, not at module scope where the worker options live. To use one, set the `configuration.turnDetection` resolver. It runs once per call with the same call context as `configuration.stt` and returns anything the top-level `turnDetection` option accepts. Return `undefined` to fall back to the top-level option.
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
import { turnDetector } from '@livekit/agents-plugin-livekit'
|
|
214
|
+
|
|
215
|
+
export default createLiveKitWorker({
|
|
216
|
+
mastra,
|
|
217
|
+
agent: 'support',
|
|
218
|
+
stt: 'deepgram/nova-3',
|
|
219
|
+
tts: 'cartesia/sonic-3',
|
|
220
|
+
turnDetection: 'multilingual',
|
|
221
|
+
configuration: {
|
|
222
|
+
// Constructed inside the job, where the inference executor is available.
|
|
223
|
+
turnDetection: () => new turnDetector.MultilingualModel(0.2),
|
|
224
|
+
},
|
|
225
|
+
})
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
The semantic model's inference runners must be registered before the agent server boots, so when this resolver is set the worker imports `@livekit/agents-plugin-livekit` up front. Keep the top-level `turnDetection` set to `'multilingual'` or `'english'` to pre-register only that model; otherwise both stay available.
|
|
229
|
+
|
|
208
230
|
### Memory and threads
|
|
209
231
|
|
|
210
232
|
When the resolved Mastra agent has memory configured, each call becomes one memory thread:
|
|
@@ -539,7 +561,7 @@ if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
|
539
561
|
|
|
540
562
|
**vad** (`VAD | 'silero' | false`): Voice activity detection. 'silero' loads the Silero VAD from @livekit/agents-plugin-silero during prewarm. Pass an instance to bring your own, or false to disable. (Default: `'silero'`)
|
|
541
563
|
|
|
542
|
-
**turnDetection** (`'multilingual' | 'english' | TurnDetectionMode`): End-of-turn detection. 'multilingual' and 'english' load LiveKit's semantic turn detector from @livekit/agents-plugin-livekit. Other values such as 'vad', 'stt', or 'manual' pass through.
|
|
564
|
+
**turnDetection** (`'multilingual' | 'english' | TurnDetectionMode`): End-of-turn detection. 'multilingual' and 'english' load LiveKit's semantic turn detector from @livekit/agents-plugin-livekit. Other values such as 'vad', 'stt', or 'manual' pass through. To construct a TurnDetector instance per call, set the configuration.turnDetection resolver — it takes precedence, with this option as the fallback.
|
|
543
565
|
|
|
544
566
|
**turnHandling** (`Partial<TurnHandlingOptions>`): Turn handling tuning: endpointing delays, interruption sensitivity, preemptive generation. The worker disables preemptiveGeneration unless set here — each preemptive attempt re-runs the Mastra agent and persists partial user and assistant messages unless memory.options.readOnly is set.
|
|
545
567
|
|
|
@@ -551,7 +573,7 @@ if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
|
551
573
|
|
|
552
574
|
**onTurnComplete** (`(ctx: VoiceTurnCompleteContext) => void | Promise<void>`): Called once per turn after the reply finished streaming to text-to-speech. Runs off the audio path and is not awaited. The context carries the produced reply (text, toolCalls, interrupted, usage) and the resolved memory mapping.
|
|
553
575
|
|
|
554
|
-
**configuration** (`LiveKitWorkerConfiguration`): Grouped conversation and compliance configuration: the opening greeting and AI disclosure, consent requirements, agent-initiated hang-up, and per-call STT/TTS selection.
|
|
576
|
+
**configuration** (`LiveKitWorkerConfiguration`): Grouped conversation and compliance configuration: the opening greeting and AI disclosure, consent requirements, agent-initiated hang-up, and per-call STT/TTS/turn detection selection.
|
|
555
577
|
|
|
556
578
|
**configuration.greeting** (`GreetingConfiguration`): The opening greeting and AI disclosure: text (a fixed string or a per-call resolver for per-tenant greetings), allowInterruptions, awaitPlayout, persist, and periodic re-disclosure via repeatEvery and repeatText.
|
|
557
579
|
|
|
@@ -563,6 +585,8 @@ if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
|
563
585
|
|
|
564
586
|
**configuration.tts** (`(context: VoiceCallContext) => TTS | string | undefined`): Per-call text-to-speech: a resolver invoked once per call (post-connect) with { metadata, requestContext, roomName, ctx }, returning anything the top-level tts option accepts — one voice or language per tenant. Return undefined to fall back to the top-level tts. Cache plugin instances across calls.
|
|
565
587
|
|
|
588
|
+
**configuration.turnDetection** (`(context: VoiceCallContext) => TurnDetectionMode | undefined`): Per-call end-of-turn detection: a resolver invoked once per call (post-connect, inside the LiveKit job) with { metadata, requestContext, roomName, ctx }, returning anything the top-level turnDetection option accepts. Use it to construct LiveKit TurnDetector instances, which need the job's inference executor. Return undefined to fall back to the top-level turnDetection.
|
|
589
|
+
|
|
566
590
|
**greeting** (`string`): Static greeting spoken when the session starts. Deprecated: prefer configuration.greeting.text.
|
|
567
591
|
|
|
568
592
|
**persistGreeting** (`boolean`): Save the spoken greeting to the memory thread as an assistant message, making the saved thread a faithful call transcript. Only applies when a greeting is set and memory is enabled. Deprecated: prefer configuration.greeting.persist. (Default: `true`)
|
|
@@ -232,6 +232,16 @@ Disconnects from the OpenAI Realtime session and cleans up resources. Should be
|
|
|
232
232
|
|
|
233
233
|
Returns: `void`
|
|
234
234
|
|
|
235
|
+
#### `sendEvent()`
|
|
236
|
+
|
|
237
|
+
Sends a raw client event to the OpenAI Realtime session. Use this for session control that has no dedicated method, such as adding conversation items. Events sent before the session is created are queued and sent once it is.
|
|
238
|
+
|
|
239
|
+
**type** (`string`): OpenAI Realtime client event type, such as conversation.item.create.
|
|
240
|
+
|
|
241
|
+
**data** (`Record<string, unknown>`): Event payload sent alongside the type. (Default: `{}`)
|
|
242
|
+
|
|
243
|
+
Returns: `void`
|
|
244
|
+
|
|
235
245
|
#### `getSpeakers()`
|
|
236
246
|
|
|
237
247
|
Returns a list of available voice speakers.
|
|
@@ -270,17 +280,19 @@ The OpenAIRealtimeVoice class emits the following events:
|
|
|
270
280
|
|
|
271
281
|
#### OpenAI Realtime Events
|
|
272
282
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
**openAIRealtime:conversation.created** (`event`): Emitted when a new conversation is created.
|
|
283
|
+
Every server event received from the OpenAI Realtime API is also emitted with the `openAIRealtime:` prefix, using the [OpenAI server event type](https://platform.openai.com/docs/api-reference/realtime-server-events) as the suffix. The callback receives the complete event payload.
|
|
276
284
|
|
|
277
|
-
|
|
285
|
+
```typescript
|
|
286
|
+
voice.on('openAIRealtime:rate_limits.updated', event => {
|
|
287
|
+
console.log(event.rate_limits)
|
|
288
|
+
})
|
|
289
|
+
```
|
|
278
290
|
|
|
279
|
-
|
|
291
|
+
#### Socket Events
|
|
280
292
|
|
|
281
|
-
**
|
|
293
|
+
**open** (`event`): Emitted when the WebSocket connection to OpenAI opens.
|
|
282
294
|
|
|
283
|
-
**
|
|
295
|
+
**close** (`event`): Emitted when the WebSocket connection closes, including when OpenAI closes it. Callback receives { code: number, reason: string }.
|
|
284
296
|
|
|
285
297
|
### Available voices
|
|
286
298
|
|
|
@@ -79,6 +79,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
79
79
|
| [Impossibl](https://mastra.ai/models/providers/impossibl) | `impossibl/*` | `IMPOSSIBL_API_KEY` |
|
|
80
80
|
| [Inception](https://mastra.ai/models/providers/inception) | `inception/*` | `INCEPTION_API_KEY` |
|
|
81
81
|
| [Inceptron](https://mastra.ai/models/providers/inceptron) | `inceptron/*` | `INCEPTRON_API_KEY` |
|
|
82
|
+
| [Infer by Flow7](https://mastra.ai/models/providers/infer) | `infer/*` | `INFER_API_KEY` |
|
|
82
83
|
| [Inference](https://mastra.ai/models/providers/inference) | `inference/*` | `INFERENCE_API_KEY` |
|
|
83
84
|
| [InferX](https://mastra.ai/models/providers/inferx) | `inferx/*` | `INFERX_API_KEY` |
|
|
84
85
|
| [Infomaniak](https://mastra.ai/models/providers/infomaniak) | `infomaniak/*` | `INFOMANIAK_PRODUCT_ID`, `INFOMANIAK_API_KEY` |
|
|
@@ -102,6 +103,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
102
103
|
| [LucidQuery](https://mastra.ai/models/providers/lucidquery) | `lucidquery/*` | `LUCIDQUERY_API_KEY` |
|
|
103
104
|
| [Lynkr](https://mastra.ai/models/providers/lynkr) | `lynkr/*` | `LYNKR_API_KEY` |
|
|
104
105
|
| [Meganova](https://mastra.ai/models/providers/meganova) | `meganova/*` | `MEGANOVA_API_KEY` |
|
|
106
|
+
| [Melious](https://mastra.ai/models/providers/melious) | `melious/*` | `MELIOUS_API_KEY` |
|
|
105
107
|
| [Meta](https://mastra.ai/models/providers/meta) | `meta/*` | `META_MODEL_API_KEY` |
|
|
106
108
|
| [MiniMax (minimax.io)](https://mastra.ai/models/providers/minimax) | `minimax/*` | `MINIMAX_API_KEY` |
|
|
107
109
|
| [MiniMax (minimaxi.com)](https://mastra.ai/models/providers/minimax-cn) | `minimax-cn/*` | `MINIMAX_API_KEY` |
|
|
@@ -182,11 +184,13 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
182
184
|
| [UnoRouter](https://mastra.ai/models/providers/unorouter) | `unorouter/*` | `UNOROUTER_API_KEY` |
|
|
183
185
|
| [Upstage](https://mastra.ai/models/providers/upstage) | `upstage/*` | `UPSTAGE_API_KEY` |
|
|
184
186
|
| [Vancine](https://mastra.ai/models/providers/vancine) | `vancine/*` | `VANCINE_API_KEY` |
|
|
187
|
+
| [Vispark](https://mastra.ai/models/providers/vispark) | `vispark/*` | `VISPARK_LAB_API_KEY` |
|
|
185
188
|
| [Vivgrid](https://mastra.ai/models/providers/vivgrid) | `vivgrid/*` | `VIVGRID_API_KEY` |
|
|
186
189
|
| [Volcengine Ark](https://mastra.ai/models/providers/volcengine) | `volcengine/*` | `ARK_API_KEY` |
|
|
187
190
|
| [Volcengine Ark Coding Plan](https://mastra.ai/models/providers/volcengine-coding-plan) | `volcengine-coding-plan/*` | `ARK_CODING_PLAN_API_KEY` |
|
|
188
191
|
| [Vultr](https://mastra.ai/models/providers/vultr) | `vultr/*` | `VULTR_API_KEY` |
|
|
189
192
|
| [Wafer](https://mastra.ai/models/providers/wafer.ai) | `wafer.ai/*` | `WAFER_API_KEY` |
|
|
193
|
+
| [Wallaby](https://mastra.ai/models/providers/wallaby) | `wallaby/*` | `WALLABY_API_KEY` |
|
|
190
194
|
| [Weights & Biases](https://mastra.ai/models/providers/wandb) | `wandb/*` | `WANDB_API_KEY` |
|
|
191
195
|
| [xAI](https://mastra.ai/models/providers/xai) | `xai/*` | `XAI_API_KEY` |
|
|
192
196
|
| [Xiaomi](https://mastra.ai/models/providers/xiaomi) | `xiaomi/*` | `XIAOMI_API_KEY` |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Merge Gateway
|
|
6
6
|
|
|
7
|
-
Merge Gateway aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
7
|
+
Merge Gateway aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 187 models through Mastra's model router.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Merge Gateway documentation](https://docs.merge.dev/merge-gateway).
|
|
10
10
|
|
|
@@ -67,6 +67,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
67
67
|
| `deepseek/deepseek-v3.1` |
|
|
68
68
|
| `deepseek/deepseek-v3.2` |
|
|
69
69
|
| `deepseek/deepseek-v4-flash` |
|
|
70
|
+
| `deepseek/deepseek-v4-flash-0423` |
|
|
70
71
|
| `deepseek/deepseek-v4-flash-0731` |
|
|
71
72
|
| `deepseek/deepseek-v4-flash-0731-fast` |
|
|
72
73
|
| `deepseek/deepseek-v4-pro` |
|
|
@@ -94,6 +95,9 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
94
95
|
| `google/gemini-embedding-001` |
|
|
95
96
|
| `google/gemini-flash-latest` |
|
|
96
97
|
| `google/gemini-flash-lite-latest` |
|
|
98
|
+
| `google/gemma-3-12b-it` |
|
|
99
|
+
| `google/gemma-3-27b-it` |
|
|
100
|
+
| `google/gemma-3-4b-it` |
|
|
97
101
|
| `google/gemma-4-26b-a4b-it` |
|
|
98
102
|
| `google/gemma-4-31b-it` |
|
|
99
103
|
| `meta/llama-3.1-70b-instruct` |
|
|
@@ -160,6 +164,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
160
164
|
| `openai/gpt-oss-120b` |
|
|
161
165
|
| `openai/gpt-oss-20b` |
|
|
162
166
|
| `openai/gpt-oss-safeguard-120b` |
|
|
167
|
+
| `openai/gpt-oss-safeguard-20b` |
|
|
163
168
|
| `openai/o1` |
|
|
164
169
|
| `openai/o3` |
|
|
165
170
|
| `openai/o3-mini` |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Netlify
|
|
6
6
|
|
|
7
|
-
Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access
|
|
7
|
+
Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 257 models through Mastra's model router.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Netlify documentation](https://docs.netlify.com/build/ai-gateway/overview/).
|
|
10
10
|
|
|
@@ -117,6 +117,8 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
117
117
|
| `openai/o3` |
|
|
118
118
|
| `openai/o3-mini` |
|
|
119
119
|
| `openai/o4-mini` |
|
|
120
|
+
| `openrouter/~deepseek/deepseek-flash-latest` |
|
|
121
|
+
| `openrouter/~deepseek/deepseek-pro-latest` |
|
|
120
122
|
| `openrouter/~deepseek/deepseek-v4-flash-latest` |
|
|
121
123
|
| `openrouter/~moonshotai/kimi-latest` |
|
|
122
124
|
| `openrouter/~x-ai/grok-latest` |
|
|
@@ -161,7 +163,10 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
161
163
|
| `openrouter/inclusionai/ling-3.0-flash-fin` |
|
|
162
164
|
| `openrouter/inclusionai/ling-3.0-flash-fin:free` |
|
|
163
165
|
| `openrouter/inclusionai/ling-3.0-flash-sante:free` |
|
|
166
|
+
| `openrouter/inclusionai/ling-3.0-flash-vl` |
|
|
164
167
|
| `openrouter/inclusionai/ling-3.0-flash-vl:free` |
|
|
168
|
+
| `openrouter/inference-net/schematron-v2-small` |
|
|
169
|
+
| `openrouter/inference-net/schematron-v2-turbo` |
|
|
165
170
|
| `openrouter/mancer/weaver` |
|
|
166
171
|
| `openrouter/meta-llama/llama-3.1-70b-instruct` |
|
|
167
172
|
| `openrouter/meta-llama/llama-3.1-8b-instruct` |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# OpenRouter
|
|
6
6
|
|
|
7
|
-
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
7
|
+
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 367 models through Mastra's model router.
|
|
8
8
|
|
|
9
9
|
Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
|
|
10
10
|
|
|
@@ -42,12 +42,17 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
42
42
|
| `~anthropic/claude-haiku-latest` |
|
|
43
43
|
| `~anthropic/claude-opus-latest` |
|
|
44
44
|
| `~anthropic/claude-sonnet-latest` |
|
|
45
|
+
| `~deepseek/deepseek-flash-latest` |
|
|
46
|
+
| `~deepseek/deepseek-pro-latest` |
|
|
45
47
|
| `~deepseek/deepseek-v4-flash-latest` |
|
|
46
48
|
| `~google/gemini-flash-latest` |
|
|
47
49
|
| `~google/gemini-pro-latest` |
|
|
48
50
|
| `~moonshotai/kimi-latest` |
|
|
49
|
-
| `~openai/gpt-latest`
|
|
51
|
+
| `~openai/gpt-astra-latest` |
|
|
52
|
+
| `~openai/gpt-luna-latest` |
|
|
50
53
|
| `~openai/gpt-mini-latest` |
|
|
54
|
+
| `~openai/gpt-sol-latest` |
|
|
55
|
+
| `~openai/gpt-terra-latest` |
|
|
51
56
|
| `~x-ai/grok-latest` |
|
|
52
57
|
| `~z-ai/glm-flash-latest` |
|
|
53
58
|
| `~z-ai/glm-latest` |
|
|
@@ -112,7 +117,6 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
112
117
|
| `google/gemini-2.5-flash-lite` |
|
|
113
118
|
| `google/gemini-2.5-pro` |
|
|
114
119
|
| `google/gemini-2.5-pro-preview` |
|
|
115
|
-
| `google/gemini-2.5-pro-preview-05-06` |
|
|
116
120
|
| `google/gemini-3-flash-preview` |
|
|
117
121
|
| `google/gemini-3-pro-image` |
|
|
118
122
|
| `google/gemini-3-pro-image-preview` |
|
|
@@ -147,7 +151,10 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
147
151
|
| `inclusionai/ling-3.0-flash-fin` |
|
|
148
152
|
| `inclusionai/ling-3.0-flash-fin:free` |
|
|
149
153
|
| `inclusionai/ling-3.0-flash-sante:free` |
|
|
154
|
+
| `inclusionai/ling-3.0-flash-vl` |
|
|
150
155
|
| `inclusionai/ling-3.0-flash-vl:free` |
|
|
156
|
+
| `inference-net/schematron-v2-small` |
|
|
157
|
+
| `inference-net/schematron-v2-turbo` |
|
|
151
158
|
| `kwaipilot/kat-coder-pro-v2` |
|
|
152
159
|
| `kwaipilot/kat-coder-pro-v2.5` |
|
|
153
160
|
| `liquid/lfm-2.5-2.6b:free` |
|
|
@@ -226,7 +233,6 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
226
233
|
| `openai/gpt-3.5-turbo-instruct` |
|
|
227
234
|
| `openai/gpt-4` |
|
|
228
235
|
| `openai/gpt-4-turbo` |
|
|
229
|
-
| `openai/gpt-4-turbo-preview` |
|
|
230
236
|
| `openai/gpt-4.1` |
|
|
231
237
|
| `openai/gpt-4.1-mini` |
|
|
232
238
|
| `openai/gpt-4.1-nano` |
|
|
@@ -350,7 +356,9 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
350
356
|
| `rekaai/reka-flash-3` |
|
|
351
357
|
| `relace/relace-apply-3` |
|
|
352
358
|
| `relace/relace-search` |
|
|
359
|
+
| `sakana/fugu-max` |
|
|
353
360
|
| `sakana/fugu-ultra` |
|
|
361
|
+
| `sakana/fugu-ultra-v2` |
|
|
354
362
|
| `sakana/sakana-namazu` |
|
|
355
363
|
| `sao10k/l3-lunaris-8b` |
|
|
356
364
|
| `sao10k/l3.1-euryale-70b` |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Vercel
|
|
6
6
|
|
|
7
|
-
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
7
|
+
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 376 models through Mastra's model router.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Vercel documentation](https://ai-sdk.dev/providers/ai-sdk-providers).
|
|
10
10
|
|
|
@@ -69,7 +69,6 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
69
69
|
| `alibaba/qwen3.8-2.4t-a95b` |
|
|
70
70
|
| `alibaba/qwen3.8-27b` |
|
|
71
71
|
| `alibaba/qwen3.8-flash` |
|
|
72
|
-
| `alibaba/qwen3.8-flash-next` |
|
|
73
72
|
| `alibaba/qwen3.8-max` |
|
|
74
73
|
| `alibaba/qwen3.8-max-0902` |
|
|
75
74
|
| `alibaba/wan-v2.5-t2v-preview` |
|
|
@@ -117,6 +116,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
117
116
|
| `bfl/flux-pro-1.1-ultra` |
|
|
118
117
|
| `bytedance/seed-1.6` |
|
|
119
118
|
| `bytedance/seed-1.8` |
|
|
119
|
+
| `bytedance/seed-2.1-turbo` |
|
|
120
120
|
| `bytedance/seedance-2.0` |
|
|
121
121
|
| `bytedance/seedance-2.0-fast` |
|
|
122
122
|
| `bytedance/seedance-2.0-mini` |
|
|
@@ -190,6 +190,8 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
190
190
|
| `inclusionai/ling-3.0-flash-fin-free` |
|
|
191
191
|
| `inclusionai/ling-3.0-flash-sante` |
|
|
192
192
|
| `inclusionai/ling-3.0-flash-sante-free` |
|
|
193
|
+
| `inclusionai/ling-3.0-flash-vl` |
|
|
194
|
+
| `inclusionai/ling-3.0-flash-vl-free` |
|
|
193
195
|
| `interfaze/interfaze-beta` |
|
|
194
196
|
| `klingai/kling-v2.5-turbo-i2v` |
|
|
195
197
|
| `klingai/kling-v2.5-turbo-t2v` |
|
|
@@ -349,7 +351,9 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
349
351
|
| `recraft/recraft-v4.1-pro` |
|
|
350
352
|
| `recraft/recraft-v4.1-utility` |
|
|
351
353
|
| `recraft/recraft-v4.1-utility-pro` |
|
|
354
|
+
| `sakana/fugu-max` |
|
|
352
355
|
| `sakana/fugu-ultra` |
|
|
356
|
+
| `sakana/fugu-ultra-v2` |
|
|
353
357
|
| `sakana/namazu` |
|
|
354
358
|
| `spacexai/grok-4.1-fast-non-reasoning` |
|
|
355
359
|
| `spacexai/grok-4.1-fast-reasoning` |
|
package/.docs/models/index.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Model Providers
|
|
6
6
|
|
|
7
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
7
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 7315 models from 204 providers through a single API.
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# 302.AI
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 117 302.AI models through Mastra's model router. Authentication is handled automatically using the `302AI_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [302.AI documentation](https://doc.302.ai).
|
|
10
10
|
|
|
@@ -55,6 +55,7 @@ for await (const chunk of stream) {
|
|
|
55
55
|
| `302ai/claude-sonnet-4-6` | 1.0M | | | | | | $3 | $15 |
|
|
56
56
|
| `302ai/claude-sonnet-4-6-thinking` | 1.0M | | | | | | $3 | $15 |
|
|
57
57
|
| `302ai/claude-sonnet-5` | 1.0M | | | | | | $2 | $10 |
|
|
58
|
+
| `302ai/deepseek-flash` | 1.0M | | | | | | $0.15 | $0.60 |
|
|
58
59
|
| `302ai/deepseek-v3.2` | 128K | | | | | | $0.29 | $0.43 |
|
|
59
60
|
| `302ai/deepseek-v3.2-thinking` | 128K | | | | | | $0.29 | $0.43 |
|
|
60
61
|
| `302ai/doubao-seed-1-6-thinking-250715` | 256K | | | | | | $0.12 | $1 |
|
|
@@ -38,7 +38,7 @@ for await (const chunk of stream) {
|
|
|
38
38
|
|
|
39
39
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
40
40
|
| ------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
41
|
-
| `above/deepseek-v4-flash` | 1.0M | | | | | | $0.
|
|
41
|
+
| `above/deepseek-v4-flash` | 1.0M | | | | | | $0.17 | $0.66 |
|
|
42
42
|
| `above/deepseek-v4-flash-vision-exp` | 1.0M | | | | | | $0.24 | $0.73 |
|
|
43
43
|
| `above/deepseek-v4-pro` | 1.0M | | | | | | $0.73 | $2 |
|
|
44
44
|
| `above/glm-5.2` | 1.0M | | | | | | $2 | $5 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# AgentRouter
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 5 AgentRouter models through Mastra's model router. Authentication is handled automatically using the `AGENTROUTER_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [AgentRouter documentation](https://agentrouter.org/docs/opencode.html).
|
|
10
10
|
|
|
@@ -36,11 +36,13 @@ for await (const chunk of stream) {
|
|
|
36
36
|
|
|
37
37
|
## Models
|
|
38
38
|
|
|
39
|
-
| Model
|
|
40
|
-
|
|
|
41
|
-
| `agentrouter/claude-opus-4-8`
|
|
42
|
-
| `agentrouter/claude-opus-5`
|
|
43
|
-
| `agentrouter/
|
|
39
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
40
|
+
| ------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
41
|
+
| `agentrouter/claude-opus-4-8` | 1.0M | | | | | | — | — |
|
|
42
|
+
| `agentrouter/claude-opus-5` | 1.0M | | | | | | — | — |
|
|
43
|
+
| `agentrouter/deepseek-v4-flash` | 1.0M | | | | | | — | — |
|
|
44
|
+
| `agentrouter/glm-5.3` | 1.0M | | | | | | — | — |
|
|
45
|
+
| `agentrouter/gpt-5.6-sol` | 1.1M | | | | | | — | — |
|
|
44
46
|
|
|
45
47
|
Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
|
|
46
48
|
|
|
@@ -40,8 +40,8 @@ for await (const chunk of stream) {
|
|
|
40
40
|
| ------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
41
41
|
| `aki-io/deepseek-v4-flash-0731-284b` | 1.0M | | | | | | $0.20 | $0.50 |
|
|
42
42
|
| `aki-io/gemma4-26b` | 256K | | | | | | $0.10 | $0.50 |
|
|
43
|
+
| `aki-io/glm5.3-754b` | 524K | | | | | | $1 | $4 |
|
|
43
44
|
| `aki-io/gpt-oss-120b` | 128K | | | | | | $0.15 | $0.55 |
|
|
44
|
-
| `aki-io/kimi-k2.7-code-1100b` | 262K | | | | | | $0.86 | $3 |
|
|
45
45
|
| `aki-io/mistral4-119b` | 262K | | | | | | $0.20 | $0.60 |
|
|
46
46
|
| `aki-io/qwen3.6-35b` | 256K | | | | | | $0.15 | $0.50 |
|
|
47
47
|
| `aki-io/qwen3.8-27b` | 262K | | | | | | $0.30 | $2 |
|