@mastra/mcp-docs-server 1.2.14-alpha.3 → 1.2.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/processors.md +25 -1
- package/.docs/docs/workflows/agents-and-tools.md +29 -0
- package/.docs/docs/workflows/stored-workflows.md +146 -0
- package/.docs/models/environment-variables.md +1 -1
- package/.docs/models/gateways/neon.md +71 -0
- package/.docs/models/gateways/vercel.md +1 -1
- package/.docs/models/gateways.md +1 -0
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/ambient.md +1 -1
- package/.docs/models/providers/cortecs.md +112 -66
- package/.docs/models/providers/hyper.md +6 -6
- package/.docs/models/providers/kilo.md +1 -1
- package/.docs/models/providers/llmgateway.md +1 -1
- package/.docs/models/providers/minimax.md +23 -25
- package/.docs/models/providers/nano-gpt.md +1 -1
- package/.docs/models/providers/openai.md +26 -28
- package/.docs/models/providers/perplexity-agent.md +24 -24
- package/.docs/models/providers.md +0 -1
- package/.docs/reference/client-js/workflows.md +92 -0
- package/.docs/reference/core/addStoredWorkflow.md +62 -0
- package/.docs/reference/core/addStoredWorkflows.md +40 -0
- package/.docs/reference/index.md +5 -0
- package/.docs/reference/processors/processor-interface.md +121 -10
- package/.docs/reference/server/routes.md +13 -0
- package/.docs/reference/storage/overview.md +9 -8
- package/.docs/reference/streaming/workflows/observeStream.md +1 -1
- package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
- package/.docs/reference/streaming/workflows/stream.md +1 -1
- package/.docs/reference/workflows/stored-workflow-definition.md +292 -0
- package/.docs/reference/workflows/workflow-methods/agent.md +62 -0
- package/.docs/reference/workflows/workflow-methods/tool.md +43 -0
- package/CHANGELOG.md +14 -0
- package/package.json +5 -5
- package/.docs/models/providers/neon.md +0 -109
|
@@ -13,7 +13,7 @@ You can use individual [`Processor`](https://mastra.ai/reference/processors/proc
|
|
|
13
13
|
|
|
14
14
|
Some processors implement both input and output logic and can be used in either array depending on where the transformation should occur.
|
|
15
15
|
|
|
16
|
-
Some built-in processors also send hidden system reminder signals. These signals are persisted in raw memory history and converted to `<system-reminder>...</system-reminder>` context before the next model call, but standard UI-facing message conversions and default memory recall hide them unless you explicitly opt in.
|
|
16
|
+
Some built-in processors also send hidden system reminder signals. These signals are persisted in raw memory history and converted to `<system-reminder>...</system-reminder>` context before the next model call, but standard UI-facing message conversions and default memory recall hide them unless you explicitly opt in. To deliver a signal for the current call without retaining it, send it with `transient: true`.
|
|
17
17
|
|
|
18
18
|
## When to use processors
|
|
19
19
|
|
|
@@ -640,6 +640,30 @@ await agent.generate('Your prompt', { maxSteps: MAX_STEPS })
|
|
|
640
640
|
|
|
641
641
|
> **Note:** Reactive signals default to `tagName: 'system-reminder'`. Visit [Signals](https://mastra.ai/docs/long-running-agents/signals) for more on processor-emitted signals.
|
|
642
642
|
|
|
643
|
+
### Deliver a reminder without retaining it
|
|
644
|
+
|
|
645
|
+
By default, a signal sent from a processor becomes part of the conversation: it's written to storage and re-enters the prompt on later turns. For an instruction you re-inject on every turn, that's unwanted, because copies pile up and the model starts treating its own past reminders as prior context to imitate. Set `transient: true` to deliver the signal to the model for the current call only, without retaining it.
|
|
646
|
+
|
|
647
|
+
**When to use it:** you want to keep a short steering instruction in the model's recency window as the conversation grows, for example "stay on the current task", "keep answers under three sentences", or a per-turn constraint that depends on live application state. Re-inject it each turn so it stays near the latest message.
|
|
648
|
+
|
|
649
|
+
```typescript
|
|
650
|
+
import type { Processor, ProcessInputStepArgs } from '@mastra/core/processors'
|
|
651
|
+
|
|
652
|
+
export class SteeringReminderProcessor implements Processor {
|
|
653
|
+
readonly id = 'steering-reminder'
|
|
654
|
+
|
|
655
|
+
async processInputStep({ sendSignal }: ProcessInputStepArgs) {
|
|
656
|
+
await sendSignal?.({
|
|
657
|
+
type: 'reactive',
|
|
658
|
+
contents: 'Stay on the current task and keep answers under three sentences.',
|
|
659
|
+
transient: true,
|
|
660
|
+
})
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
A transient signal still appears in the prompt for the current call, so the model sees it near the latest turn. It's not retained, so re-sending it each turn keeps a single fresh copy in context instead of an accumulating history, and it never appears in stored thread history. Because nothing is written, it also keeps a stable prompt cache prefix across turns.
|
|
666
|
+
|
|
643
667
|
### Emit custom stream events
|
|
644
668
|
|
|
645
669
|
Output processors receive a `writer` object that lets you emit custom data chunks back to the client during streaming. This is useful for use cases like streaming moderation results or sending UI update signals without blocking the original stream.
|
|
@@ -108,6 +108,23 @@ export const testWorkflow = createWorkflow({})
|
|
|
108
108
|
|
|
109
109
|
The `structuredOutput.schema` option accepts any Standard JSON Schema. The agent will generate output conforming to this schema, and the step's `outputSchema` will be automatically set to match. Visit [Structured Output](https://mastra.ai/docs/agents/structured-output) for more options like error handling strategies and streaming with structured output.
|
|
110
110
|
|
|
111
|
+
### The `.agent()` shorthand
|
|
112
|
+
|
|
113
|
+
Add an agent directly with `.agent()` instead of wrapping it in `createStep()`. It accepts the same options as `createStep(agent, options)`, plus an agent ID string in place of the instance:
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
import { testAgent } from '../agents/test-agent'
|
|
117
|
+
|
|
118
|
+
export const testWorkflow = createWorkflow({})
|
|
119
|
+
.map(async ({ inputData }) => ({
|
|
120
|
+
prompt: `Generate an article about: ${inputData.topic}`,
|
|
121
|
+
}))
|
|
122
|
+
.agent(testAgent, { structuredOutput: { schema: articleSchema } })
|
|
123
|
+
.commit()
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
`.agent()` records a declarative entry in the workflow graph rather than an opaque step, so workflows built this way can be persisted as [stored workflows](https://mastra.ai/docs/workflows/stored-workflows). Visit [Workflow.agent()](https://mastra.ai/reference/workflows/workflow-methods/agent) for all parameters.
|
|
127
|
+
|
|
111
128
|
## Using tools in workflows
|
|
112
129
|
|
|
113
130
|
Use tools in workflow steps to use existing tool logic. Call from a step's `.execute()` function when you need to prepare context or process responses. Compose tools as steps when you don't need to modify how the tool is used.
|
|
@@ -157,6 +174,18 @@ export const testWorkflow = createWorkflow({})
|
|
|
157
174
|
|
|
158
175
|
Visit [Input Data Mapping](https://mastra.ai/docs/workflows/control-flow) for more information.
|
|
159
176
|
|
|
177
|
+
### The `.tool()` shorthand
|
|
178
|
+
|
|
179
|
+
Add a tool directly with `.tool()` instead of wrapping it in `createStep()`. It accepts a tool instance or a registered tool ID string, plus step-level `retries` and `metadata`:
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
import { testTool } from '../tools/test-tool'
|
|
183
|
+
|
|
184
|
+
export const testWorkflow = createWorkflow({}).then(step1).tool(testTool).commit()
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Like `.agent()`, `.tool()` records a declarative entry, so the workflow can be persisted as a [stored workflow](https://mastra.ai/docs/workflows/stored-workflows). Visit [Workflow.tool()](https://mastra.ai/reference/workflows/workflow-methods/tool) for all parameters.
|
|
188
|
+
|
|
160
189
|
## Related
|
|
161
190
|
|
|
162
191
|
- [Using Agents](https://mastra.ai/docs/agents/overview)
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Stored workflows
|
|
4
|
+
|
|
5
|
+
> **Beta:** This feature is in beta. Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
7
|
+
Stored workflows are workflow definitions expressed as data instead of code. A definition is a JSON document that describes the workflow's schemas and step graph. Mastra validates the definition and registers it as a runnable workflow, then persists it in storage so it survives process restarts.
|
|
8
|
+
|
|
9
|
+
Because a definition contains no JavaScript closures, anything that can produce JSON can author a workflow: an HTTP client, an LLM, a visual editor, or your own tooling. Once registered, a stored workflow runs through the same execution API as a code-defined workflow.
|
|
10
|
+
|
|
11
|
+
## When to use stored workflows
|
|
12
|
+
|
|
13
|
+
Use stored workflows when users, agents, visual editors, or external systems need to create workflows without changing application code or deploying again.
|
|
14
|
+
|
|
15
|
+
Keep defining workflows with [`createWorkflow()`](https://mastra.ai/docs/workflows/overview) when the workflow belongs in your application source or needs custom step functions. Stored workflows can invoke agents, tools, and workflows that are already registered on the `Mastra` instance.
|
|
16
|
+
|
|
17
|
+
## Quickstart
|
|
18
|
+
|
|
19
|
+
The following example registers a tool and invokes it from a stored workflow. It then runs the workflow. `LibSQLStore` persists the definition in `mastra.db`, so Mastra can restore it after a restart.
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { Mastra } from '@mastra/core/mastra'
|
|
23
|
+
import { createTool } from '@mastra/core/tools'
|
|
24
|
+
import { LibSQLStore } from '@mastra/libsql'
|
|
25
|
+
import { z } from 'zod'
|
|
26
|
+
|
|
27
|
+
const greetingTool = createTool({
|
|
28
|
+
id: 'create-greeting',
|
|
29
|
+
description: 'Create a greeting for a name',
|
|
30
|
+
inputSchema: z.object({
|
|
31
|
+
name: z.string(),
|
|
32
|
+
}),
|
|
33
|
+
outputSchema: z.object({
|
|
34
|
+
message: z.string(),
|
|
35
|
+
}),
|
|
36
|
+
execute: async ({ name }) => ({
|
|
37
|
+
message: `Hello, ${name}!`,
|
|
38
|
+
}),
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const mastra = new Mastra({
|
|
42
|
+
storage: new LibSQLStore({
|
|
43
|
+
id: 'mastra-storage',
|
|
44
|
+
url: 'file:./mastra.db',
|
|
45
|
+
}),
|
|
46
|
+
tools: { 'create-greeting': greetingTool },
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
await mastra.addStoredWorkflow({
|
|
50
|
+
id: 'greeting-workflow',
|
|
51
|
+
description: 'Create a greeting for the supplied name',
|
|
52
|
+
inputSchema: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
properties: {
|
|
55
|
+
name: { type: 'string' },
|
|
56
|
+
},
|
|
57
|
+
required: ['name'],
|
|
58
|
+
},
|
|
59
|
+
outputSchema: {
|
|
60
|
+
type: 'object',
|
|
61
|
+
properties: {
|
|
62
|
+
message: { type: 'string' },
|
|
63
|
+
},
|
|
64
|
+
required: ['message'],
|
|
65
|
+
},
|
|
66
|
+
graph: [
|
|
67
|
+
{
|
|
68
|
+
type: 'tool',
|
|
69
|
+
id: 'greet',
|
|
70
|
+
toolId: 'create-greeting',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const workflow = mastra.getWorkflow('greeting-workflow')
|
|
76
|
+
const run = await workflow.createRun()
|
|
77
|
+
const result = await run.start({
|
|
78
|
+
inputData: { name: 'Ada' },
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
if (result.status === 'success') {
|
|
82
|
+
console.log(result.result.message)
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The workflow prints `Hello, Ada!`. Calling [`addStoredWorkflow()`](https://mastra.ai/reference/core/addStoredWorkflow) validates the definition before it changes storage or the live workflow registry.
|
|
87
|
+
|
|
88
|
+
The definition uses JSON Schema because it must survive a JSON round trip. The `graph` describes which registered components to invoke and how data moves between them. See the [stored workflow definition reference](https://mastra.ai/reference/workflows/stored-workflow-definition) for every field and graph entry.
|
|
89
|
+
|
|
90
|
+
## Build and update definitions
|
|
91
|
+
|
|
92
|
+
A definition can come from any source that produces JSON. For example, an API route can accept a definition created by a visual editor and register it directly:
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
const definition = await request.json()
|
|
96
|
+
await mastra.addStoredWorkflow(definition)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Register dependencies first
|
|
100
|
+
|
|
101
|
+
Register referenced components on the same `Mastra` instance before adding the stored workflow. Agent and nested workflow entries use their intrinsic IDs. A tool entry uses its key from the `Mastra` `tools` object, so the quickstart registers the tool under `create-greeting` before referencing that key with `toolId`.
|
|
102
|
+
|
|
103
|
+
Use a `mapping` entry when one step's output doesn't match the next step's input. Mapping entries can read data from the workflow input and previous step results, along with workflow state and request context. The [definition reference](https://mastra.ai/reference/workflows/stored-workflow-definition) lists the supported mapping descriptors.
|
|
104
|
+
|
|
105
|
+
### Replace a workflow
|
|
106
|
+
|
|
107
|
+
Add a new definition with the same `id` to replace the persisted definition and live registration:
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
await mastra.addStoredWorkflow(updatedDefinition)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
New runs use the updated graph. Runs that already started continue with their original graph.
|
|
114
|
+
|
|
115
|
+
### Add nested workflows together
|
|
116
|
+
|
|
117
|
+
When a root workflow references helper workflows that aren't registered yet, add the full set with [`addStoredWorkflows()`](https://mastra.ai/reference/core/addStoredWorkflows):
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
await mastra.addStoredWorkflows([rootDefinition, helperDefinition])
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Mastra validates the bundle as a unit and determines the registration order from the dependencies. If validation fails, none of the definitions are registered.
|
|
124
|
+
|
|
125
|
+
### Manage definitions over HTTP
|
|
126
|
+
|
|
127
|
+
Applications don't need direct access to the `Mastra` instance to manage stored workflows. Use one of these interfaces:
|
|
128
|
+
|
|
129
|
+
- [Client SDK workflows API](https://mastra.ai/reference/client-js/workflows): Call `upsertStoredWorkflow()` from a JavaScript or TypeScript client.
|
|
130
|
+
- [Server routes](https://mastra.ai/reference/server/routes): Send definitions to `POST /api/stored/workflows`.
|
|
131
|
+
|
|
132
|
+
On authenticated servers, stored-workflow management requires the `stored-workflows:read` and `stored-workflows:write` permissions. Running the registered workflow requires `workflows:execute`.
|
|
133
|
+
|
|
134
|
+
### Persist definitions
|
|
135
|
+
|
|
136
|
+
Stored definitions use the `workflowDefinitions` storage domain. On startup, Mastra loads active definitions from storage and registers them in dependency order.
|
|
137
|
+
|
|
138
|
+
Without a storage adapter that supports this domain, `addStoredWorkflow()` still registers the workflow in memory, but the definition is lost when the process restarts. See the [storage reference](https://mastra.ai/reference/storage/overview) for adapter support.
|
|
139
|
+
|
|
140
|
+
## Related
|
|
141
|
+
|
|
142
|
+
- [Stored workflow definition](https://mastra.ai/reference/workflows/stored-workflow-definition)
|
|
143
|
+
- [`Mastra.addStoredWorkflow()`](https://mastra.ai/reference/core/addStoredWorkflow)
|
|
144
|
+
- [`Mastra.addStoredWorkflows()`](https://mastra.ai/reference/core/addStoredWorkflows)
|
|
145
|
+
- [Client SDK workflows API](https://mastra.ai/reference/client-js/workflows)
|
|
146
|
+
- [Server routes](https://mastra.ai/reference/server/routes)
|
|
@@ -101,7 +101,6 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
101
101
|
| [NanoGPT](https://mastra.ai/models/providers/nano-gpt) | `nano-gpt/*` | `NANO_GPT_API_KEY` |
|
|
102
102
|
| [NEAR AI Cloud](https://mastra.ai/models/providers/nearai) | `nearai/*` | `NEARAI_API_KEY` |
|
|
103
103
|
| [Nebius Token Factory](https://mastra.ai/models/providers/nebius) | `nebius/*` | `NEBIUS_API_KEY` |
|
|
104
|
-
| [Neon](https://mastra.ai/models/providers/neon) | `neon/*` | `NEON_AI_GATEWAY_BASE_URL`, `NEON_AI_GATEWAY_TOKEN` |
|
|
105
104
|
| [Neuralwatt](https://mastra.ai/models/providers/neuralwatt) | `neuralwatt/*` | `NEURALWATT_API_KEY` |
|
|
106
105
|
| [Nova](https://mastra.ai/models/providers/nova) | `nova/*` | `NOVA_API_KEY` |
|
|
107
106
|
| [NovitaAI](https://mastra.ai/models/providers/novita-ai) | `novita-ai/*` | `NOVITA_API_KEY` |
|
|
@@ -171,6 +170,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
171
170
|
| [Zhipu AI Coding Plan](https://mastra.ai/models/providers/zhipuai-coding-plan) | `zhipuai-coding-plan/*` | `ZHIPU_API_KEY` |
|
|
172
171
|
| [Azure OpenAI](https://mastra.ai/models/gateways/azure-openai) (Gateway) | `azure-openai/*` | `AZURE_API_KEY`, `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_SUBSCRIPTION_ID` |
|
|
173
172
|
| [Mastra](https://mastra.ai/models/gateways/mastra) (Gateway) | `mastra/*` | `MASTRA_GATEWAY_API_KEY` |
|
|
173
|
+
| [Neon](https://mastra.ai/models/gateways/neon) (Gateway) | `neon/*` | `NEON_AI_GATEWAY_BASE_URL`, `NEON_AI_GATEWAY_TOKEN` |
|
|
174
174
|
| [Netlify](https://mastra.ai/models/gateways/netlify) (Gateway) | `netlify/*` | `NETLIFY_TOKEN`, `NETLIFY_SITE_ID` |
|
|
175
175
|
| [OpenRouter](https://mastra.ai/models/gateways/openrouter) (Gateway) | `openrouter/*` | `OPENROUTER_API_KEY` |
|
|
176
176
|
| [Vercel](https://mastra.ai/models/gateways/vercel) (Gateway) | `vercel/*` | `AI_GATEWAY_API_KEY` |
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Neon
|
|
4
|
+
|
|
5
|
+
Neon aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 36 models through Mastra's model router.
|
|
6
|
+
|
|
7
|
+
Learn more in the [Neon documentation](https://neon.com/docs).
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { Agent } from '@mastra/core/agent'
|
|
13
|
+
|
|
14
|
+
const agent = new Agent({
|
|
15
|
+
id: 'my-agent',
|
|
16
|
+
name: 'My Agent',
|
|
17
|
+
instructions: 'You are a helpful assistant',
|
|
18
|
+
model: 'neon/claude-haiku-4-5',
|
|
19
|
+
})
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Neon documentation](https://neon.com/docs) for details.
|
|
23
|
+
|
|
24
|
+
## Configuration
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Gateway configuration
|
|
28
|
+
NEON_AI_GATEWAY_BASE_URL=https://your-base-url
|
|
29
|
+
NEON_AI_GATEWAY_TOKEN=your-gateway-key
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Available models
|
|
33
|
+
|
|
34
|
+
| Model |
|
|
35
|
+
| ----------------------------- |
|
|
36
|
+
| `claude-haiku-4-5` |
|
|
37
|
+
| `claude-opus-4-1` |
|
|
38
|
+
| `claude-opus-4-5` |
|
|
39
|
+
| `claude-opus-4-6` |
|
|
40
|
+
| `claude-opus-4-7` |
|
|
41
|
+
| `claude-opus-4-8` |
|
|
42
|
+
| `claude-sonnet-4` |
|
|
43
|
+
| `claude-sonnet-4-5` |
|
|
44
|
+
| `claude-sonnet-4-6` |
|
|
45
|
+
| `gemini-2-5-flash` |
|
|
46
|
+
| `gemini-2-5-pro` |
|
|
47
|
+
| `gemini-3-1-flash-lite` |
|
|
48
|
+
| `gemini-3-1-pro` |
|
|
49
|
+
| `gemini-3-5-flash` |
|
|
50
|
+
| `gemini-3-flash` |
|
|
51
|
+
| `gemini-3-pro` |
|
|
52
|
+
| `gemma-3-12b` |
|
|
53
|
+
| `gpt-5` |
|
|
54
|
+
| `gpt-5-1` |
|
|
55
|
+
| `gpt-5-1-codex-max` |
|
|
56
|
+
| `gpt-5-1-codex-mini` |
|
|
57
|
+
| `gpt-5-2` |
|
|
58
|
+
| `gpt-5-2-codex` |
|
|
59
|
+
| `gpt-5-3-codex` |
|
|
60
|
+
| `gpt-5-4` |
|
|
61
|
+
| `gpt-5-4-mini` |
|
|
62
|
+
| `gpt-5-4-nano` |
|
|
63
|
+
| `gpt-5-mini` |
|
|
64
|
+
| `gpt-5-nano` |
|
|
65
|
+
| `gpt-oss-120b` |
|
|
66
|
+
| `gpt-oss-20b` |
|
|
67
|
+
| `llama-4-maverick` |
|
|
68
|
+
| `meta-llama-3-1-8b-instruct` |
|
|
69
|
+
| `meta-llama-3-3-70b-instruct` |
|
|
70
|
+
| `qwen3-next-80b-a3b-instruct` |
|
|
71
|
+
| `qwen35-122b-a10b` |
|
|
@@ -82,7 +82,6 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
82
82
|
| `anthropic/claude-fable-5` |
|
|
83
83
|
| `anthropic/claude-haiku-4.5` |
|
|
84
84
|
| `anthropic/claude-opus-4` |
|
|
85
|
-
| `anthropic/claude-opus-4.1` |
|
|
86
85
|
| `anthropic/claude-opus-4.5` |
|
|
87
86
|
| `anthropic/claude-opus-4.6` |
|
|
88
87
|
| `anthropic/claude-opus-4.7` |
|
|
@@ -101,6 +100,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
101
100
|
| `bfl/flux-2-klein-9b` |
|
|
102
101
|
| `bfl/flux-2-max` |
|
|
103
102
|
| `bfl/flux-2-pro` |
|
|
103
|
+
| `bfl/flux-3-video` |
|
|
104
104
|
| `bfl/flux-kontext-max` |
|
|
105
105
|
| `bfl/flux-kontext-pro` |
|
|
106
106
|
| `bfl/flux-pro-1.0-fill` |
|
package/.docs/models/gateways.md
CHANGED
|
@@ -12,6 +12,7 @@ Create custom gateways for private LLM deployments or specialized provider integ
|
|
|
12
12
|
|
|
13
13
|
- [Azure OpenAI](https://mastra.ai/models/gateways/azure-openai)
|
|
14
14
|
- [Mastra](https://mastra.ai/models/gateways/mastra)
|
|
15
|
+
- [Neon](https://mastra.ai/models/gateways/neon)
|
|
15
16
|
- [Netlify](https://mastra.ai/models/gateways/netlify)
|
|
16
17
|
- [OpenRouter](https://mastra.ai/models/gateways/openrouter)
|
|
17
18
|
- [Vercel](https://mastra.ai/models/gateways/vercel)
|
package/.docs/models/index.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Model Providers
|
|
4
4
|
|
|
5
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
5
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 5336 models from 168 providers through a single API.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
@@ -40,7 +40,7 @@ for await (const chunk of stream) {
|
|
|
40
40
|
| `ambient/deepseek/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
41
41
|
| `ambient/deepseek/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
42
42
|
| `ambient/moonshotai/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
|
|
43
|
-
| `ambient/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.
|
|
43
|
+
| `ambient/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.70 | $4 |
|
|
44
44
|
| `ambient/stepfun/step-3.7-flash` | 262K | | | | | | $0.19 | $1 |
|
|
45
45
|
| `ambient/xiaomi/mimo-v2.5` | 1.0M | | | | | | $0.40 | $2 |
|
|
46
46
|
| `ambient/z-ai/glm-5.2` | 203K | | | | | | $1 | $4 |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Cortecs
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 105 Cortecs models through Mastra's model router. Authentication is handled automatically using the `CORTECS_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Cortecs documentation](https://cortecs.ai).
|
|
8
8
|
|
|
@@ -17,7 +17,7 @@ const agent = new Agent({
|
|
|
17
17
|
id: "my-agent",
|
|
18
18
|
name: "My Agent",
|
|
19
19
|
instructions: "You are a helpful assistant",
|
|
20
|
-
model: "cortecs/
|
|
20
|
+
model: "cortecs/apertus-70b"
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
// Generate a response
|
|
@@ -34,67 +34,113 @@ for await (const chunk of stream) {
|
|
|
34
34
|
|
|
35
35
|
## Models
|
|
36
36
|
|
|
37
|
-
| Model
|
|
38
|
-
|
|
|
39
|
-
| `cortecs/
|
|
40
|
-
| `cortecs/claude-4-
|
|
41
|
-
| `cortecs/claude-
|
|
42
|
-
| `cortecs/claude-
|
|
43
|
-
| `cortecs/claude-
|
|
44
|
-
| `cortecs/claude-opus4-
|
|
45
|
-
| `cortecs/claude-opus4-
|
|
46
|
-
| `cortecs/claude-
|
|
47
|
-
| `cortecs/
|
|
48
|
-
| `cortecs/
|
|
49
|
-
| `cortecs/
|
|
50
|
-
| `cortecs/
|
|
51
|
-
| `cortecs/
|
|
52
|
-
| `cortecs/deepseek-
|
|
53
|
-
| `cortecs/deepseek-
|
|
54
|
-
| `cortecs/
|
|
55
|
-
| `cortecs/
|
|
56
|
-
| `cortecs/
|
|
57
|
-
| `cortecs/
|
|
58
|
-
| `cortecs/
|
|
59
|
-
| `cortecs/
|
|
60
|
-
| `cortecs/
|
|
61
|
-
| `cortecs/
|
|
62
|
-
| `cortecs/
|
|
63
|
-
| `cortecs/
|
|
64
|
-
| `cortecs/
|
|
65
|
-
| `cortecs/
|
|
66
|
-
| `cortecs/
|
|
67
|
-
| `cortecs/
|
|
68
|
-
| `cortecs/
|
|
69
|
-
| `cortecs/
|
|
70
|
-
| `cortecs/
|
|
71
|
-
| `cortecs/
|
|
72
|
-
| `cortecs/
|
|
73
|
-
| `cortecs/
|
|
74
|
-
| `cortecs/
|
|
75
|
-
| `cortecs/
|
|
76
|
-
| `cortecs/
|
|
77
|
-
| `cortecs/
|
|
78
|
-
| `cortecs/
|
|
79
|
-
| `cortecs/
|
|
80
|
-
| `cortecs/
|
|
81
|
-
| `cortecs/
|
|
82
|
-
| `cortecs/
|
|
83
|
-
| `cortecs/
|
|
84
|
-
| `cortecs/
|
|
85
|
-
| `cortecs/
|
|
86
|
-
| `cortecs/
|
|
87
|
-
| `cortecs/
|
|
88
|
-
| `cortecs/
|
|
89
|
-
| `cortecs/
|
|
90
|
-
| `cortecs/
|
|
91
|
-
| `cortecs/
|
|
92
|
-
| `cortecs/
|
|
93
|
-
| `cortecs/
|
|
94
|
-
| `cortecs/
|
|
95
|
-
| `cortecs/
|
|
96
|
-
| `cortecs/
|
|
97
|
-
| `cortecs/
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| --------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `cortecs/apertus-70b` | 66K | | | | | | $1 | $2 |
|
|
40
|
+
| `cortecs/claude-4-5-sonnet` | 200K | | | | | | $3 | $15 |
|
|
41
|
+
| `cortecs/claude-4-6-sonnet` | 1.0M | | | | | | $3 | $16 |
|
|
42
|
+
| `cortecs/claude-haiku-4-5` | 200K | | | | | | $1.00 | $5 |
|
|
43
|
+
| `cortecs/claude-opus-5` | 1.0M | | | | | | $6 | $27 |
|
|
44
|
+
| `cortecs/claude-opus4-5` | 200K | | | | | | $5 | $27 |
|
|
45
|
+
| `cortecs/claude-opus4-6` | 1.0M | | | | | | $5 | $27 |
|
|
46
|
+
| `cortecs/claude-opus4-7` | 1.0M | | | | | | $5 | $27 |
|
|
47
|
+
| `cortecs/claude-opus4-8` | 1.0M | | | | | | $5 | $27 |
|
|
48
|
+
| `cortecs/claude-sonnet-4` | 200K | | | | | | $3 | $14 |
|
|
49
|
+
| `cortecs/claude-sonnet-5` | 1.0M | | | | | | $2 | $11 |
|
|
50
|
+
| `cortecs/codestral-2508` | 256K | | | | | | $0.33 | $1 |
|
|
51
|
+
| `cortecs/cosmos3-super-reasoner` | 256K | | | | | | $0.10 | $0.30 |
|
|
52
|
+
| `cortecs/deepseek-r1-0528` | 164K | | | | | | $0.65 | $3 |
|
|
53
|
+
| `cortecs/deepseek-v3.2` | 164K | | | | | | $0.30 | $0.49 |
|
|
54
|
+
| `cortecs/deepseek-v4-flash` | 1.0M | | | | | | $0.15 | $0.30 |
|
|
55
|
+
| `cortecs/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.25 | $0.30 |
|
|
56
|
+
| `cortecs/deepseek-v4-pro` | 1.0M | | | | | | $2 | $3 |
|
|
57
|
+
| `cortecs/devstral-2512` | 262K | | | | | | $0.45 | $2 |
|
|
58
|
+
| `cortecs/gemini-2.5-flash` | 1.0M | | | | | | $0.30 | $2 |
|
|
59
|
+
| `cortecs/gemini-2.5-pro` | 1.0M | | | | | | $1 | $10 |
|
|
60
|
+
| `cortecs/gemini-3.1-flash-lite` | 1.0M | | | | | | $0.27 | $2 |
|
|
61
|
+
| `cortecs/gemini-3.5-flash` | 1.0M | | | | | | $1 | $9 |
|
|
62
|
+
| `cortecs/gemma-3-27b-it` | 131K | | | | | | $0.10 | $0.30 |
|
|
63
|
+
| `cortecs/gemma-4-26b-a4b-it` | 262K | | | | | | $0.11 | $0.56 |
|
|
64
|
+
| `cortecs/gemma-4-31b-it` | 262K | | | | | | $0.22 | $0.39 |
|
|
65
|
+
| `cortecs/glm-4.7` | 203K | | | | | | $0.78 | $3 |
|
|
66
|
+
| `cortecs/glm-4.7-flash` | 203K | | | | | | $0.08 | $0.48 |
|
|
67
|
+
| `cortecs/glm-5` | 203K | | | | | | $0.99 | $3 |
|
|
68
|
+
| `cortecs/glm-5-turbo` | 203K | | | | | | $1 | $4 |
|
|
69
|
+
| `cortecs/glm-5.1` | 203K | | | | | | $1 | $4 |
|
|
70
|
+
| `cortecs/glm-5.2` | 1.0M | | | | | | $1 | $4 |
|
|
71
|
+
| `cortecs/glm-5v-turbo` | 203K | | | | | | $1 | $4 |
|
|
72
|
+
| `cortecs/gpt-4.1` | 1.0M | | | | | | $2 | $9 |
|
|
73
|
+
| `cortecs/gpt-4.1-mini` | 1.0M | | | | | | $0.43 | $2 |
|
|
74
|
+
| `cortecs/gpt-4.1-nano` | 1.0M | | | | | | $0.11 | $0.43 |
|
|
75
|
+
| `cortecs/gpt-4o` | 128K | | | | | | $3 | $11 |
|
|
76
|
+
| `cortecs/gpt-4o-mini` | 128K | | | | | | $0.16 | $0.64 |
|
|
77
|
+
| `cortecs/gpt-5` | 400K | | | | | | $1 | $11 |
|
|
78
|
+
| `cortecs/gpt-5-mini` | 400K | | | | | | $0.28 | $2 |
|
|
79
|
+
| `cortecs/gpt-5-nano` | 400K | | | | | | $0.06 | $0.44 |
|
|
80
|
+
| `cortecs/gpt-5.1` | 400K | | | | | | $1 | $11 |
|
|
81
|
+
| `cortecs/gpt-5.4` | 1.1M | | | | | | $3 | $15 |
|
|
82
|
+
| `cortecs/gpt-5.6-luna` | 1.1M | | | | | | $1 | $7 |
|
|
83
|
+
| `cortecs/gpt-5.6-sol` | 1.1M | | | | | | $6 | $33 |
|
|
84
|
+
| `cortecs/gpt-5.6-terra` | 1.1M | | | | | | $3 | $16 |
|
|
85
|
+
| `cortecs/gpt-oss-120b` | 131K | | | | | | $0.09 | $0.45 |
|
|
86
|
+
| `cortecs/gpt-oss-20b` | 131K | | | | | | $0.04 | $0.17 |
|
|
87
|
+
| `cortecs/gpt-oss-safeguard-120b` | 128K | | | | | | $0.18 | $0.70 |
|
|
88
|
+
| `cortecs/hermes-4-405b` | 128K | | | | | | $1.00 | $3 |
|
|
89
|
+
| `cortecs/hermes-4-70b` | 128K | | | | | | $0.13 | $0.40 |
|
|
90
|
+
| `cortecs/holo2-30b-a3b` | 22K | | | | | | $0.33 | $0.78 |
|
|
91
|
+
| `cortecs/kimi-k2.5` | 262K | | | | | | $0.49 | $3 |
|
|
92
|
+
| `cortecs/kimi-k2.6` | 262K | | | | | | $0.77 | $3 |
|
|
93
|
+
| `cortecs/kimi-k2.7-code` | 262K | | | | | | $0.75 | $4 |
|
|
94
|
+
| `cortecs/kimi-k3` | 1.0M | | | | | | $3 | $15 |
|
|
95
|
+
| `cortecs/llama-3.1-405b-instruct` | 128K | | | | | | $2 | $2 |
|
|
96
|
+
| `cortecs/llama-3.1-8b-instruct` | 128K | | | | | | $0.17 | $0.17 |
|
|
97
|
+
| `cortecs/llama-3.1-nemotron-ultra-253b-v1` | 128K | | | | | | $0.60 | $2 |
|
|
98
|
+
| `cortecs/llama-3.3-70b-instruct` | 131K | | | | | | $0.13 | $0.40 |
|
|
99
|
+
| `cortecs/minicpm-v-4.5` | 32K | | | | | | $0.65 | $1 |
|
|
100
|
+
| `cortecs/minimax-m2` | 400K | | | | | | $0.35 | $1 |
|
|
101
|
+
| `cortecs/minimax-m2.1` | 196K | | | | | | $0.36 | $1 |
|
|
102
|
+
| `cortecs/minimax-m2.5` | 197K | | | | | | $0.30 | $1 |
|
|
103
|
+
| `cortecs/minimax-m2.7` | 197K | | | | | | $0.67 | $3 |
|
|
104
|
+
| `cortecs/minimax-m3` | 1.0M | | | | | | $0.40 | $2 |
|
|
105
|
+
| `cortecs/ministral-14b-2512` | 256K | | | | | | $0.22 | $0.22 |
|
|
106
|
+
| `cortecs/ministral-3b-2512` | 256K | | | | | | $0.11 | $0.11 |
|
|
107
|
+
| `cortecs/ministral-8b-2512` | 256K | | | | | | $0.17 | $0.17 |
|
|
108
|
+
| `cortecs/mistral-7b-instruct-v0.2` | 32K | | | | | | $0.16 | $0.22 |
|
|
109
|
+
| `cortecs/mistral-7b-instruct-v0.3` | 127K | | | | | | $0.11 | $0.11 |
|
|
110
|
+
| `cortecs/mistral-large-2402` | 32K | | | | | | $4 | $13 |
|
|
111
|
+
| `cortecs/mistral-large-2512` | 256K | | | | | | $0.56 | $2 |
|
|
112
|
+
| `cortecs/mistral-medium-2508` | 128K | | | | | | $0.45 | $2 |
|
|
113
|
+
| `cortecs/mistral-medium-3.5` | 256K | | | | | | $2 | $6 |
|
|
114
|
+
| `cortecs/mistral-nemo-instruct-2407` | 128K | | | | | | $0.14 | $0.14 |
|
|
115
|
+
| `cortecs/mistral-small-2503` | 128K | | | | | | $0.11 | $0.33 |
|
|
116
|
+
| `cortecs/mistral-small-2603` | 262K | | | | | | $0.14 | $0.57 |
|
|
117
|
+
| `cortecs/mistral-small-3.2-24b-instruct-2506` | 131K | | | | | | $0.10 | $0.31 |
|
|
118
|
+
| `cortecs/mixtral-8x7B-instruct-v0.1` | 32K | | | | | | $0.49 | $0.76 |
|
|
119
|
+
| `cortecs/nemotron-nano-v2-12b` | 128K | | | | | | $0.24 | $0.71 |
|
|
120
|
+
| `cortecs/nova-2-lite` | 1.0M | | | | | | $0.37 | $3 |
|
|
121
|
+
| `cortecs/nova-lite-v1` | 300K | | | | | | $0.07 | $0.28 |
|
|
122
|
+
| `cortecs/nova-micro-v1` | 128K | | | | | | $0.04 | $0.16 |
|
|
123
|
+
| `cortecs/nova-pro-v1` | 300K | | | | | | $0.92 | $4 |
|
|
124
|
+
| `cortecs/nvidia-nemotron-3-nano-30b-a3b` | 256K | | | | | | $0.06 | $0.24 |
|
|
125
|
+
| `cortecs/nvidia-nemotron-3-nano-omni` | 300K | | | | | | $0.06 | $0.24 |
|
|
126
|
+
| `cortecs/pixtral-12b-2409` | 128K | | | | | | $0.22 | $0.22 |
|
|
127
|
+
| `cortecs/pixtral-large-2502` | 128K | | | | | | $2 | $6 |
|
|
128
|
+
| `cortecs/qwen2.5-vl-72b-instruct` | 32K | | | | | | $0.25 | $0.75 |
|
|
129
|
+
| `cortecs/qwen3-235b-a22b-instruct-2507` | 262K | | | | | | $0.07 | $0.46 |
|
|
130
|
+
| `cortecs/qwen3-30b-a3b-instruct-2507` | 262K | | | | | | $0.10 | $0.30 |
|
|
131
|
+
| `cortecs/qwen3-32b` | 40K | | | | | | $0.10 | $0.30 |
|
|
132
|
+
| `cortecs/qwen3-coder-30b-a3b-instruct` | 262K | | | | | | $0.07 | $0.24 |
|
|
133
|
+
| `cortecs/qwen3-coder-next` | 256K | | | | | | $0.17 | $0.89 |
|
|
134
|
+
| `cortecs/qwen3-next-80b-a3b-thinking` | 128K | | | | | | $0.15 | $1 |
|
|
135
|
+
| `cortecs/qwen3-vl-235b-a22b` | 256K | | | | | | $0.62 | $3 |
|
|
136
|
+
| `cortecs/qwen3.5-122b-a10b` | 262K | | | | | | $0.49 | $3 |
|
|
137
|
+
| `cortecs/qwen3.5-397b-a17b` | 262K | | | | | | $0.67 | $4 |
|
|
138
|
+
| `cortecs/qwen3.5-9b` | 262K | | | | | | $0.11 | $0.17 |
|
|
139
|
+
| `cortecs/qwen3.6-27b` | 262K | | | | | | $0.45 | $3 |
|
|
140
|
+
| `cortecs/qwen3.6-35b-a3b` | 262K | | | | | | $0.17 | $0.56 |
|
|
141
|
+
| `cortecs/qwen3guard-gen-0.6b` | 32K | | | | | | — | — |
|
|
142
|
+
| `cortecs/qwen3guard-gen-8b` | 32K | | | | | | — | — |
|
|
143
|
+
| `cortecs/voxtral-small-2507` | 32K | | | | | | $0.11 | $0.33 |
|
|
98
144
|
|
|
99
145
|
## Advanced configuration
|
|
100
146
|
|
|
@@ -106,7 +152,7 @@ const agent = new Agent({
|
|
|
106
152
|
name: "custom-agent",
|
|
107
153
|
model: {
|
|
108
154
|
url: "https://api.cortecs.ai/v1",
|
|
109
|
-
id: "cortecs/
|
|
155
|
+
id: "cortecs/apertus-70b",
|
|
110
156
|
apiKey: process.env.CORTECS_API_KEY,
|
|
111
157
|
headers: {
|
|
112
158
|
"X-Custom-Header": "value"
|
|
@@ -124,8 +170,8 @@ const agent = new Agent({
|
|
|
124
170
|
model: ({ requestContext }) => {
|
|
125
171
|
const useAdvanced = requestContext.task === "complex";
|
|
126
172
|
return useAdvanced
|
|
127
|
-
? "cortecs/
|
|
128
|
-
: "cortecs/
|
|
173
|
+
? "cortecs/voxtral-small-2507"
|
|
174
|
+
: "cortecs/apertus-70b";
|
|
129
175
|
}
|
|
130
176
|
});
|
|
131
177
|
```
|