@mastra/mcp-docs-server 1.3.6-alpha.9 → 1.3.6
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/deployment/mastra-server.md +2 -2
- package/.docs/docs/harness/durable-agents.md +45 -9
- package/.docs/docs/harness/signals.md +12 -0
- package/.docs/docs/sandbox/overview.md +1 -0
- package/.docs/docs/server/pubsub.md +2 -0
- package/.docs/docs/subagents.md +1 -0
- package/.docs/docs/workflows/overview.md +2 -0
- package/.docs/integrations/sandboxes/blaxel.md +3 -1
- package/.docs/integrations/sandboxes/e2b.md +32 -1
- package/.docs/integrations/sandboxes/railway.md +13 -0
- package/.docs/integrations/sandboxes/sprites.md +219 -0
- package/.docs/integrations.md +1 -0
- package/.docs/models/environment-variables.md +2 -1
- package/.docs/models/gateways/merge-gateway.md +3 -1
- package/.docs/models/gateways/openrouter.md +1 -12
- package/.docs/models/gateways/vercel.md +2 -1
- package/.docs/models/index.md +3 -2
- package/.docs/models/providers/302ai.md +3 -1
- package/.docs/models/providers/ambient.md +17 -15
- package/.docs/models/providers/coralbricks.md +2 -2
- package/.docs/models/providers/deepinfra.md +2 -2
- package/.docs/models/providers/digitalocean.md +2 -1
- package/.docs/models/providers/edenai.md +305 -300
- package/.docs/models/providers/empiriolabs.md +4 -8
- package/.docs/models/providers/huggingface.md +7 -4
- package/.docs/models/providers/kilo.md +29 -40
- package/.docs/models/providers/llmgateway-providers.md +6 -6
- package/.docs/models/providers/llmgateway.md +3 -7
- package/.docs/models/providers/lowrouter.md +84 -0
- package/.docs/models/providers/moark.md +17 -9
- package/.docs/models/providers/nano-gpt.md +12 -12
- package/.docs/models/providers/nearai.md +22 -3
- package/.docs/models/providers/novita-ai.md +43 -66
- package/.docs/models/providers/ofox.md +2 -1
- package/.docs/models/providers/tinfoil.md +1 -2
- package/.docs/models/providers.md +2 -1
- package/.docs/reference/agents/durable-agent.md +40 -4
- package/.docs/reference/agents/inngest-agent.md +26 -0
- package/.docs/reference/client-js/agent-controller.md +1 -1
- package/.docs/reference/client-js/agents.md +2 -2
- package/.docs/reference/client-js/datasets.md +19 -0
- package/.docs/reference/core/mastra-class.md +12 -4
- package/.docs/reference/pubsub/lease-provider.md +2 -0
- package/.docs/reference/pubsub/valkey-streams.md +1 -1
- package/.docs/reference/server/routes.md +1 -0
- package/.docs/reference/storage/retention.md +21 -18
- package/.docs/reference/tools/mcp-client.md +5 -0
- package/.docs/reference/workspace/platform-sandbox.md +15 -2
- package/package.json +6 -6
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# NEAR AI Cloud
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 51 NEAR AI Cloud models through Mastra's model router. Authentication is handled automatically using the `NEARAI_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [NEAR AI Cloud documentation](https://docs.near.ai/).
|
|
10
10
|
|
|
@@ -38,17 +38,26 @@ for await (const chunk of stream) {
|
|
|
38
38
|
|
|
39
39
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
40
40
|
| ------------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
41
|
+
| `nearai/anthropic/claude-fable-5` | 1.0M | | | | | | $10 | $50 |
|
|
42
|
+
| `nearai/anthropic/claude-fable-5-1` | 1.0M | | | | | | $10 | $50 |
|
|
41
43
|
| `nearai/anthropic/claude-haiku-4-5` | 200K | | | | | | $1 | $5 |
|
|
42
44
|
| `nearai/anthropic/claude-opus-4-6` | 200K | | | | | | $5 | $25 |
|
|
43
45
|
| `nearai/anthropic/claude-opus-4-7` | 1.0M | | | | | | $5 | $25 |
|
|
46
|
+
| `nearai/anthropic/claude-opus-4-8` | 1.0M | | | | | | $5 | $25 |
|
|
47
|
+
| `nearai/anthropic/claude-opus-5` | 1.0M | | | | | | $5 | $25 |
|
|
44
48
|
| `nearai/anthropic/claude-sonnet-4-5` | 200K | | | | | | $3 | $15 |
|
|
45
49
|
| `nearai/anthropic/claude-sonnet-4-6` | 1.0M | | | | | | $3 | $15 |
|
|
50
|
+
| `nearai/anthropic/claude-sonnet-5` | 1.0M | | | | | | $2 | $10 |
|
|
46
51
|
| `nearai/black-forest-labs/FLUX.2-klein-4B` | 128K | | | | | | $1 | $1 |
|
|
52
|
+
| `nearai/deepseek/deepseek-v3.2` | 128K | | | | | | $1 | $1 |
|
|
47
53
|
| `nearai/google/gemini-2.5-flash` | 1.0M | | | | | | $0.30 | $3 |
|
|
48
54
|
| `nearai/google/gemini-2.5-flash-lite` | 1.0M | | | | | | $0.10 | $0.40 |
|
|
49
55
|
| `nearai/google/gemini-2.5-pro` | 1.0M | | | | | | $1 | $10 |
|
|
50
56
|
| `nearai/google/gemini-3.1-flash-lite` | 1.0M | | | | | | $0.25 | $2 |
|
|
51
57
|
| `nearai/google/gemini-3.5-flash` | 1.0M | | | | | | $2 | $9 |
|
|
58
|
+
| `nearai/google/gemini-3.8-flash` | 1.0M | | | | | | $0.75 | $4 |
|
|
59
|
+
| `nearai/moonshotai/kimi-k2.6` | 262K | | | | | | $0.81 | $4 |
|
|
60
|
+
| `nearai/moonshotai/kimi-k3` | 1.0M | | | | | | $3 | $17 |
|
|
52
61
|
| `nearai/openai/gpt-4.1` | 1.0M | | | | | | $2 | $8 |
|
|
53
62
|
| `nearai/openai/gpt-4.1-mini` | 1.0M | | | | | | $0.40 | $2 |
|
|
54
63
|
| `nearai/openai/gpt-4.1-nano` | 1.0M | | | | | | $0.10 | $0.40 |
|
|
@@ -61,6 +70,12 @@ for await (const chunk of stream) {
|
|
|
61
70
|
| `nearai/openai/gpt-5.4-mini` | 400K | | | | | | $0.75 | $5 |
|
|
62
71
|
| `nearai/openai/gpt-5.4-nano` | 400K | | | | | | $0.20 | $1 |
|
|
63
72
|
| `nearai/openai/gpt-5.5` | 1.1M | | | | | | $5 | $30 |
|
|
73
|
+
| `nearai/openai/gpt-5.6-luna` | 1.1M | | | | | | $0.20 | $1 |
|
|
74
|
+
| `nearai/openai/gpt-5.6-sol` | 1.1M | | | | | | $4 | $20 |
|
|
75
|
+
| `nearai/openai/gpt-6-astra` | 1.1M | | | | | | $10 | $50 |
|
|
76
|
+
| `nearai/openai/gpt-6-luna` | 1.1M | | | | | | $0.10 | $0.50 |
|
|
77
|
+
| `nearai/openai/gpt-6-sol` | 1.1M | | | | | | $2 | $10 |
|
|
78
|
+
| `nearai/openai/gpt-6.1-sol` | 1.1M | | | | | | $2 | $10 |
|
|
64
79
|
| `nearai/openai/o3` | 200K | | | | | | $2 | $8 |
|
|
65
80
|
| `nearai/openai/o3-mini` | 200K | | | | | | $1 | $4 |
|
|
66
81
|
| `nearai/openai/o4-mini` | 200K | | | | | | $1 | $4 |
|
|
@@ -68,8 +83,12 @@ for await (const chunk of stream) {
|
|
|
68
83
|
| `nearai/Qwen/Qwen3-Embedding-0.6B` | 33K | | | | | | $0.01 | $0.01 |
|
|
69
84
|
| `nearai/Qwen/Qwen3-Reranker-0.6B` | 41K | | | | | | $0.01 | $0.01 |
|
|
70
85
|
| `nearai/Qwen/Qwen3-VL-30B-A3B-Instruct` | 16K | | | | | | $0.15 | $0.55 |
|
|
86
|
+
| `nearai/qwen/qwen3.5-397b-a17b` | 262K | | | | | | $0.50 | $3 |
|
|
71
87
|
| `nearai/Qwen/Qwen3.6-35B-A3B-FP8` | 262K | | | | | | $0.17 | $1 |
|
|
72
|
-
| `nearai/
|
|
88
|
+
| `nearai/qwen/qwen3.7-max` | 1.0M | | | | | | $3 | $8 |
|
|
89
|
+
| `nearai/Qwen/Qwen3.8-27B` | 262K | | | | | | $0.04 | $1 |
|
|
90
|
+
| `nearai/x-ai/grok-4.6` | 500K | | | | | | $2 | $6 |
|
|
91
|
+
| `nearai/z-ai/glm-5.3-flash` | 1.0M | | | | | | $0.15 | $0.50 |
|
|
73
92
|
|
|
74
93
|
Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
|
|
75
94
|
|
|
@@ -101,7 +120,7 @@ const agent = new Agent({
|
|
|
101
120
|
model: ({ requestContext }) => {
|
|
102
121
|
const useAdvanced = requestContext.task === "complex";
|
|
103
122
|
return useAdvanced
|
|
104
|
-
? "nearai/
|
|
123
|
+
? "nearai/z-ai/glm-5.3-flash"
|
|
105
124
|
: "nearai/Qwen/Qwen3-Embedding-0.6B";
|
|
106
125
|
}
|
|
107
126
|
});
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
4
4
|
|
|
5
|
-
# Novita AI
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 84 Novita AI models through Mastra's model router. Authentication is handled automatically using the `NOVITA_API_KEY` environment variable.
|
|
8
8
|
|
|
9
|
-
Learn more in the [
|
|
9
|
+
Learn more in the [Novita AI documentation](https://novita.ai/docs/guides/introduction).
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
NOVITA_API_KEY=your-api-key
|
|
@@ -19,7 +19,7 @@ const agent = new Agent({
|
|
|
19
19
|
id: "my-agent",
|
|
20
20
|
name: "My Agent",
|
|
21
21
|
instructions: "You are a helpful assistant",
|
|
22
|
-
model: "novita-ai/
|
|
22
|
+
model: "novita-ai/apodex/apodex-1.1-mini"
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
// Generate a response
|
|
@@ -32,61 +32,50 @@ for await (const chunk of stream) {
|
|
|
32
32
|
}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
> **Note:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [
|
|
35
|
+
> **Note:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Novita AI documentation](https://novita.ai/docs/guides/introduction) for details.
|
|
36
36
|
|
|
37
37
|
## Models
|
|
38
38
|
|
|
39
39
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
40
40
|
| ------------------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
41
|
+
| `novita-ai/apodex/apodex-1.1-mini` | 262K | | | | | | — | — |
|
|
42
|
+
| `novita-ai/baai/bge-m3` | 8K | | | | | | $0.01 | — |
|
|
43
|
+
| `novita-ai/baai/bge-reranker-v2-m3` | 8K | | | | | | $0.01 | — |
|
|
41
44
|
| `novita-ai/baichuan/baichuan-m2-32b` | 131K | | | | | | $0.07 | $0.07 |
|
|
45
|
+
| `novita-ai/baidu/cobuddy` | 131K | | | | | | $0.28 | $1 |
|
|
42
46
|
| `novita-ai/baidu/ernie-4.5-21B-a3b` | 120K | | | | | | $0.07 | $0.28 |
|
|
43
|
-
| `novita-ai/
|
|
44
|
-
| `novita-ai/baidu/ernie-4.5-300b-a47b-paddle` | 123K | | | | | | $0.28 | $1 |
|
|
45
|
-
| `novita-ai/baidu/ernie-4.5-vl-28b-a3b` | 30K | | | | | | $0.14 | $0.56 |
|
|
46
|
-
| `novita-ai/baidu/ernie-4.5-vl-28b-a3b-thinking` | 131K | | | | | | $0.39 | $0.39 |
|
|
47
|
-
| `novita-ai/baidu/ernie-4.5-vl-424b-a47b` | 123K | | | | | | $0.42 | $1 |
|
|
48
|
-
| `novita-ai/deepseek/deepseek-ocr` | 8K | | | | | | $0.03 | $0.03 |
|
|
47
|
+
| `novita-ai/deepseek/deepseek_v3` | 64K | | | | | | $0.89 | $0.89 |
|
|
49
48
|
| `novita-ai/deepseek/deepseek-ocr-2` | 8K | | | | | | $0.03 | $0.03 |
|
|
50
|
-
| `novita-ai/deepseek/deepseek-prover-v2-671b` | 160K | | | | | | $0.70 | $3 |
|
|
51
49
|
| `novita-ai/deepseek/deepseek-r1-0528` | 164K | | | | | | $0.70 | $3 |
|
|
52
50
|
| `novita-ai/deepseek/deepseek-r1-0528-qwen3-8b` | 128K | | | | | | $0.06 | $0.09 |
|
|
53
|
-
| `novita-ai/deepseek/deepseek-r1-distill-llama-70b` | 8K | | | | | | $0.80 | $0.80 |
|
|
54
|
-
| `novita-ai/deepseek/deepseek-r1-distill-qwen-14b` | 33K | | | | | | $0.15 | $0.15 |
|
|
55
|
-
| `novita-ai/deepseek/deepseek-r1-distill-qwen-32b` | 64K | | | | | | $0.30 | $0.30 |
|
|
56
51
|
| `novita-ai/deepseek/deepseek-r1-turbo` | 64K | | | | | | $0.70 | $3 |
|
|
57
|
-
| `novita-ai/deepseek/deepseek-
|
|
58
|
-
| `novita-ai/deepseek/deepseek-v3-turbo` | 64K | | | | | | $0.40 | $1 |
|
|
59
|
-
| `novita-ai/deepseek/deepseek-v3.1` | 131K | | | | | | $0.27 | $1 |
|
|
60
|
-
| `novita-ai/deepseek/deepseek-v3.1-terminus` | 131K | | | | | | $0.27 | $1 |
|
|
61
|
-
| `novita-ai/deepseek/deepseek-v3.2` | 164K | | | | | | $0.27 | $0.40 |
|
|
62
|
-
| `novita-ai/deepseek/deepseek-v3.2-exp` | 164K | | | | | | $0.27 | $0.41 |
|
|
63
|
-
| `novita-ai/deepseek/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
52
|
+
| `novita-ai/deepseek/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.44 | $1 |
|
|
64
53
|
| `novita-ai/deepseek/deepseek-v4-pro` | 1.0M | | | | | | $2 | $3 |
|
|
54
|
+
| `novita-ai/deepseek/deepseek-v4-pro-0813` | 1.0M | | | | | | $1 | $4 |
|
|
55
|
+
| `novita-ai/deepseek/deepseek-v4.1-flash` | 1.0M | | | | | | $0.30 | $1 |
|
|
65
56
|
| `novita-ai/google/gemma-3-12b-it` | 131K | | | | | | $0.05 | $0.10 |
|
|
66
57
|
| `novita-ai/google/gemma-3-27b-it` | 98K | | | | | | $0.12 | $0.20 |
|
|
67
58
|
| `novita-ai/google/gemma-4-26b-a4b-it` | 262K | | | | | | $0.13 | $0.40 |
|
|
68
59
|
| `novita-ai/google/gemma-4-31b-it` | 262K | | | | | | $0.14 | $0.40 |
|
|
69
60
|
| `novita-ai/gryphe/mythomax-l2-13b` | 4K | | | | | | $0.09 | $0.09 |
|
|
70
|
-
| `novita-ai/inclusionai/ling-
|
|
71
|
-
| `novita-ai/inclusionai/ling-
|
|
72
|
-
| `novita-ai/inclusionai/
|
|
73
|
-
| `novita-ai/
|
|
74
|
-
| `novita-ai/
|
|
75
|
-
| `novita-ai/meta-llama/llama-3-8b-instruct` | 8K | | | | | | $0.04 | $0.04 |
|
|
61
|
+
| `novita-ai/inclusionai/ling-3.0-flash` | 262K | | | | | | $0.06 | $0.18 |
|
|
62
|
+
| `novita-ai/inclusionai/ling-3.0-flash-fin` | 262K | | | | | | $0.07 | $0.22 |
|
|
63
|
+
| `novita-ai/inclusionai/ling-3.0-flash-sante` | 262K | | | | | | $0.07 | $0.22 |
|
|
64
|
+
| `novita-ai/inclusionai/ling-3.0-flash-vl` | 262K | | | | | | $0.07 | $0.22 |
|
|
65
|
+
| `novita-ai/inclusionai/ling-3.1-flash` | 262K | | | | | | — | — |
|
|
76
66
|
| `novita-ai/meta-llama/llama-3.1-8b-instruct` | 16K | | | | | | $0.02 | $0.05 |
|
|
77
|
-
| `novita-ai/meta-llama/llama-3.2-
|
|
78
|
-
| `novita-ai/meta-llama/llama-3.3-70b-instruct` |
|
|
67
|
+
| `novita-ai/meta-llama/llama-3.2-1b-instruct` | 131K | | | | | | $0.02 | $0.02 |
|
|
68
|
+
| `novita-ai/meta-llama/llama-3.3-70b-instruct` | 12K | | | | | | $0.14 | $0.40 |
|
|
79
69
|
| `novita-ai/meta-llama/llama-4-maverick-17b-128e-instruct-fp8` | 1.0M | | | | | | $0.27 | $0.85 |
|
|
80
70
|
| `novita-ai/meta-llama/llama-4-scout-17b-16e-instruct` | 131K | | | | | | $0.18 | $0.59 |
|
|
81
71
|
| `novita-ai/microsoft/wizardlm-2-8x22b` | 66K | | | | | | $0.62 | $0.62 |
|
|
82
|
-
| `novita-ai/
|
|
83
|
-
| `novita-ai/
|
|
72
|
+
| `novita-ai/mindai/macaron-v1-tall` | 262K | | | | | | $0.25 | $1 |
|
|
73
|
+
| `novita-ai/mindai/macaron-v1-venti` | 1.0M | | | | | | $0.82 | $2 |
|
|
84
74
|
| `novita-ai/minimax/minimax-m2.5` | 205K | | | | | | $0.30 | $1 |
|
|
85
|
-
| `novita-ai/minimax/minimax-m2.5-highspeed` | 205K | | | | | | $0.60 | $2 |
|
|
86
75
|
| `novita-ai/minimax/minimax-m2.7` | 205K | | | | | | $0.30 | $1 |
|
|
87
76
|
| `novita-ai/minimax/minimax-m2.7-highspeed` | 205K | | | | | | $0.60 | $2 |
|
|
77
|
+
| `novita-ai/minimax/minimax-m3` | 1.0M | | | | | | $0.30 | $1 |
|
|
88
78
|
| `novita-ai/minimaxai/minimax-m1-80k` | 1.0M | | | | | | $0.55 | $2 |
|
|
89
|
-
| `novita-ai/mistralai/mistral-nemo` | 60K | | | | | | $0.04 | $0.17 |
|
|
90
79
|
| `novita-ai/moonshotai/kimi-k2-0905` | 262K | | | | | | $0.60 | $3 |
|
|
91
80
|
| `novita-ai/moonshotai/kimi-k2-instruct` | 131K | | | | | | $0.57 | $2 |
|
|
92
81
|
| `novita-ai/moonshotai/kimi-k2-thinking` | 262K | | | | | | $0.60 | $3 |
|
|
@@ -95,47 +84,33 @@ for await (const chunk of stream) {
|
|
|
95
84
|
| `novita-ai/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.95 | $4 |
|
|
96
85
|
| `novita-ai/moonshotai/kimi-k3` | 1.0M | | | | | | $3 | $15 |
|
|
97
86
|
| `novita-ai/nousresearch/hermes-2-pro-llama-3-8b` | 8K | | | | | | $0.14 | $0.14 |
|
|
87
|
+
| `novita-ai/nvidia/nemotron-3-nano-30b-a3b` | 262K | | | | | | $0.05 | $0.20 |
|
|
98
88
|
| `novita-ai/openai/gpt-oss-120b` | 131K | | | | | | $0.05 | $0.25 |
|
|
99
|
-
| `novita-ai/openai/gpt-oss-20b` | 131K | | | | | | $0.04 | $0.15 |
|
|
100
89
|
| `novita-ai/paddlepaddle/paddleocr-vl` | 16K | | | | | | $0.02 | $0.02 |
|
|
101
|
-
| `novita-ai/qwen/qwen-2.5-72b-instruct` | 32K | | | | | | $0.38 | $0.40 |
|
|
102
90
|
| `novita-ai/qwen/qwen-mt-plus` | 16K | | | | | | $0.25 | $0.75 |
|
|
103
|
-
| `novita-ai/qwen/
|
|
104
|
-
| `novita-ai/qwen/qwen2.5-vl-72b-instruct` | 33K | | | | | | $0.80 | $0.80 |
|
|
105
|
-
| `novita-ai/qwen/qwen3-235b-a22b-fp8` | 41K | | | | | | $0.20 | $0.80 |
|
|
106
|
-
| `novita-ai/qwen/qwen3-235b-a22b-instruct-2507` | 131K | | | | | | $0.09 | $0.58 |
|
|
107
|
-
| `novita-ai/qwen/qwen3-235b-a22b-thinking-2507` | 131K | | | | | | $0.30 | $3 |
|
|
108
|
-
| `novita-ai/qwen/qwen3-30b-a3b-fp8` | 41K | | | | | | $0.09 | $0.45 |
|
|
109
|
-
| `novita-ai/qwen/qwen3-32b-fp8` | 41K | | | | | | $0.10 | $0.45 |
|
|
110
|
-
| `novita-ai/qwen/qwen3-4b-fp8` | 128K | | | | | | $0.03 | $0.03 |
|
|
111
|
-
| `novita-ai/qwen/qwen3-8b-fp8` | 128K | | | | | | $0.04 | $0.14 |
|
|
112
|
-
| `novita-ai/qwen/qwen3-coder-30b-a3b-instruct` | 160K | | | | | | $0.07 | $0.27 |
|
|
113
|
-
| `novita-ai/qwen/qwen3-coder-480b-a35b-instruct` | 262K | | | | | | $0.38 | $2 |
|
|
114
|
-
| `novita-ai/qwen/qwen3-coder-next` | 262K | | | | | | $0.20 | $2 |
|
|
115
|
-
| `novita-ai/qwen/qwen3-max` | 262K | | | | | | $2 | $8 |
|
|
116
|
-
| `novita-ai/qwen/qwen3-next-80b-a3b-instruct` | 131K | | | | | | $0.15 | $2 |
|
|
117
|
-
| `novita-ai/qwen/qwen3-next-80b-a3b-thinking` | 131K | | | | | | $0.15 | $2 |
|
|
118
|
-
| `novita-ai/qwen/qwen3-omni-30b-a3b-instruct` | 66K | | | | | | $0.25 | $0.97 |
|
|
91
|
+
| `novita-ai/qwen/qwen3-embedding-8b` | 33K | | | | | | $0.07 | — |
|
|
119
92
|
| `novita-ai/qwen/qwen3-omni-30b-a3b-thinking` | 66K | | | | | | $0.25 | $0.97 |
|
|
120
|
-
| `novita-ai/qwen/qwen3-
|
|
121
|
-
| `novita-ai/qwen/qwen3-vl-235b-a22b-thinking` | 131K | | | | | | $0.98 | $4 |
|
|
93
|
+
| `novita-ai/qwen/qwen3-reranker-8b` | 33K | | | | | | $0.05 | — |
|
|
122
94
|
| `novita-ai/qwen/qwen3-vl-30b-a3b-instruct` | 131K | | | | | | $0.20 | $0.70 |
|
|
123
|
-
| `novita-ai/qwen/qwen3-vl-30b-a3b-thinking` | 131K | | | | | | $0.20 | $1 |
|
|
124
|
-
| `novita-ai/qwen/qwen3-vl-8b-instruct` | 131K | | | | | | $0.08 | $0.50 |
|
|
125
95
|
| `novita-ai/qwen/qwen3.5-122b-a10b` | 262K | | | | | | $0.40 | $3 |
|
|
126
96
|
| `novita-ai/qwen/qwen3.5-27b` | 262K | | | | | | $0.30 | $2 |
|
|
127
97
|
| `novita-ai/qwen/qwen3.5-35b-a3b` | 262K | | | | | | $0.25 | $2 |
|
|
128
98
|
| `novita-ai/qwen/qwen3.5-397b-a17b` | 262K | | | | | | $0.60 | $4 |
|
|
99
|
+
| `novita-ai/qwen/qwen3.6-27b` | 262K | | | | | | $0.60 | $4 |
|
|
100
|
+
| `novita-ai/qwen/qwen3.6-35b-a3b` | 262K | | | | | | $0.25 | $1 |
|
|
129
101
|
| `novita-ai/qwen/qwen3.7-max` | 1.0M | | | | | | $1 | $4 |
|
|
130
|
-
| `novita-ai/
|
|
131
|
-
| `novita-ai/
|
|
132
|
-
| `novita-ai/
|
|
133
|
-
| `novita-ai/
|
|
134
|
-
| `novita-ai/
|
|
135
|
-
| `novita-ai/
|
|
102
|
+
| `novita-ai/qwen/qwen3.8-2.4t-a95b` | 1.0M | | | | | | $2 | $6 |
|
|
103
|
+
| `novita-ai/qwen/qwen3.8-27b` | 1.0M | | | | | | $0.42 | $3 |
|
|
104
|
+
| `novita-ai/qwen/qwen3.8-flash` | 1.0M | | | | | | $0.15 | $0.47 |
|
|
105
|
+
| `novita-ai/qwen/qwen3.8-max` | 1.0M | | | | | | $2 | $6 |
|
|
106
|
+
| `novita-ai/stepfun/step-3.7-flash` | 262K | | | | | | $0.20 | $1 |
|
|
107
|
+
| `novita-ai/tencent/hy3` | 262K | | | | | | $0.14 | $0.58 |
|
|
108
|
+
| `novita-ai/tencent/hy4-preview` | 1.0M | | | | | | $0.83 | $3 |
|
|
109
|
+
| `novita-ai/xiaomimimo/mimo-v2.5` | 1.0M | | | | | | $0.17 | $0.34 |
|
|
136
110
|
| `novita-ai/xiaomimimo/mimo-v2.5-pro` | 1.0M | | | | | | $0.52 | $1 |
|
|
111
|
+
| `novita-ai/xiaomimimo/mimo-v2.6-flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
112
|
+
| `novita-ai/xiaomimimo/mimo-v2.6-pro` | 1.0M | | | | | | $0.43 | $0.87 |
|
|
137
113
|
| `novita-ai/zai-org/autoglm-phone-9b-multilingual` | 66K | | | | | | $0.04 | $0.14 |
|
|
138
|
-
| `novita-ai/zai-org/glm-4.5` | 131K | | | | | | $0.60 | $2 |
|
|
139
114
|
| `novita-ai/zai-org/glm-4.5-air` | 131K | | | | | | $0.13 | $0.85 |
|
|
140
115
|
| `novita-ai/zai-org/glm-4.5v` | 66K | | | | | | $0.60 | $2 |
|
|
141
116
|
| `novita-ai/zai-org/glm-4.6` | 205K | | | | | | $0.55 | $2 |
|
|
@@ -145,6 +120,8 @@ for await (const chunk of stream) {
|
|
|
145
120
|
| `novita-ai/zai-org/glm-5` | 203K | | | | | | $1 | $3 |
|
|
146
121
|
| `novita-ai/zai-org/glm-5.1` | 205K | | | | | | $1 | $4 |
|
|
147
122
|
| `novita-ai/zai-org/glm-5.2` | 1.0M | | | | | | $1 | $4 |
|
|
123
|
+
| `novita-ai/zai-org/glm-5.3` | 1.0M | | | | | | $1 | $4 |
|
|
124
|
+
| `novita-ai/zai-org/glm-5.3-flash` | 1.0M | | | | | | $0.15 | $0.50 |
|
|
148
125
|
|
|
149
126
|
Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
|
|
150
127
|
|
|
@@ -158,7 +135,7 @@ const agent = new Agent({
|
|
|
158
135
|
name: "custom-agent",
|
|
159
136
|
model: {
|
|
160
137
|
url: "https://api.novita.ai/openai",
|
|
161
|
-
id: "novita-ai/
|
|
138
|
+
id: "novita-ai/apodex/apodex-1.1-mini",
|
|
162
139
|
apiKey: process.env.NOVITA_API_KEY,
|
|
163
140
|
headers: {
|
|
164
141
|
"X-Custom-Header": "value"
|
|
@@ -176,8 +153,8 @@ const agent = new Agent({
|
|
|
176
153
|
model: ({ requestContext }) => {
|
|
177
154
|
const useAdvanced = requestContext.task === "complex";
|
|
178
155
|
return useAdvanced
|
|
179
|
-
? "novita-ai/zai-org/glm-5.
|
|
180
|
-
: "novita-ai/
|
|
156
|
+
? "novita-ai/zai-org/glm-5.3-flash"
|
|
157
|
+
: "novita-ai/apodex/apodex-1.1-mini";
|
|
181
158
|
}
|
|
182
159
|
});
|
|
183
160
|
```
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Ofox
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 152 Ofox models through Mastra's model router. Authentication is handled automatically using the `OFOX_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Ofox documentation](https://ofox.ai/docs).
|
|
10
10
|
|
|
@@ -41,6 +41,7 @@ for await (const chunk of stream) {
|
|
|
41
41
|
| `ofox/anthropic/claude-fable-5` | 1.0M | | | | | | $10 | $50 |
|
|
42
42
|
| `ofox/anthropic/claude-fable-5.1` | 1.0M | | | | | | $10 | $50 |
|
|
43
43
|
| `ofox/anthropic/claude-haiku-4.5` | 200K | | | | | | $1 | $5 |
|
|
44
|
+
| `ofox/anthropic/claude-haiku-5.5` | 1.0M | | | | | | $0.10 | $0.50 |
|
|
44
45
|
| `ofox/anthropic/claude-opus-4.5` | 200K | | | | | | $5 | $25 |
|
|
45
46
|
| `ofox/anthropic/claude-opus-4.6` | 1.0M | | | | | | $5 | $25 |
|
|
46
47
|
| `ofox/anthropic/claude-opus-4.7` | 1.0M | | | | | | $5 | $25 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Tinfoil
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 8 Tinfoil models through Mastra's model router. Authentication is handled automatically using the `TINFOIL_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Tinfoil documentation](https://docs.tinfoil.sh).
|
|
10
10
|
|
|
@@ -41,7 +41,6 @@ for await (const chunk of stream) {
|
|
|
41
41
|
| `tinfoil/deepseek-v4-1-flash` | 1.0M | | | | | | $0.65 | $1 |
|
|
42
42
|
| `tinfoil/gemma4-31b` | 262K | | | | | | $0.40 | $1 |
|
|
43
43
|
| `tinfoil/glm-5-3` | 1.0M | | | | | | $2 | $6 |
|
|
44
|
-
| `tinfoil/glm-5-3-flash` | 1.0M | | | | | | $0.40 | $1 |
|
|
45
44
|
| `tinfoil/gpt-oss-120b` | 131K | | | | | | $0.15 | $0.60 |
|
|
46
45
|
| `tinfoil/gpt-oss-safeguard-120b` | 131K | | | | | | $0.15 | $0.60 |
|
|
47
46
|
| `tinfoil/kimi-k3` | 262K | | | | | | $4 | $20 |
|
|
@@ -108,6 +108,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
108
108
|
- [LLMTR](https://mastra.ai/models/providers/llmtr)
|
|
109
109
|
- [LMStudio](https://mastra.ai/models/providers/lmstudio)
|
|
110
110
|
- [LongCat](https://mastra.ai/models/providers/longcat)
|
|
111
|
+
- [LowRouter](https://mastra.ai/models/providers/lowrouter)
|
|
111
112
|
- [LucidQuery](https://mastra.ai/models/providers/lucidquery)
|
|
112
113
|
- [Lynkr](https://mastra.ai/models/providers/lynkr)
|
|
113
114
|
- [Meganova](https://mastra.ai/models/providers/meganova)
|
|
@@ -133,7 +134,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
133
134
|
- [NeoSmith](https://mastra.ai/models/providers/neosmith)
|
|
134
135
|
- [Neuralwatt](https://mastra.ai/models/providers/neuralwatt)
|
|
135
136
|
- [Nova](https://mastra.ai/models/providers/nova)
|
|
136
|
-
- [
|
|
137
|
+
- [Novita AI](https://mastra.ai/models/providers/novita-ai)
|
|
137
138
|
- [Nvidia](https://mastra.ai/models/providers/nvidia)
|
|
138
139
|
- [OCI Generative AI](https://mastra.ai/models/providers/oci)
|
|
139
140
|
- [Ofox](https://mastra.ai/models/providers/ofox)
|
|
@@ -164,7 +164,7 @@ Returns: [`Promise<DurableAgentStreamResult>`](#durableagentstreamresult)
|
|
|
164
164
|
|
|
165
165
|
#### `resume(runId, resumeData, options?)`
|
|
166
166
|
|
|
167
|
-
Resumes a suspended run, for example after a tool approval. Pass the `runId` from the original stream and the data the run was waiting on. Throws if no registry entry exists for the run.
|
|
167
|
+
Resumes a suspended run, for example after a tool approval. Pass the `runId` from the original stream and the data the run was waiting on. Throws if no registry entry exists for the run. If another execution holds the run, `resume()` waits up to 5 seconds for it to finish, then throws `DURABLE_AGENT_EXECUTION_CONFLICT`. See [run ownership](https://mastra.ai/docs/harness/durable-agents).
|
|
168
168
|
|
|
169
169
|
```typescript
|
|
170
170
|
const { output, cleanup } = await durableAgent.resume(runId, {
|
|
@@ -324,11 +324,18 @@ interface DurableAgentListActiveRunsResult {
|
|
|
324
324
|
|
|
325
325
|
#### `recoverActiveRuns(options?)`
|
|
326
326
|
|
|
327
|
-
Discovers runs stuck in `running` status for this agent and re-drives them from the last persisted snapshot. Accepts the same filters and pagination as `listActiveRuns()`, plus `runId`. Returns
|
|
327
|
+
Discovers runs stuck in `running` status for this agent and re-drives them from the last persisted snapshot. Accepts the same filters and pagination as `listActiveRuns()`, plus `runId`. Returns the outcome for each run.
|
|
328
328
|
|
|
329
329
|
```typescript
|
|
330
330
|
const result = await durableAgent.recoverActiveRuns()
|
|
331
|
-
// {
|
|
331
|
+
// {
|
|
332
|
+
// recovered: [
|
|
333
|
+
// { runId: 'run-1', status: 'success' },
|
|
334
|
+
// { runId: 'run-2', status: 'skipped', reason: 'run-active', retryAt: 1760123456789 },
|
|
335
|
+
// ],
|
|
336
|
+
// succeeded: 1,
|
|
337
|
+
// failed: 0,
|
|
338
|
+
// }
|
|
332
339
|
```
|
|
333
340
|
|
|
334
341
|
Pass a `runId` to recover a single known run:
|
|
@@ -337,11 +344,26 @@ Pass a `runId` to recover a single known run:
|
|
|
337
344
|
await durableAgent.recoverActiveRuns({ runId: 'run-abc-123' })
|
|
338
345
|
```
|
|
339
346
|
|
|
347
|
+
A run that another execution still drives isn't taken over. Its entry has `status: 'skipped'` and a `reason`, and `recoverActiveRuns()` doesn't check it again. For a run held by another process, `retryAt` is the time after which that claim lapses unless renewed. Call `recoverActiveRuns({ runId })` after it to recover the run if its process crashed. [`mastra.recoverAllDurableAgents()`](https://mastra.ai/reference/core/mastra-class) schedules these re-checks itself.
|
|
348
|
+
|
|
349
|
+
| `reason` | Meaning |
|
|
350
|
+
| --------------------- | ------------------------------------------------------------------------------ |
|
|
351
|
+
| `run-active` | Another execution, possibly in another process, holds the run. Sets `retryAt`. |
|
|
352
|
+
| `run-active-locally` | This process is executing the run. |
|
|
353
|
+
| `already-in-progress` | This process is already recovering the run. |
|
|
354
|
+
|
|
340
355
|
Returns:
|
|
341
356
|
|
|
342
357
|
```typescript
|
|
343
358
|
interface DurableAgentRecoverActiveRunsResult {
|
|
344
|
-
recovered: Array<{
|
|
359
|
+
recovered: Array<{
|
|
360
|
+
runId: string
|
|
361
|
+
status: 'success' | 'failed' | 'skipped'
|
|
362
|
+
error?: Error
|
|
363
|
+
reason?: 'run-active' | 'run-active-locally' | 'already-in-progress'
|
|
364
|
+
// Epoch milliseconds
|
|
365
|
+
retryAt?: number
|
|
366
|
+
}>
|
|
345
367
|
succeeded: number
|
|
346
368
|
failed: number
|
|
347
369
|
}
|
|
@@ -363,6 +385,20 @@ await output.text
|
|
|
363
385
|
cleanup()
|
|
364
386
|
```
|
|
365
387
|
|
|
388
|
+
`recover()` throws instead of recovering a run that isn't orphaned:
|
|
389
|
+
|
|
390
|
+
| Error ID | Thrown when |
|
|
391
|
+
| ------------------------------------------- | -------------------------------------------------------------------- |
|
|
392
|
+
| `DURABLE_AGENT_RUN_ACTIVE` | Another execution holds the run, and `force` isn't set. |
|
|
393
|
+
| `DURABLE_AGENT_RECOVER_RUN_ACTIVE_LOCALLY` | This process is executing the run. `force` doesn't override this. |
|
|
394
|
+
| `DURABLE_AGENT_RECOVER_ALREADY_IN_PROGRESS` | This process is already recovering the run. |
|
|
395
|
+
| `DURABLE_AGENT_RECOVER_RUN_SUSPENDED` | The run is suspended. Continue it with `resume()`. |
|
|
396
|
+
| `DURABLE_AGENT_EXECUTION_CONFLICT` | With `force`, another execution claimed the run during the takeover. |
|
|
397
|
+
|
|
398
|
+
The server's `POST /agents/:agentId/recover` route returns these errors as `409 Conflict`.
|
|
399
|
+
|
|
400
|
+
**options.force** (`boolean`): Take the run over even while another execution holds it. That execution loses the run and stops, and streams for the run drop the events it still publishes. Its writes are rejected when the storage adapter supports run fencing. (Default: `false`)
|
|
401
|
+
|
|
366
402
|
Returns: [`Promise<DurableAgentStreamResult>`](#durableagentstreamresult)
|
|
367
403
|
|
|
368
404
|
## Stream options
|
|
@@ -324,6 +324,32 @@ interface InngestAgentStreamResult<OUTPUT = undefined> {
|
|
|
324
324
|
|
|
325
325
|
**cleanup** (`() => void`): Unsubscribes from PubSub and clears registry entries for the run. Call it when done with the run.
|
|
326
326
|
|
|
327
|
+
## Event size limit
|
|
328
|
+
|
|
329
|
+
Inngest Realtime caps each message at about 512 KB. The default `InngestPubSub` keeps every stream event under 480 KB:
|
|
330
|
+
|
|
331
|
+
- An oversized `finish` event is sent without `output.steps`. The final text, usage, and finish reason still arrive, but `steps`, `toolCalls`, and `toolResults` on the stream result are empty for that run.
|
|
332
|
+
- Any other oversized event, such as a `tool-result` chunk carrying a large tool result, is replaced with a `data-oversized-event` chunk. Its `data` holds the original `eventType`, `chunkType`, `bytes`, and `limit`. The chunk is transient, so it isn't saved to memory.
|
|
333
|
+
|
|
334
|
+
Both cases log a warning. Only the live stream is reduced: messages saved to memory and the run's workflow snapshot keep the full data.
|
|
335
|
+
|
|
336
|
+
To avoid the limit:
|
|
337
|
+
|
|
338
|
+
- Return small tool results, such as an ID or summary, and fetch large data separately.
|
|
339
|
+
- Read full results from memory or the workflow run after the stream finishes.
|
|
340
|
+
- Pass a `pubsub` without the limit, such as [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams):
|
|
341
|
+
|
|
342
|
+
```typescript
|
|
343
|
+
import { createInngestAgent } from '@mastra/inngest'
|
|
344
|
+
import { RedisStreamsPubSub } from '@mastra/redis-streams'
|
|
345
|
+
|
|
346
|
+
const durableAgent = createInngestAgent({
|
|
347
|
+
agent,
|
|
348
|
+
inngest,
|
|
349
|
+
pubsub: new RedisStreamsPubSub({ url: 'redis://localhost:6379' }),
|
|
350
|
+
})
|
|
351
|
+
```
|
|
352
|
+
|
|
327
353
|
## Serving Inngest functions
|
|
328
354
|
|
|
329
355
|
The `@mastra/inngest` package provides `serve()` and `createServe()` to register Inngest workflow functions with your HTTP framework.
|
|
@@ -109,7 +109,7 @@ Subscribes to the session's event stream over SSE. The promise resolves once the
|
|
|
109
109
|
|
|
110
110
|
**onReconnect** (`() => void`): Called each time the stream is re-established after a drop. The server does not replay events missed while disconnected, so re-sync from here with session.state() and, for the message gap, session.listMessages().
|
|
111
111
|
|
|
112
|
-
**reconnect** (`boolean | { maxRetries?: number; delayMs?: number; maxDelayMs?: number }`): Re-establishes the stream after an established stream drops. Retries back off exponentially from delayMs (default 1000) up to maxDelayMs (default 30000). maxRetries (default Infinity) bounds the attempts per outage and resets once a connection is re-established. When retries are exhausted, onError fires.
|
|
112
|
+
**reconnect** (`boolean | { maxRetries?: number; delayMs?: number; maxDelayMs?: number }`): Re-establishes the stream after an established stream drops. Retries back off exponentially from delayMs (default 1000) up to maxDelayMs (default 30000). maxRetries (default Infinity) bounds the attempts per outage and resets once a connection is re-established. When retries are exhausted, onError fires. A reconnect request that fails with a 4xx (other than 408 and 429) or 501 stops reconnecting immediately and passes that MastraClientError to onError.
|
|
113
113
|
|
|
114
114
|
Returns: `Promise<AgentControllerSubscription>`, an object with an `unsubscribe()` method that stops reading and releases the stream.
|
|
115
115
|
|
|
@@ -304,13 +304,13 @@ await subscription.processDataStream({
|
|
|
304
304
|
|
|
305
305
|
Pass `withInitialHistory: true` (or `{ perPage }`) to receive the stored messages as a first `thread-history` chunk instead of fetching history separately. Finished runs aren't replayed after it, so completed answers don't stream again on reconnect.
|
|
306
306
|
|
|
307
|
-
`subscribeToThread()` returns the underlying `Response` plus a `processDataStream()` helper. The helper reads the subscription stream until the connection closes or the request is aborted. Pass `reconnect: true` to resubscribe when the transport closes or a reconnect request fails, such as after a proxy idle timeout.
|
|
307
|
+
`subscribeToThread()` returns the underlying `Response` plus a `processDataStream()` helper. The helper reads the subscription stream until the connection closes or the request is aborted. Pass `reconnect: true` to resubscribe when the transport closes or a reconnect request fails, such as after a proxy idle timeout. If a reconnect request fails with a 4xx status (for example `401` or `403`) or `501`, `processDataStream()` stops reconnecting and rejects with the original `MastraClientError`. `408` and `429` are still retried.
|
|
308
308
|
|
|
309
309
|
**resourceId** (`string`): Resource ID for the memory thread.
|
|
310
310
|
|
|
311
311
|
**threadId** (`string`): Thread ID to subscribe to.
|
|
312
312
|
|
|
313
|
-
**processDataStream().reconnect** (`boolean | { maxRetries?: number; delayMs?: number }`): Reconnects the subscription stream after it closes or a reconnect request fails. true retries indefinitely with a one-second delay.
|
|
313
|
+
**processDataStream().reconnect** (`boolean | { maxRetries?: number; delayMs?: number }`): Reconnects the subscription stream after it closes or a reconnect request fails. true retries indefinitely with a one-second delay. A 4xx (other than 408 and 429) or 501 response stops reconnecting and rejects with that error.
|
|
314
314
|
|
|
315
315
|
The subscription also exposes `abort(options?)` and `unsubscribe()`. `await subscription.abort({ clearPendingSignals: true })` requests an abort and clears pending signals without closing the subscription. Omit the flag to preserve pending input. `unsubscribe()` closes the subscription without aborting the run.
|
|
316
316
|
|
|
@@ -159,6 +159,25 @@ await client.deleteDatasetExperiment('dataset-id', 'experiment-id', {
|
|
|
159
159
|
|
|
160
160
|
Returns `Promise<{ success: boolean }>`. A missing experiment, an experiment associated with another dataset, or a dataset outside the supplied tenancy returns a `404` response.
|
|
161
161
|
|
|
162
|
+
## getExperiment()
|
|
163
|
+
|
|
164
|
+
Gets an experiment by ID without requiring a dataset reference. The response includes the experiment's `datasetId`, which is `null` for experiments orphaned by dataset deletion.
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
const experiment = await client.getExperiment('experiment-id', {
|
|
168
|
+
organizationId: 'organization-id',
|
|
169
|
+
projectId: 'project-id',
|
|
170
|
+
})
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**experimentId** (`string`): ID of the experiment to get.
|
|
174
|
+
|
|
175
|
+
**options.organizationId** (`string`): Organization ID used to scope the lookup.
|
|
176
|
+
|
|
177
|
+
**options.projectId** (`string`): Project ID used to scope the lookup.
|
|
178
|
+
|
|
179
|
+
Returns the experiment. A missing experiment, or one outside the supplied tenancy, returns a `404` response.
|
|
180
|
+
|
|
162
181
|
## deleteExperiment()
|
|
163
182
|
|
|
164
183
|
Deletes an experiment by ID without requiring a dataset reference. Use this method for experiments orphaned by dataset deletion. The server deletes the experiment's observability traces and then deletes the experiment and its result records. Unsupported storage leaves the traces in place, and the server logs a warning. If trace deletion fails for any other reason, the promise rejects and Mastra keeps the experiment and its result records, although some traces may already have been removed.
|
|
@@ -131,10 +131,14 @@ Visit the [Configuration reference](https://mastra.ai/reference/configuration) f
|
|
|
131
131
|
|
|
132
132
|
**scheduler.enabled** (`boolean`): Explicitly enable or disable the scheduler.
|
|
133
133
|
|
|
134
|
-
**recovery** (`MastraRecoveryConfig`): Boot-time recovery behavior for orphaned agent and workflow runs. See Crash recovery. (Default: `{ durableAgents: 'off' }`)
|
|
134
|
+
**recovery** (`MastraRecoveryConfig`): Boot-time recovery behavior for orphaned agent and workflow runs. See Crash recovery. (Default: `{ durableAgents: 'off', workflows: 'auto', workflowConcurrency: 5 }`)
|
|
135
135
|
|
|
136
136
|
**recovery.durableAgents** (`'auto' | 'off'`): Set to 'auto' to automatically re-drive orphaned RUNNING durable agent runs on server boot. This also controls the default snapshot-persistence policy for durable agents: running checkpoints are only written when set to 'auto' (or when an agent sets a custom shouldPersistSnapshot that includes running). Recovery re-issues LLM calls and re-executes tool calls, so tools must be idempotent. See Crash recovery.
|
|
137
137
|
|
|
138
|
+
**recovery.workflows** (`'auto' | 'off'`): Set to 'off' to skip restarting active workflow runs on server boot. Individual workflows can also opt out with autoRestartActiveRuns: false.
|
|
139
|
+
|
|
140
|
+
**recovery.workflowConcurrency** (`number`): Maximum number of workflow runs restarted at the same time during boot recovery. Use Infinity for no limit. Workflow and durable agent recovery run in parallel.
|
|
141
|
+
|
|
138
142
|
## Methods
|
|
139
143
|
|
|
140
144
|
### `recoverAllDurableAgents()`
|
|
@@ -143,17 +147,21 @@ Re-drives every orphaned `running` durable-agent run across all registered durab
|
|
|
143
147
|
|
|
144
148
|
Requires persistent storage. With an in-memory store, there's nothing to recover after a process restart.
|
|
145
149
|
|
|
150
|
+
A run that another execution still drives isn't taken over. It's counted in `skipped` and checked again once that execution's claim could have lapsed, so a run whose process crashed is recovered without another call. `shutdown()` cancels pending re-checks. See [run ownership](https://mastra.ai/docs/harness/durable-agents).
|
|
151
|
+
|
|
146
152
|
```typescript
|
|
147
153
|
const result = await mastra.recoverAllDurableAgents()
|
|
148
|
-
// { agents: 2, recovered: 3, succeeded: 3, failed: 0 }
|
|
154
|
+
// { agents: 2, recovered: 3, succeeded: 3, failed: 0, skipped: 1 }
|
|
149
155
|
```
|
|
150
156
|
|
|
151
157
|
Returns:
|
|
152
158
|
|
|
153
159
|
**agents** (`number`): Number of durable agents scanned.
|
|
154
160
|
|
|
155
|
-
**recovered** (`number`): Total number of runs that were re-driven.
|
|
161
|
+
**recovered** (`number`): Total number of runs that were re-driven: succeeded plus failed.
|
|
156
162
|
|
|
157
163
|
**succeeded** (`number`): Runs that restarted successfully.
|
|
158
164
|
|
|
159
|
-
**failed** (`number`): Runs whose restart threw an error.
|
|
165
|
+
**failed** (`number`): Runs whose restart threw an error.
|
|
166
|
+
|
|
167
|
+
**skipped** (`number`): Runs that another execution still drives. Each is checked again later.
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
`LeaseProvider` is the distributed leasing contract, separate from event delivery ([`PubSub`](https://mastra.ai/reference/pubsub/base)). Mastra's [signals layer](https://mastra.ai/docs/harness/signals) uses it to elect a single owner across multiple processes (for example, serverless invocations) for a resource, most commonly a thread key. The owner is the process that wakes and runs the agent stream, so other processes route follow-up work to it instead of starting a competing run.
|
|
8
8
|
|
|
9
|
+
[Durable agents](https://mastra.ai/docs/harness/durable-agents) also claim each run through a lease when the workflows store doesn't support run fencing, so crash recovery can tell whether another process still drives the run.
|
|
10
|
+
|
|
9
11
|
Leasing is separate from pub/sub. A `LeaseProvider` implementation needs actual lock coordination, whether through an atomic Redis operation such as `SET` or Lua or through an in-memory map for a single process. For backends that omit leasing, the signals runtime preserves single-process behavior with a no-op provider.
|
|
10
12
|
|
|
11
13
|
The built-in [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams) implements `LeaseProvider`, which is what enables signals to coordinate across instances in distributed and serverless deployments.
|
|
@@ -49,7 +49,7 @@ export const mastra = new Mastra({
|
|
|
49
49
|
|
|
50
50
|
## Constructor parameters
|
|
51
51
|
|
|
52
|
-
**url** (`string`): Valkey connection URL. Falls back to valkeyOptions.url. (Default: `valkey://localhost:6379`)
|
|
52
|
+
**url** (`string`): Valkey connection URL. Falls back to valkeyOptions.url. rediss\:// and valkeys\:// URLs enable TLS unless valkeyOptions.useTLS is set. (Default: `valkey://localhost:6379`)
|
|
53
53
|
|
|
54
54
|
**valkeyOptions** (`ValkeyClientOptions`): GLIDE connection options, including native client configuration.
|
|
55
55
|
|
|
@@ -405,6 +405,7 @@ On authenticated servers, the read routes require the `stored-workflows:read` pe
|
|
|
405
405
|
| `POST` | `/api/datasets/:datasetId/items` | Add a dataset item |
|
|
406
406
|
| `DELETE` | `/api/datasets/:datasetId/items/:itemId/purge` | Permanently scrub an item's content from every dataset version and linked experiment result |
|
|
407
407
|
| `GET` | `/api/experiments` | List experiments across datasets |
|
|
408
|
+
| `GET` | `/api/experiments/:experimentId` | Get an experiment by ID without knowing its dataset |
|
|
408
409
|
| `DELETE` | `/api/experiments/:experimentId` | Delete an experiment, including one orphaned by dataset deletion |
|
|
409
410
|
| `GET` | `/api/datasets/:datasetId/experiments` | List experiments for a dataset |
|
|
410
411
|
| `POST` | `/api/datasets/:datasetId/experiments` | Trigger an experiment, or create one without starting it (`start: false`) |
|