@mastra/mcp-docs-server 1.1.15 → 1.1.16-alpha.10
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/memory/observational-memory.md +36 -0
- package/.docs/docs/observability/tracing/exporters/datadog.md +132 -2
- package/.docs/docs/server/middleware.md +13 -1
- package/.docs/docs/server/server-adapters.md +3 -2
- package/.docs/docs/workspace/skills.md +23 -0
- package/.docs/guides/migrations/upgrade-to-v1/agent.md +23 -0
- package/.docs/models/gateways/openrouter.md +4 -43
- package/.docs/models/gateways/vercel.md +6 -1
- package/.docs/models/index.md +22 -2
- package/.docs/models/providers/baseten.md +1 -1
- package/.docs/models/providers/cortecs.md +6 -1
- package/.docs/models/providers/fastrouter.md +3 -2
- package/.docs/models/providers/fireworks-ai.md +3 -2
- package/.docs/models/providers/nano-gpt.md +2 -1
- package/.docs/models/providers/nvidia.md +2 -1
- package/.docs/models/providers/vivgrid.md +13 -12
- package/.docs/models/providers/vultr.md +1 -2
- package/.docs/models/providers/xai.md +27 -27
- package/.docs/models/providers/zenmux.md +90 -73
- package/.docs/reference/memory/observational-memory.md +42 -3
- package/.docs/reference/server/express-adapter.md +23 -0
- package/.docs/reference/server/fastify-adapter.md +28 -0
- package/.docs/reference/server/hono-adapter.md +22 -0
- package/.docs/reference/server/koa-adapter.md +23 -0
- package/.docs/reference/server/mastra-server.md +3 -2
- package/.docs/reference/tools/create-tool.md +1 -1
- package/.docs/reference/workspace/workspace-class.md +13 -1
- package/CHANGELOG.md +37 -0
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Nvidia
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 74 Nvidia models through Mastra's model router. Authentication is handled automatically using the `NVIDIA_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Nvidia documentation](https://docs.api.nvidia.com/nim/).
|
|
6
6
|
|
|
@@ -91,6 +91,7 @@ for await (const chunk of stream) {
|
|
|
91
91
|
| `nvidia/nvidia/llama3-chatqa-1.5-70b` | 128K | | | | | | — | — |
|
|
92
92
|
| `nvidia/nvidia/nemoretriever-ocr-v1` | — | | | | | | — | — |
|
|
93
93
|
| `nvidia/nvidia/nemotron-3-nano-30b-a3b` | 131K | | | | | | — | — |
|
|
94
|
+
| `nvidia/nvidia/nemotron-3-super-120b-a12b` | 262K | | | | | | $0.20 | $0.80 |
|
|
94
95
|
| `nvidia/nvidia/nemotron-4-340b-instruct` | 128K | | | | | | — | — |
|
|
95
96
|
| `nvidia/nvidia/nvidia-nemotron-nano-9b-v2` | 131K | | | | | | — | — |
|
|
96
97
|
| `nvidia/nvidia/parakeet-tdt-0.6b-v2` | — | | | | | | — | — |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Vivgrid
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 9 Vivgrid models through Mastra's model router. Authentication is handled automatically using the `VIVGRID_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Vivgrid documentation](https://docs.vivgrid.com/models).
|
|
6
6
|
|
|
@@ -32,16 +32,17 @@ for await (const chunk of stream) {
|
|
|
32
32
|
|
|
33
33
|
## Models
|
|
34
34
|
|
|
35
|
-
| Model
|
|
36
|
-
|
|
|
37
|
-
| `vivgrid/deepseek-v3.2`
|
|
38
|
-
| `vivgrid/gemini-3-flash-preview` | 1.0M | | | | | | $0.
|
|
39
|
-
| `vivgrid/gemini-3-pro-preview`
|
|
40
|
-
| `vivgrid/glm-5`
|
|
41
|
-
| `vivgrid/gpt-5-mini`
|
|
42
|
-
| `vivgrid/gpt-5.1-codex`
|
|
43
|
-
| `vivgrid/gpt-5.1-codex-max`
|
|
44
|
-
| `vivgrid/gpt-5.2-codex`
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| --------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `vivgrid/deepseek-v3.2` | 128K | | | | | | $0.28 | $0.42 |
|
|
38
|
+
| `vivgrid/gemini-3.1-flash-lite-preview` | 1.0M | | | | | | $0.25 | $2 |
|
|
39
|
+
| `vivgrid/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
|
|
40
|
+
| `vivgrid/glm-5` | 203K | | | | | | $1 | $3 |
|
|
41
|
+
| `vivgrid/gpt-5-mini` | 272K | | | | | | $0.25 | $2 |
|
|
42
|
+
| `vivgrid/gpt-5.1-codex` | 400K | | | | | | $1 | $10 |
|
|
43
|
+
| `vivgrid/gpt-5.1-codex-max` | 400K | | | | | | $1 | $10 |
|
|
44
|
+
| `vivgrid/gpt-5.2-codex` | 400K | | | | | | $2 | $14 |
|
|
45
|
+
| `vivgrid/gpt-5.4` | 400K | | | | | | $3 | $15 |
|
|
45
46
|
|
|
46
47
|
## Advanced configuration
|
|
47
48
|
|
|
@@ -71,7 +72,7 @@ const agent = new Agent({
|
|
|
71
72
|
model: ({ requestContext }) => {
|
|
72
73
|
const useAdvanced = requestContext.task === "complex";
|
|
73
74
|
return useAdvanced
|
|
74
|
-
? "vivgrid/gpt-5.
|
|
75
|
+
? "vivgrid/gpt-5.4"
|
|
75
76
|
: "vivgrid/deepseek-v3.2";
|
|
76
77
|
}
|
|
77
78
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Vultr
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 9 Vultr models through Mastra's model router. Authentication is handled automatically using the `VULTR_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Vultr documentation](https://api.vultrinference.com/).
|
|
6
6
|
|
|
@@ -43,7 +43,6 @@ for await (const chunk of stream) {
|
|
|
43
43
|
| `vultr/Llama-3_1-Nemotron-Ultra-253B-v1` | 32K | | | | | | $0.55 | $2 |
|
|
44
44
|
| `vultr/MiniMax-M2.5` | 196K | | | | | | $0.30 | $1 |
|
|
45
45
|
| `vultr/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4` | 260K | | | | | | $0.20 | $0.80 |
|
|
46
|
-
| `vultr/Qwen2.5-Coder-32B-Instruct` | 15K | | | | | | $0.20 | $0.60 |
|
|
47
46
|
|
|
48
47
|
## Advanced configuration
|
|
49
48
|
|
|
@@ -30,33 +30,33 @@ for await (const chunk of stream) {
|
|
|
30
30
|
|
|
31
31
|
## Models
|
|
32
32
|
|
|
33
|
-
| Model
|
|
34
|
-
|
|
|
35
|
-
| `xai/grok-2`
|
|
36
|
-
| `xai/grok-2-1212`
|
|
37
|
-
| `xai/grok-2-latest`
|
|
38
|
-
| `xai/grok-2-vision`
|
|
39
|
-
| `xai/grok-2-vision-1212`
|
|
40
|
-
| `xai/grok-2-vision-latest`
|
|
41
|
-
| `xai/grok-3`
|
|
42
|
-
| `xai/grok-3-fast`
|
|
43
|
-
| `xai/grok-3-fast-latest`
|
|
44
|
-
| `xai/grok-3-latest`
|
|
45
|
-
| `xai/grok-3-mini`
|
|
46
|
-
| `xai/grok-3-mini-fast`
|
|
47
|
-
| `xai/grok-3-mini-fast-latest`
|
|
48
|
-
| `xai/grok-3-mini-latest`
|
|
49
|
-
| `xai/grok-4`
|
|
50
|
-
| `xai/grok-4-1-fast`
|
|
51
|
-
| `xai/grok-4-1-fast-non-reasoning`
|
|
52
|
-
| `xai/grok-4-fast`
|
|
53
|
-
| `xai/grok-4-fast-non-reasoning`
|
|
54
|
-
| `xai/grok-4.20-
|
|
55
|
-
| `xai/grok-4.20-
|
|
56
|
-
| `xai/grok-4.20-multi-agent-
|
|
57
|
-
| `xai/grok-beta`
|
|
58
|
-
| `xai/grok-code-fast-1`
|
|
59
|
-
| `xai/grok-vision-beta`
|
|
33
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
34
|
+
| ---------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
35
|
+
| `xai/grok-2` | 131K | | | | | | $2 | $10 |
|
|
36
|
+
| `xai/grok-2-1212` | 131K | | | | | | $2 | $10 |
|
|
37
|
+
| `xai/grok-2-latest` | 131K | | | | | | $2 | $10 |
|
|
38
|
+
| `xai/grok-2-vision` | 8K | | | | | | $2 | $10 |
|
|
39
|
+
| `xai/grok-2-vision-1212` | 8K | | | | | | $2 | $10 |
|
|
40
|
+
| `xai/grok-2-vision-latest` | 8K | | | | | | $2 | $10 |
|
|
41
|
+
| `xai/grok-3` | 131K | | | | | | $3 | $15 |
|
|
42
|
+
| `xai/grok-3-fast` | 131K | | | | | | $5 | $25 |
|
|
43
|
+
| `xai/grok-3-fast-latest` | 131K | | | | | | $5 | $25 |
|
|
44
|
+
| `xai/grok-3-latest` | 131K | | | | | | $3 | $15 |
|
|
45
|
+
| `xai/grok-3-mini` | 131K | | | | | | $0.30 | $0.50 |
|
|
46
|
+
| `xai/grok-3-mini-fast` | 131K | | | | | | $0.60 | $4 |
|
|
47
|
+
| `xai/grok-3-mini-fast-latest` | 131K | | | | | | $0.60 | $4 |
|
|
48
|
+
| `xai/grok-3-mini-latest` | 131K | | | | | | $0.30 | $0.50 |
|
|
49
|
+
| `xai/grok-4` | 256K | | | | | | $3 | $15 |
|
|
50
|
+
| `xai/grok-4-1-fast` | 2.0M | | | | | | $0.20 | $0.50 |
|
|
51
|
+
| `xai/grok-4-1-fast-non-reasoning` | 2.0M | | | | | | $0.20 | $0.50 |
|
|
52
|
+
| `xai/grok-4-fast` | 2.0M | | | | | | $0.20 | $0.50 |
|
|
53
|
+
| `xai/grok-4-fast-non-reasoning` | 2.0M | | | | | | $0.20 | $0.50 |
|
|
54
|
+
| `xai/grok-4.20-0309-non-reasoning` | 2.0M | | | | | | $2 | $6 |
|
|
55
|
+
| `xai/grok-4.20-0309-reasoning` | 2.0M | | | | | | $2 | $6 |
|
|
56
|
+
| `xai/grok-4.20-multi-agent-0309` | 2.0M | | | | | | $2 | $6 |
|
|
57
|
+
| `xai/grok-beta` | 131K | | | | | | $5 | $15 |
|
|
58
|
+
| `xai/grok-code-fast-1` | 256K | | | | | | $0.20 | $2 |
|
|
59
|
+
| `xai/grok-vision-beta` | 8K | | | | | | $5 | $15 |
|
|
60
60
|
|
|
61
61
|
## Advanced configuration
|
|
62
62
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ZenMux
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 86 ZenMux models through Mastra's model router. Authentication is handled automatically using the `ZENMUX_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [ZenMux documentation](https://docs.zenmux.ai).
|
|
6
6
|
|
|
@@ -32,77 +32,94 @@ for await (const chunk of stream) {
|
|
|
32
32
|
|
|
33
33
|
## Models
|
|
34
34
|
|
|
35
|
-
| Model
|
|
36
|
-
|
|
|
37
|
-
| `zenmux/anthropic/claude-3.5-haiku`
|
|
38
|
-
| `zenmux/anthropic/claude-3.
|
|
39
|
-
| `zenmux/anthropic/claude-
|
|
40
|
-
| `zenmux/anthropic/claude-
|
|
41
|
-
| `zenmux/anthropic/claude-opus-4`
|
|
42
|
-
| `zenmux/anthropic/claude-opus-4.
|
|
43
|
-
| `zenmux/anthropic/claude-opus-4.
|
|
44
|
-
| `zenmux/anthropic/claude-
|
|
45
|
-
| `zenmux/anthropic/claude-sonnet-4`
|
|
46
|
-
| `zenmux/anthropic/claude-sonnet-4.
|
|
47
|
-
| `zenmux/
|
|
48
|
-
| `zenmux/
|
|
49
|
-
| `zenmux/deepseek/deepseek-
|
|
50
|
-
| `zenmux/deepseek/deepseek-v3.2`
|
|
51
|
-
| `zenmux/
|
|
52
|
-
| `zenmux/google/gemini-2.5-flash`
|
|
53
|
-
| `zenmux/google/gemini-2.5-
|
|
54
|
-
| `zenmux/google/gemini-
|
|
55
|
-
| `zenmux/google/gemini-3-
|
|
56
|
-
| `zenmux/google/gemini-3-pro-preview`
|
|
57
|
-
| `zenmux/google/gemini-3.1-
|
|
58
|
-
| `zenmux/
|
|
59
|
-
| `zenmux/inclusionai/
|
|
60
|
-
| `zenmux/
|
|
61
|
-
| `zenmux/kuaishou/kat-coder-pro-v1
|
|
62
|
-
| `zenmux/
|
|
63
|
-
| `zenmux/minimax/minimax-m2
|
|
64
|
-
| `zenmux/minimax/minimax-m2.
|
|
65
|
-
| `zenmux/minimax/minimax-m2.5
|
|
66
|
-
| `zenmux/
|
|
67
|
-
| `zenmux/
|
|
68
|
-
| `zenmux/
|
|
69
|
-
| `zenmux/moonshotai/kimi-k2
|
|
70
|
-
| `zenmux/
|
|
71
|
-
| `zenmux/
|
|
72
|
-
| `zenmux/
|
|
73
|
-
| `zenmux/openai/gpt-5
|
|
74
|
-
| `zenmux/openai/gpt-5
|
|
75
|
-
| `zenmux/openai/gpt-5.1
|
|
76
|
-
| `zenmux/openai/gpt-5.
|
|
77
|
-
| `zenmux/openai/gpt-5.
|
|
78
|
-
| `zenmux/openai/gpt-5.
|
|
79
|
-
| `zenmux/
|
|
80
|
-
| `zenmux/
|
|
81
|
-
| `zenmux/
|
|
82
|
-
| `zenmux/
|
|
83
|
-
| `zenmux/
|
|
84
|
-
| `zenmux/
|
|
85
|
-
| `zenmux/
|
|
86
|
-
| `zenmux/
|
|
87
|
-
| `zenmux/
|
|
88
|
-
| `zenmux/
|
|
89
|
-
| `zenmux/
|
|
90
|
-
| `zenmux/
|
|
91
|
-
| `zenmux/
|
|
92
|
-
| `zenmux/
|
|
93
|
-
| `zenmux/
|
|
94
|
-
| `zenmux/
|
|
95
|
-
| `zenmux/
|
|
96
|
-
| `zenmux/
|
|
97
|
-
| `zenmux/
|
|
98
|
-
| `zenmux/
|
|
99
|
-
| `zenmux/
|
|
100
|
-
| `zenmux/
|
|
101
|
-
| `zenmux/
|
|
102
|
-
| `zenmux/
|
|
103
|
-
| `zenmux/
|
|
104
|
-
| `zenmux/
|
|
105
|
-
| `zenmux/
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| --------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `zenmux/anthropic/claude-3.5-haiku` | 200K | | | | | | $0.80 | $4 |
|
|
38
|
+
| `zenmux/anthropic/claude-3.7-sonnet` | 200K | | | | | | $3 | $15 |
|
|
39
|
+
| `zenmux/anthropic/claude-haiku-4.5` | 200K | | | | | | $1 | $5 |
|
|
40
|
+
| `zenmux/anthropic/claude-opus-4` | 200K | | | | | | $15 | $75 |
|
|
41
|
+
| `zenmux/anthropic/claude-opus-4.1` | 200K | | | | | | $15 | $75 |
|
|
42
|
+
| `zenmux/anthropic/claude-opus-4.5` | 200K | | | | | | $5 | $25 |
|
|
43
|
+
| `zenmux/anthropic/claude-opus-4.6` | 1.0M | | | | | | $5 | $25 |
|
|
44
|
+
| `zenmux/anthropic/claude-sonnet-4` | 1.0M | | | | | | $3 | $15 |
|
|
45
|
+
| `zenmux/anthropic/claude-sonnet-4.5` | 1.0M | | | | | | $3 | $15 |
|
|
46
|
+
| `zenmux/anthropic/claude-sonnet-4.6` | 1.0M | | | | | | $3 | $15 |
|
|
47
|
+
| `zenmux/baidu/ernie-5.0-thinking-preview` | 128K | | | | | | $0.84 | $3 |
|
|
48
|
+
| `zenmux/deepseek/deepseek-chat` | 128K | | | | | | $0.28 | $0.42 |
|
|
49
|
+
| `zenmux/deepseek/deepseek-v3.2` | 128K | | | | | | $0.28 | $0.43 |
|
|
50
|
+
| `zenmux/deepseek/deepseek-v3.2-exp` | 163K | | | | | | $0.22 | $0.33 |
|
|
51
|
+
| `zenmux/google/gemini-2.5-flash` | 1.0M | | | | | | $0.30 | $3 |
|
|
52
|
+
| `zenmux/google/gemini-2.5-flash-lite` | 1.0M | | | | | | $0.10 | $0.40 |
|
|
53
|
+
| `zenmux/google/gemini-2.5-pro` | 1.0M | | | | | | $1 | $10 |
|
|
54
|
+
| `zenmux/google/gemini-3-flash-preview` | 1.0M | | | | | | $0.50 | $3 |
|
|
55
|
+
| `zenmux/google/gemini-3-pro-image-preview` | 1.0M | | | | | | $2 | $12 |
|
|
56
|
+
| `zenmux/google/gemini-3-pro-preview` | 1.0M | | | | | | $2 | $12 |
|
|
57
|
+
| `zenmux/google/gemini-3.1-flash-lite-preview` | 1.1M | | | | | | $0.25 | $2 |
|
|
58
|
+
| `zenmux/google/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
|
|
59
|
+
| `zenmux/inclusionai/ling-1t` | 128K | | | | | | $0.56 | $2 |
|
|
60
|
+
| `zenmux/inclusionai/ring-1t` | 128K | | | | | | $0.56 | $2 |
|
|
61
|
+
| `zenmux/kuaishou/kat-coder-pro-v1` | 256K | | | | | | $0.30 | $1 |
|
|
62
|
+
| `zenmux/kuaishou/kat-coder-pro-v1-free` | 256K | | | | | | — | — |
|
|
63
|
+
| `zenmux/minimax/minimax-m2` | 204K | | | | | | $0.30 | $1 |
|
|
64
|
+
| `zenmux/minimax/minimax-m2.1` | 204K | | | | | | $0.30 | $1 |
|
|
65
|
+
| `zenmux/minimax/minimax-m2.5` | 205K | | | | | | $0.30 | $1 |
|
|
66
|
+
| `zenmux/minimax/minimax-m2.5-lightning` | 205K | | | | | | $0.60 | $5 |
|
|
67
|
+
| `zenmux/minimax/minimax-m2.7` | 205K | | | | | | $0.31 | $1 |
|
|
68
|
+
| `zenmux/minimax/minimax-m2.7-highspeed` | 205K | | | | | | $0.61 | $2 |
|
|
69
|
+
| `zenmux/moonshotai/kimi-k2-0905` | 262K | | | | | | $0.60 | $3 |
|
|
70
|
+
| `zenmux/moonshotai/kimi-k2-thinking` | 262K | | | | | | $0.60 | $3 |
|
|
71
|
+
| `zenmux/moonshotai/kimi-k2-thinking-turbo` | 262K | | | | | | $1 | $8 |
|
|
72
|
+
| `zenmux/moonshotai/kimi-k2.5` | 262K | | | | | | $0.58 | $3 |
|
|
73
|
+
| `zenmux/openai/gpt-5` | 400K | | | | | | $1 | $10 |
|
|
74
|
+
| `zenmux/openai/gpt-5-codex` | 400K | | | | | | $1 | $10 |
|
|
75
|
+
| `zenmux/openai/gpt-5.1` | 400K | | | | | | $1 | $10 |
|
|
76
|
+
| `zenmux/openai/gpt-5.1-chat` | 128K | | | | | | $1 | $10 |
|
|
77
|
+
| `zenmux/openai/gpt-5.1-codex` | 400K | | | | | | $1 | $10 |
|
|
78
|
+
| `zenmux/openai/gpt-5.1-codex-mini` | 400K | | | | | | $0.25 | $2 |
|
|
79
|
+
| `zenmux/openai/gpt-5.2` | 400K | | | | | | $2 | $14 |
|
|
80
|
+
| `zenmux/openai/gpt-5.2-codex` | 400K | | | | | | $2 | $14 |
|
|
81
|
+
| `zenmux/openai/gpt-5.2-pro` | 400K | | | | | | $21 | $168 |
|
|
82
|
+
| `zenmux/openai/gpt-5.3-chat` | 128K | | | | | | $2 | $14 |
|
|
83
|
+
| `zenmux/openai/gpt-5.3-codex` | 400K | | | | | | $2 | $14 |
|
|
84
|
+
| `zenmux/openai/gpt-5.4` | 1.1M | | | | | | $4 | $19 |
|
|
85
|
+
| `zenmux/openai/gpt-5.4-mini` | 400K | | | | | | $0.75 | $5 |
|
|
86
|
+
| `zenmux/openai/gpt-5.4-nano` | 400K | | | | | | $0.20 | $1 |
|
|
87
|
+
| `zenmux/openai/gpt-5.4-pro` | 1.1M | | | | | | $45 | $225 |
|
|
88
|
+
| `zenmux/qwen/qwen3-coder-plus` | 1.0M | | | | | | $1 | $5 |
|
|
89
|
+
| `zenmux/qwen/qwen3-max` | 256K | | | | | | $1 | $6 |
|
|
90
|
+
| `zenmux/qwen/qwen3.5-flash` | 1.0M | | | | | | $0.10 | $0.40 |
|
|
91
|
+
| `zenmux/qwen/qwen3.5-plus` | 1.0M | | | | | | $0.80 | $5 |
|
|
92
|
+
| `zenmux/stepfun/step-3` | 66K | | | | | | $0.21 | $0.57 |
|
|
93
|
+
| `zenmux/stepfun/step-3.5-flash` | 256K | | | | | | $0.10 | $0.30 |
|
|
94
|
+
| `zenmux/stepfun/step-3.5-flash-free` | 256K | | | | | | — | — |
|
|
95
|
+
| `zenmux/volcengine/doubao-seed-1.8` | 256K | | | | | | $0.11 | $0.28 |
|
|
96
|
+
| `zenmux/volcengine/doubao-seed-2.0-code` | 256K | | | | | | $0.90 | $4 |
|
|
97
|
+
| `zenmux/volcengine/doubao-seed-2.0-lite` | 256K | | | | | | $0.09 | $0.51 |
|
|
98
|
+
| `zenmux/volcengine/doubao-seed-2.0-mini` | 256K | | | | | | $0.03 | $0.28 |
|
|
99
|
+
| `zenmux/volcengine/doubao-seed-2.0-pro` | 256K | | | | | | $0.45 | $2 |
|
|
100
|
+
| `zenmux/volcengine/doubao-seed-code` | 256K | | | | | | $0.17 | $1 |
|
|
101
|
+
| `zenmux/x-ai/grok-4` | 256K | | | | | | $3 | $15 |
|
|
102
|
+
| `zenmux/x-ai/grok-4-fast` | 2.0M | | | | | | $0.20 | $0.50 |
|
|
103
|
+
| `zenmux/x-ai/grok-4.1-fast` | 2.0M | | | | | | $0.20 | $0.50 |
|
|
104
|
+
| `zenmux/x-ai/grok-4.1-fast-non-reasoning` | 2.0M | | | | | | $0.20 | $0.50 |
|
|
105
|
+
| `zenmux/x-ai/grok-4.2-fast` | 2.0M | | | | | | $3 | $9 |
|
|
106
|
+
| `zenmux/x-ai/grok-4.2-fast-non-reasoning` | 2.0M | | | | | | $3 | $9 |
|
|
107
|
+
| `zenmux/x-ai/grok-code-fast-1` | 256K | | | | | | $0.20 | $2 |
|
|
108
|
+
| `zenmux/xiaomi/mimo-v2-flash` | 262K | | | | | | $0.10 | $0.30 |
|
|
109
|
+
| `zenmux/xiaomi/mimo-v2-flash-free` | 262K | | | | | | — | — |
|
|
110
|
+
| `zenmux/xiaomi/mimo-v2-omni` | 265K | | | | | | $0.40 | $2 |
|
|
111
|
+
| `zenmux/xiaomi/mimo-v2-pro` | 1.0M | | | | | | $2 | $5 |
|
|
112
|
+
| `zenmux/z-ai/glm-4.5` | 128K | | | | | | $0.35 | $2 |
|
|
113
|
+
| `zenmux/z-ai/glm-4.5-air` | 128K | | | | | | $0.11 | $0.56 |
|
|
114
|
+
| `zenmux/z-ai/glm-4.6` | 200K | | | | | | $0.35 | $2 |
|
|
115
|
+
| `zenmux/z-ai/glm-4.6v` | 200K | | | | | | $0.14 | $0.42 |
|
|
116
|
+
| `zenmux/z-ai/glm-4.6v-flash` | 200K | | | | | | $0.02 | $0.21 |
|
|
117
|
+
| `zenmux/z-ai/glm-4.6v-flash-free` | 200K | | | | | | — | — |
|
|
118
|
+
| `zenmux/z-ai/glm-4.7` | 200K | | | | | | $0.28 | $1 |
|
|
119
|
+
| `zenmux/z-ai/glm-4.7-flash-free` | 200K | | | | | | — | — |
|
|
120
|
+
| `zenmux/z-ai/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.42 |
|
|
121
|
+
| `zenmux/z-ai/glm-5` | 200K | | | | | | $0.58 | $3 |
|
|
122
|
+
| `zenmux/z-ai/glm-5-turbo` | 200K | | | | | | $0.88 | $3 |
|
|
106
123
|
|
|
107
124
|
## Advanced configuration
|
|
108
125
|
|
|
@@ -132,7 +149,7 @@ const agent = new Agent({
|
|
|
132
149
|
model: ({ requestContext }) => {
|
|
133
150
|
const useAdvanced = requestContext.task === "complex";
|
|
134
151
|
return useAdvanced
|
|
135
|
-
? "zenmux/z-ai/glm-5"
|
|
152
|
+
? "zenmux/z-ai/glm-5-turbo"
|
|
136
153
|
: "zenmux/anthropic/claude-3.5-haiku";
|
|
137
154
|
}
|
|
138
155
|
});
|
|
@@ -32,7 +32,7 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
|
|
|
32
32
|
|
|
33
33
|
**enabled** (`boolean`): Enable or disable Observational Memory. When omitted from a config object, defaults to \`true\`. Only \`enabled: false\` explicitly disables it. (Default: `true`)
|
|
34
34
|
|
|
35
|
-
**model** (`string | LanguageModel | DynamicModel | ModelWithRetries[]`): Model for both the Observer and Reflector agents. Sets the model for both at once. Cannot be used together with \`observation.model\` or \`reflection.model\` — an error will be thrown if both are set. When using \`observationalMemory: true\`, defaults to \`google/gemini-2.5-flash\`. When passing a config object, this or \`observation.model\`/\`reflection.model\` must be set. Use \`"default"\` to explicitly use the default model (\`google/gemini-2.5-flash\`). (Default: `'google/gemini-2.5-flash' (when using observationalMemory: true)`)
|
|
35
|
+
**model** (`string | LanguageModel | DynamicModel | ModelByInputTokens | ModelWithRetries[]`): Model for both the Observer and Reflector agents. Sets the model for both at once. Cannot be used together with \`observation.model\` or \`reflection.model\` — an error will be thrown if both are set. When using \`observationalMemory: true\`, defaults to \`google/gemini-2.5-flash\`. When passing a config object, this or \`observation.model\`/\`reflection.model\` must be set. Use \`"default"\` to explicitly use the default model (\`google/gemini-2.5-flash\`). (Default: `'google/gemini-2.5-flash' (when using observationalMemory: true)`)
|
|
36
36
|
|
|
37
37
|
**scope** (`'resource' | 'thread'`): Memory scope for observations. \`'thread'\` keeps observations per-thread. \`'resource'\` (experimental) shares observations across all threads for a resource, enabling cross-conversation memory. (Default: `'thread'`)
|
|
38
38
|
|
|
@@ -42,7 +42,7 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
|
|
|
42
42
|
|
|
43
43
|
**observation** (`ObservationalMemoryObservationConfig`): Configuration for the observation step. Controls when the Observer agent runs and how it behaves.
|
|
44
44
|
|
|
45
|
-
**observation.model** (`string | LanguageModel | DynamicModel | ModelWithRetries[]`): Model for the Observer agent. Cannot be set if a top-level \`model\` is also provided. If neither this nor the top-level \`model\` is set, falls back to \`reflection.model\`.
|
|
45
|
+
**observation.model** (`string | LanguageModel | DynamicModel | ModelByInputTokens | ModelWithRetries[]`): Model for the Observer agent. Cannot be set if a top-level \`model\` is also provided. If neither this nor the top-level \`model\` is set, falls back to \`reflection.model\`.
|
|
46
46
|
|
|
47
47
|
**observation.instruction** (`string`): Custom instruction appended to the Observer's system prompt. Use this to customize what the Observer focuses on, such as domain-specific preferences or priorities.
|
|
48
48
|
|
|
@@ -68,7 +68,7 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
|
|
|
68
68
|
|
|
69
69
|
**reflection** (`ObservationalMemoryReflectionConfig`): Configuration for the reflection step. Controls when the Reflector agent runs and how it behaves.
|
|
70
70
|
|
|
71
|
-
**reflection.model** (`string | LanguageModel | DynamicModel | ModelWithRetries[]`): Model for the Reflector agent. Cannot be set if a top-level \`model\` is also provided. If neither this nor the top-level \`model\` is set, falls back to \`observation.model\`.
|
|
71
|
+
**reflection.model** (`string | LanguageModel | DynamicModel | ModelByInputTokens | ModelWithRetries[]`): Model for the Reflector agent. Cannot be set if a top-level \`model\` is also provided. If neither this nor the top-level \`model\` is set, falls back to \`observation.model\`.
|
|
72
72
|
|
|
73
73
|
**reflection.instruction** (`string`): Custom instruction appended to the Reflector's system prompt. Use this to customize how the Reflector consolidates observations, such as prioritizing certain types of information.
|
|
74
74
|
|
|
@@ -612,6 +612,45 @@ When `retrieval: true` is set with `scope: 'thread'`, OM registers a `recall` to
|
|
|
612
612
|
|
|
613
613
|
**tokenOffset** (`number`): Approximate number of tokens that were trimmed when \`truncated\` is true.
|
|
614
614
|
|
|
615
|
+
### ModelByInputTokens
|
|
616
|
+
|
|
617
|
+
`ModelByInputTokens` selects a model based on the input token count. It chooses the model for the smallest threshold that covers the actual input size.
|
|
618
|
+
|
|
619
|
+
#### Constructor
|
|
620
|
+
|
|
621
|
+
```typescript
|
|
622
|
+
new ModelByInputTokens(config)
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
Where `config` is an object with `upTo` keys that map token thresholds (numbers) to model targets.
|
|
626
|
+
|
|
627
|
+
#### Example
|
|
628
|
+
|
|
629
|
+
```typescript
|
|
630
|
+
import { ModelByInputTokens } from '@mastra/memory'
|
|
631
|
+
|
|
632
|
+
const selector = new ModelByInputTokens({
|
|
633
|
+
upTo: {
|
|
634
|
+
10_000: 'google/gemini-2.5-flash', // Fast for small inputs
|
|
635
|
+
40_000: 'openai/gpt-4o', // Stronger for medium inputs
|
|
636
|
+
1_000_000: 'openai/gpt-4.5', // Most capable for large inputs
|
|
637
|
+
},
|
|
638
|
+
})
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
#### Behavior
|
|
642
|
+
|
|
643
|
+
- Thresholds are sorted internally, so the order in the config object does not matter.
|
|
644
|
+
- `inputTokens ≤ smallest threshold` → uses that threshold's model
|
|
645
|
+
- `inputTokens > largest threshold` → `resolve()` throws an error. If this happens during an OM Observer or Reflector run, OM aborts via TripWire, so callers receive an empty `text` result or streamed `tripwire` instead of a normal assistant response.
|
|
646
|
+
- OM computes the input token count for the Observer or Reflector call and resolves the matching model tier directly
|
|
647
|
+
|
|
648
|
+
#### Methods
|
|
649
|
+
|
|
650
|
+
**resolve** (`(inputTokens: number) => MastraModelConfig`): Returns the model for the given input token count. Throws if inputTokens exceeds the largest configured threshold. When this happens during an OM run, callers receive a TripWire/empty-text outcome instead of a normal assistant response.
|
|
651
|
+
|
|
652
|
+
**getThresholds** (`() => number[]`): Returns the configured thresholds in ascending order. Useful for introspection.
|
|
653
|
+
|
|
615
654
|
### Related
|
|
616
655
|
|
|
617
656
|
- [Observational Memory](https://mastra.ai/docs/memory/observational-memory)
|
|
@@ -110,6 +110,29 @@ app.listen(4111)
|
|
|
110
110
|
|
|
111
111
|
> **Tip:** Routes added before `init()` run without Mastra context. Add routes after `init()` to access the Mastra instance and request context.
|
|
112
112
|
|
|
113
|
+
When you want Mastra-managed auth and route metadata such as `requiresAuth`, prefer [`registerApiRoute()`](https://mastra.ai/reference/server/register-api-route). For raw Express routes mounted directly on `app`, use `createAuthMiddleware()`:
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
import express from 'express'
|
|
117
|
+
import { createAuthMiddleware, MastraServer } from '@mastra/express'
|
|
118
|
+
import { mastra } from './mastra'
|
|
119
|
+
|
|
120
|
+
const app = express()
|
|
121
|
+
app.use(express.json())
|
|
122
|
+
|
|
123
|
+
const server = new MastraServer({ app, mastra })
|
|
124
|
+
await server.init()
|
|
125
|
+
|
|
126
|
+
app.get('/custom/protected', createAuthMiddleware({ mastra }), (req, res) => {
|
|
127
|
+
const user = res.locals.requestContext.get('user')
|
|
128
|
+
res.json({ user })
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
app.get('/custom/public', createAuthMiddleware({ mastra, requiresAuth: false }), (req, res) => {
|
|
132
|
+
res.json({ ok: true })
|
|
133
|
+
})
|
|
134
|
+
```
|
|
135
|
+
|
|
113
136
|
## Accessing context
|
|
114
137
|
|
|
115
138
|
In Express middleware and routes, access Mastra context via `res.locals`:
|
|
@@ -75,6 +75,34 @@ app.listen({ port: 3000 }, (err, address) => {
|
|
|
75
75
|
|
|
76
76
|
**mcpOptions** (`MCPOptions`): MCP transport options. Set \`serverless: true\` for stateless environments like Cloudflare Workers or Vercel Edge.
|
|
77
77
|
|
|
78
|
+
## Protecting raw routes
|
|
79
|
+
|
|
80
|
+
When you want Mastra-managed auth and route metadata such as `requiresAuth`, prefer [`registerApiRoute()`](https://mastra.ai/reference/server/register-api-route). For raw Fastify routes mounted directly on the app, use `createAuthMiddleware()`:
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import Fastify from 'fastify'
|
|
84
|
+
import { createAuthMiddleware, MastraServer } from '@mastra/fastify'
|
|
85
|
+
import { mastra } from './mastra'
|
|
86
|
+
|
|
87
|
+
const app = Fastify()
|
|
88
|
+
const server = new MastraServer({ app, mastra })
|
|
89
|
+
|
|
90
|
+
await server.init()
|
|
91
|
+
|
|
92
|
+
app.get('/custom/protected', { preHandler: createAuthMiddleware({ mastra }) }, async request => {
|
|
93
|
+
const user = request.requestContext.get('user')
|
|
94
|
+
return { user }
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
app.get(
|
|
98
|
+
'/custom/public',
|
|
99
|
+
{ preHandler: createAuthMiddleware({ mastra, requiresAuth: false }) },
|
|
100
|
+
async () => {
|
|
101
|
+
return { ok: true }
|
|
102
|
+
},
|
|
103
|
+
)
|
|
104
|
+
```
|
|
105
|
+
|
|
78
106
|
## Manual initialization
|
|
79
107
|
|
|
80
108
|
For custom middleware ordering, call each method separately instead of `init()`. See [manual initialization](https://mastra.ai/docs/server/server-adapters) for details.
|
|
@@ -94,6 +94,28 @@ app.get('/custom', c => {
|
|
|
94
94
|
|
|
95
95
|
> **Tip:** Routes added before `init()` run without Mastra context. Add routes after `init()` to access the Mastra instance and request context.
|
|
96
96
|
|
|
97
|
+
When you want Mastra-managed auth and route metadata such as `requiresAuth`, prefer [`registerApiRoute()`](https://mastra.ai/reference/server/register-api-route). For raw Hono routes mounted directly on `app`, use `createAuthMiddleware()`:
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
import { Hono } from 'hono'
|
|
101
|
+
import { createAuthMiddleware, HonoBindings, HonoVariables, MastraServer } from '@mastra/hono'
|
|
102
|
+
import { mastra } from './mastra'
|
|
103
|
+
|
|
104
|
+
const app = new Hono<{ Bindings: HonoBindings; Variables: HonoVariables }>()
|
|
105
|
+
const server = new MastraServer({ app, mastra })
|
|
106
|
+
|
|
107
|
+
await server.init()
|
|
108
|
+
|
|
109
|
+
app.get('/custom/protected', createAuthMiddleware({ mastra }), c => {
|
|
110
|
+
const user = c.get('requestContext').get('user')
|
|
111
|
+
return c.json({ user })
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
app.get('/custom/public', createAuthMiddleware({ mastra, requiresAuth: false }), c => {
|
|
115
|
+
return c.json({ ok: true })
|
|
116
|
+
})
|
|
117
|
+
```
|
|
118
|
+
|
|
97
119
|
## Accessing context
|
|
98
120
|
|
|
99
121
|
In Hono middleware and route handlers, access Mastra context via `c.get()`:
|
|
@@ -112,6 +112,29 @@ const mastra = new Mastra({
|
|
|
112
112
|
|
|
113
113
|
When `init()` is used, a global error-handling middleware is also registered as a safety net. Errors that reach this middleware are emitted via `ctx.app.emit('error', err, ctx)` following the standard Koa convention.
|
|
114
114
|
|
|
115
|
+
## Protecting raw routes
|
|
116
|
+
|
|
117
|
+
When you want Mastra-managed auth and route metadata such as `requiresAuth`, prefer [`registerApiRoute()`](https://mastra.ai/reference/server/register-api-route). For raw Koa routes mounted directly on the app, use `createAuthMiddleware()`:
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import Koa from 'koa'
|
|
121
|
+
import { createAuthMiddleware, MastraServer } from '@mastra/koa'
|
|
122
|
+
import { mastra } from './mastra'
|
|
123
|
+
|
|
124
|
+
const app = new Koa()
|
|
125
|
+
const server = new MastraServer({ app, mastra })
|
|
126
|
+
|
|
127
|
+
await server.init()
|
|
128
|
+
|
|
129
|
+
app.use(createAuthMiddleware({ mastra }))
|
|
130
|
+
app.use(async ctx => {
|
|
131
|
+
if (ctx.path !== '/custom/protected') return
|
|
132
|
+
|
|
133
|
+
const user = ctx.state.requestContext.get('user')
|
|
134
|
+
ctx.body = { user }
|
|
135
|
+
})
|
|
136
|
+
```
|
|
137
|
+
|
|
115
138
|
## Manual initialization
|
|
116
139
|
|
|
117
140
|
For custom middleware ordering, call each method separately instead of `init()`. See [manual initialization](https://mastra.ai/docs/server/server-adapters) for details.
|
|
@@ -69,7 +69,7 @@ abstract registerContextMiddleware(): void
|
|
|
69
69
|
|
|
70
70
|
### `registerAuthMiddleware()`
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Run the adapter auth hook during initialization. Official adapters may implement this as a no-op when auth is enforced per-route.
|
|
73
73
|
|
|
74
74
|
```typescript
|
|
75
75
|
abstract registerAuthMiddleware(): void
|
|
@@ -266,7 +266,8 @@ export class MyServer extends MastraServer<MyApp, MyRequest, MyResponse> {
|
|
|
266
266
|
registerAuthMiddleware(): void {
|
|
267
267
|
const auth = this.mastra.getServer()?.auth
|
|
268
268
|
if (!auth) return
|
|
269
|
-
//
|
|
269
|
+
// Register global auth middleware, or leave this empty and
|
|
270
|
+
// enforce auth when routes are registered.
|
|
270
271
|
}
|
|
271
272
|
|
|
272
273
|
async registerRoute(app, route, { prefix }) {
|
|
@@ -144,7 +144,7 @@ export const weatherTool = createTool({
|
|
|
144
144
|
|
|
145
145
|
**execute.context.abortSignal** (`AbortSignal`): Signal for aborting the tool execution
|
|
146
146
|
|
|
147
|
-
**execute.context.agent** (`AgentToolExecutionContext`): Agent-specific context
|
|
147
|
+
**execute.context.agent** (`AgentToolExecutionContext`): Agent-specific context, available when the tool is executed by an agent.
|
|
148
148
|
|
|
149
149
|
**execute.context.workflow** (`WorkflowToolExecutionContext`): Workflow-specific context (state, setState, suspend, etc.)
|
|
150
150
|
|
|
@@ -305,4 +305,16 @@ Added when BM25 or vector search is configured:
|
|
|
305
305
|
| `mastra_workspace_search` | Search indexed content using keyword (BM25), semantic (vector), or hybrid search. Returns ranked results with scores. |
|
|
306
306
|
| `mastra_workspace_index` | Index content for search. Associates content with a path for later retrieval. |
|
|
307
307
|
|
|
308
|
-
The `index` tool is excluded when the filesystem is in read-only mode.
|
|
308
|
+
The `index` tool is excluded when the filesystem is in read-only mode.
|
|
309
|
+
|
|
310
|
+
### Skill tools
|
|
311
|
+
|
|
312
|
+
Added when skills are configured:
|
|
313
|
+
|
|
314
|
+
| Tool | Description |
|
|
315
|
+
| -------------- | --------------------------------------------------------------------------------------------------------- |
|
|
316
|
+
| `skill` | Activate a skill by name or path. Returns the skill's full instructions, references, scripts, and assets. |
|
|
317
|
+
| `skill_search` | Search across skill content. Accepts an optional list of skill names to filter and a `topK` parameter. |
|
|
318
|
+
| `skill_read` | Read a specific file (reference, script, or asset) from a skill directory. |
|
|
319
|
+
|
|
320
|
+
When multiple skills share the same name, `list()` returns all of them. `get()` with a name applies tie-breaking (local > managed > external). If two skills share the same name _and_ source type, `get()` throws an error. Pass a skill's full path to `get()` to bypass tie-breaking. See [Same-named skills](https://mastra.ai/docs/workspace/skills) for details.
|