@mastra/mcp-docs-server 1.1.5 → 1.1.6-alpha.0
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/adding-voice.md +349 -0
- package/.docs/docs/agents/agent-approval.md +558 -0
- package/.docs/docs/agents/agent-memory.md +209 -0
- package/.docs/docs/agents/guardrails.md +374 -0
- package/.docs/docs/agents/network-approval.md +275 -0
- package/.docs/docs/agents/networks.md +299 -0
- package/.docs/docs/agents/overview.md +304 -0
- package/.docs/docs/agents/processors.md +622 -0
- package/.docs/docs/agents/structured-output.md +273 -0
- package/.docs/docs/agents/supervisor-agents.md +304 -0
- package/.docs/docs/agents/using-tools.md +214 -0
- package/.docs/docs/build-with-ai/mcp-docs-server.md +238 -0
- package/.docs/docs/build-with-ai/skills.md +35 -0
- package/.docs/docs/community/contributing-templates.md +3 -0
- package/.docs/docs/community/discord.md +9 -0
- package/.docs/docs/community/licensing.md +66 -0
- package/.docs/docs/deployment/cloud-providers.md +15 -0
- package/.docs/docs/deployment/mastra-server.md +122 -0
- package/.docs/docs/deployment/monorepo.md +142 -0
- package/.docs/docs/deployment/overview.md +62 -0
- package/.docs/docs/deployment/studio.md +239 -0
- package/.docs/docs/deployment/web-framework.md +52 -0
- package/.docs/docs/deployment/workflow-runners.md +9 -0
- package/.docs/docs/evals/built-in-scorers.md +47 -0
- package/.docs/docs/evals/custom-scorers.md +519 -0
- package/.docs/docs/evals/overview.md +141 -0
- package/.docs/docs/evals/running-in-ci.md +124 -0
- package/.docs/docs/getting-started/build-with-ai.md +68 -0
- package/.docs/docs/getting-started/manual-install.md +226 -0
- package/.docs/docs/getting-started/project-structure.md +60 -0
- package/.docs/docs/getting-started/start.md +28 -0
- package/.docs/docs/getting-started/studio.md +101 -0
- package/.docs/docs/index.md +43 -0
- package/.docs/docs/mastra-cloud/deployment.md +77 -0
- package/.docs/docs/mastra-cloud/observability.md +38 -0
- package/.docs/docs/mastra-cloud/overview.md +23 -0
- package/.docs/docs/mastra-cloud/setup.md +42 -0
- package/.docs/docs/mastra-cloud/studio.md +24 -0
- package/.docs/docs/mastra-code/configuration.md +299 -0
- package/.docs/docs/mastra-code/customization.md +228 -0
- package/.docs/docs/mastra-code/modes.md +104 -0
- package/.docs/docs/mastra-code/overview.md +135 -0
- package/.docs/docs/mastra-code/tools.md +229 -0
- package/.docs/docs/mcp/overview.md +373 -0
- package/.docs/docs/mcp/publishing-mcp-server.md +95 -0
- package/.docs/docs/memory/memory-processors.md +314 -0
- package/.docs/docs/memory/message-history.md +260 -0
- package/.docs/docs/memory/observational-memory.md +248 -0
- package/.docs/docs/memory/overview.md +45 -0
- package/.docs/docs/memory/semantic-recall.md +272 -0
- package/.docs/docs/memory/storage.md +261 -0
- package/.docs/docs/memory/working-memory.md +400 -0
- package/.docs/docs/observability/datasets/overview.md +198 -0
- package/.docs/docs/observability/datasets/running-experiments.md +274 -0
- package/.docs/docs/observability/logging.md +99 -0
- package/.docs/docs/observability/overview.md +70 -0
- package/.docs/docs/observability/tracing/bridges/otel.md +209 -0
- package/.docs/docs/observability/tracing/exporters/arize.md +272 -0
- package/.docs/docs/observability/tracing/exporters/braintrust.md +111 -0
- package/.docs/docs/observability/tracing/exporters/cloud.md +127 -0
- package/.docs/docs/observability/tracing/exporters/datadog.md +187 -0
- package/.docs/docs/observability/tracing/exporters/default.md +209 -0
- package/.docs/docs/observability/tracing/exporters/laminar.md +100 -0
- package/.docs/docs/observability/tracing/exporters/langfuse.md +213 -0
- package/.docs/docs/observability/tracing/exporters/langsmith.md +198 -0
- package/.docs/docs/observability/tracing/exporters/otel.md +476 -0
- package/.docs/docs/observability/tracing/exporters/posthog.md +148 -0
- package/.docs/docs/observability/tracing/exporters/sentry.md +208 -0
- package/.docs/docs/observability/tracing/overview.md +1112 -0
- package/.docs/docs/observability/tracing/processors/sensitive-data-filter.md +300 -0
- package/.docs/docs/rag/chunking-and-embedding.md +183 -0
- package/.docs/docs/rag/graph-rag.md +215 -0
- package/.docs/docs/rag/overview.md +72 -0
- package/.docs/docs/rag/retrieval.md +515 -0
- package/.docs/docs/rag/vector-databases.md +645 -0
- package/.docs/docs/server/auth/auth0.md +220 -0
- package/.docs/docs/server/auth/better-auth.md +203 -0
- package/.docs/docs/server/auth/clerk.md +132 -0
- package/.docs/docs/server/auth/composite-auth.md +234 -0
- package/.docs/docs/server/auth/custom-auth-provider.md +513 -0
- package/.docs/docs/server/auth/firebase.md +272 -0
- package/.docs/docs/server/auth/jwt.md +110 -0
- package/.docs/docs/server/auth/simple-auth.md +180 -0
- package/.docs/docs/server/auth/supabase.md +117 -0
- package/.docs/docs/server/auth/workos.md +186 -0
- package/.docs/docs/server/auth.md +38 -0
- package/.docs/docs/server/custom-adapters.md +378 -0
- package/.docs/docs/server/custom-api-routes.md +267 -0
- package/.docs/docs/server/mastra-client.md +243 -0
- package/.docs/docs/server/mastra-server.md +71 -0
- package/.docs/docs/server/middleware.md +225 -0
- package/.docs/docs/server/request-context.md +471 -0
- package/.docs/docs/server/server-adapters.md +547 -0
- package/.docs/docs/streaming/events.md +237 -0
- package/.docs/docs/streaming/overview.md +175 -0
- package/.docs/docs/streaming/tool-streaming.md +175 -0
- package/.docs/docs/streaming/workflow-streaming.md +109 -0
- package/.docs/docs/voice/overview.md +959 -0
- package/.docs/docs/voice/speech-to-speech.md +102 -0
- package/.docs/docs/voice/speech-to-text.md +79 -0
- package/.docs/docs/voice/text-to-speech.md +83 -0
- package/.docs/docs/workflows/agents-and-tools.md +166 -0
- package/.docs/docs/workflows/control-flow.md +822 -0
- package/.docs/docs/workflows/error-handling.md +360 -0
- package/.docs/docs/workflows/human-in-the-loop.md +215 -0
- package/.docs/docs/workflows/overview.md +370 -0
- package/.docs/docs/workflows/snapshots.md +238 -0
- package/.docs/docs/workflows/suspend-and-resume.md +205 -0
- package/.docs/docs/workflows/time-travel.md +309 -0
- package/.docs/docs/workflows/workflow-state.md +181 -0
- package/.docs/docs/workspace/filesystem.md +164 -0
- package/.docs/docs/workspace/overview.md +239 -0
- package/.docs/docs/workspace/sandbox.md +63 -0
- package/.docs/docs/workspace/search.md +243 -0
- package/.docs/docs/workspace/skills.md +169 -0
- package/.docs/guides/agent-frameworks/ai-sdk.md +140 -0
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +1499 -0
- package/.docs/guides/build-your-ui/assistant-ui.md +156 -0
- package/.docs/guides/build-your-ui/copilotkit.md +289 -0
- package/.docs/guides/deployment/amazon-ec2.md +130 -0
- package/.docs/guides/deployment/aws-lambda.md +248 -0
- package/.docs/guides/deployment/azure-app-services.md +114 -0
- package/.docs/guides/deployment/cloudflare.md +99 -0
- package/.docs/guides/deployment/digital-ocean.md +168 -0
- package/.docs/guides/deployment/inngest.md +682 -0
- package/.docs/guides/deployment/netlify.md +77 -0
- package/.docs/guides/deployment/vercel.md +101 -0
- package/.docs/guides/getting-started/astro.md +398 -0
- package/.docs/guides/getting-started/electron.md +504 -0
- package/.docs/guides/getting-started/express.md +251 -0
- package/.docs/guides/getting-started/hono.md +190 -0
- package/.docs/guides/getting-started/next-js.md +347 -0
- package/.docs/guides/getting-started/nuxt.md +497 -0
- package/.docs/guides/getting-started/quickstart.md +67 -0
- package/.docs/guides/getting-started/sveltekit.md +296 -0
- package/.docs/guides/getting-started/vite-react.md +425 -0
- package/.docs/guides/guide/ai-recruiter.md +226 -0
- package/.docs/guides/guide/chef-michel.md +211 -0
- package/.docs/guides/guide/code-review-bot.md +226 -0
- package/.docs/guides/guide/dev-assistant.md +307 -0
- package/.docs/guides/guide/docs-manager.md +238 -0
- package/.docs/guides/guide/github-actions-pr-description.md +236 -0
- package/.docs/guides/guide/notes-mcp-server.md +416 -0
- package/.docs/guides/guide/research-assistant.md +348 -0
- package/.docs/guides/guide/research-coordinator.md +416 -0
- package/.docs/guides/guide/stock-agent.md +132 -0
- package/.docs/guides/guide/web-search.md +320 -0
- package/.docs/guides/guide/whatsapp-chat-bot.md +405 -0
- package/.docs/guides/index.md +3 -0
- package/.docs/guides/migrations/agentnetwork.md +97 -0
- package/.docs/guides/migrations/ai-sdk-v4-to-v5.md +112 -0
- package/.docs/guides/migrations/network-to-supervisor.md +261 -0
- package/.docs/guides/migrations/upgrade-to-v1/agent.md +404 -0
- package/.docs/guides/migrations/upgrade-to-v1/cli.md +57 -0
- package/.docs/guides/migrations/upgrade-to-v1/client.md +337 -0
- package/.docs/guides/migrations/upgrade-to-v1/deployment.md +37 -0
- package/.docs/guides/migrations/upgrade-to-v1/evals.md +239 -0
- package/.docs/guides/migrations/upgrade-to-v1/mastra.md +143 -0
- package/.docs/guides/migrations/upgrade-to-v1/mcp.md +97 -0
- package/.docs/guides/migrations/upgrade-to-v1/memory.md +285 -0
- package/.docs/guides/migrations/upgrade-to-v1/overview.md +119 -0
- package/.docs/guides/migrations/upgrade-to-v1/processors.md +68 -0
- package/.docs/guides/migrations/upgrade-to-v1/rag.md +42 -0
- package/.docs/guides/migrations/upgrade-to-v1/storage.md +553 -0
- package/.docs/guides/migrations/upgrade-to-v1/tools.md +180 -0
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +412 -0
- package/.docs/guides/migrations/upgrade-to-v1/vectors.md +87 -0
- package/.docs/guides/migrations/upgrade-to-v1/voice.md +30 -0
- package/.docs/guides/migrations/upgrade-to-v1/workflows.md +341 -0
- package/.docs/guides/migrations/vnext-to-standard-apis.md +362 -0
- package/.docs/models/embeddings.md +161 -0
- package/.docs/models/gateways/azure-openai.md +128 -0
- package/.docs/models/gateways/custom-gateways.md +545 -0
- package/.docs/models/gateways/netlify.md +88 -0
- package/.docs/models/gateways/openrouter.md +219 -0
- package/.docs/models/gateways/vercel.md +225 -0
- package/.docs/models/gateways.md +14 -0
- package/.docs/models/index.md +286 -0
- package/.docs/models/providers/302ai.md +134 -0
- package/.docs/models/providers/abacus.md +125 -0
- package/.docs/models/providers/agentrouter.md +90 -0
- package/.docs/models/providers/aihubmix.md +107 -0
- package/.docs/models/providers/alibaba-cn.md +135 -0
- package/.docs/models/providers/alibaba.md +111 -0
- package/.docs/models/providers/amazon-bedrock.md +33 -0
- package/.docs/models/providers/anthropic.md +153 -0
- package/.docs/models/providers/azure.md +33 -0
- package/.docs/models/providers/bailing.md +72 -0
- package/.docs/models/providers/baseten.md +77 -0
- package/.docs/models/providers/berget.md +78 -0
- package/.docs/models/providers/cerebras.md +101 -0
- package/.docs/models/providers/chutes.md +136 -0
- package/.docs/models/providers/cloudflare-ai-gateway.md +33 -0
- package/.docs/models/providers/cloudflare-workers-ai.md +109 -0
- package/.docs/models/providers/cohere.md +33 -0
- package/.docs/models/providers/cortecs.md +91 -0
- package/.docs/models/providers/deepinfra.md +112 -0
- package/.docs/models/providers/deepseek.md +88 -0
- package/.docs/models/providers/fastrouter.md +84 -0
- package/.docs/models/providers/fireworks-ai.md +89 -0
- package/.docs/models/providers/firmware.md +85 -0
- package/.docs/models/providers/friendli.md +78 -0
- package/.docs/models/providers/github-models.md +125 -0
- package/.docs/models/providers/google-vertex.md +33 -0
- package/.docs/models/providers/google.md +159 -0
- package/.docs/models/providers/groq.md +107 -0
- package/.docs/models/providers/helicone.md +161 -0
- package/.docs/models/providers/huggingface.md +90 -0
- package/.docs/models/providers/iflowcn.md +84 -0
- package/.docs/models/providers/inception.md +72 -0
- package/.docs/models/providers/inference.md +79 -0
- package/.docs/models/providers/io-intelligence.md +87 -0
- package/.docs/models/providers/io-net.md +87 -0
- package/.docs/models/providers/jiekou.md +131 -0
- package/.docs/models/providers/kilo.md +333 -0
- package/.docs/models/providers/kimi-for-coding.md +100 -0
- package/.docs/models/providers/kuae-cloud-coding-plan.md +71 -0
- package/.docs/models/providers/llama.md +77 -0
- package/.docs/models/providers/lmstudio.md +73 -0
- package/.docs/models/providers/lucidquery.md +72 -0
- package/.docs/models/providers/minimax-cn-coding-plan.md +102 -0
- package/.docs/models/providers/minimax-cn.md +102 -0
- package/.docs/models/providers/minimax-coding-plan.md +102 -0
- package/.docs/models/providers/minimax.md +104 -0
- package/.docs/models/providers/mistral.md +124 -0
- package/.docs/models/providers/moark.md +72 -0
- package/.docs/models/providers/modelscope.md +77 -0
- package/.docs/models/providers/moonshotai-cn.md +76 -0
- package/.docs/models/providers/moonshotai.md +76 -0
- package/.docs/models/providers/morph.md +73 -0
- package/.docs/models/providers/nano-gpt.md +103 -0
- package/.docs/models/providers/nebius.md +116 -0
- package/.docs/models/providers/nova.md +72 -0
- package/.docs/models/providers/novita-ai.md +154 -0
- package/.docs/models/providers/nvidia.md +141 -0
- package/.docs/models/providers/ollama-cloud.md +103 -0
- package/.docs/models/providers/ollama.md +33 -0
- package/.docs/models/providers/openai.md +193 -0
- package/.docs/models/providers/opencode.md +100 -0
- package/.docs/models/providers/ovhcloud.md +83 -0
- package/.docs/models/providers/perplexity.md +100 -0
- package/.docs/models/providers/poe.md +183 -0
- package/.docs/models/providers/privatemode-ai.md +75 -0
- package/.docs/models/providers/requesty.md +90 -0
- package/.docs/models/providers/scaleway.md +84 -0
- package/.docs/models/providers/siliconflow-cn.md +138 -0
- package/.docs/models/providers/siliconflow.md +140 -0
- package/.docs/models/providers/stackit.md +78 -0
- package/.docs/models/providers/stepfun.md +73 -0
- package/.docs/models/providers/submodel.md +79 -0
- package/.docs/models/providers/synthetic.md +96 -0
- package/.docs/models/providers/togetherai.md +115 -0
- package/.docs/models/providers/upstage.md +73 -0
- package/.docs/models/providers/venice.md +95 -0
- package/.docs/models/providers/vivgrid.md +106 -0
- package/.docs/models/providers/vultr.md +75 -0
- package/.docs/models/providers/wandb.md +80 -0
- package/.docs/models/providers/xai.md +141 -0
- package/.docs/models/providers/xiaomi.md +71 -0
- package/.docs/models/providers/zai-coding-plan.md +80 -0
- package/.docs/models/providers/zai.md +79 -0
- package/.docs/models/providers/zenmux.md +161 -0
- package/.docs/models/providers/zhipuai-coding-plan.md +79 -0
- package/.docs/models/providers/zhipuai.md +79 -0
- package/.docs/models/providers.md +81 -0
- package/.docs/reference/agents/agent.md +141 -0
- package/.docs/reference/agents/generate.md +186 -0
- package/.docs/reference/agents/generateLegacy.md +173 -0
- package/.docs/reference/agents/getDefaultGenerateOptions.md +36 -0
- package/.docs/reference/agents/getDefaultOptions.md +34 -0
- package/.docs/reference/agents/getDefaultStreamOptions.md +36 -0
- package/.docs/reference/agents/getDescription.md +21 -0
- package/.docs/reference/agents/getInstructions.md +34 -0
- package/.docs/reference/agents/getLLM.md +37 -0
- package/.docs/reference/agents/getMemory.md +34 -0
- package/.docs/reference/agents/getModel.md +34 -0
- package/.docs/reference/agents/getTools.md +29 -0
- package/.docs/reference/agents/getVoice.md +34 -0
- package/.docs/reference/agents/listAgents.md +35 -0
- package/.docs/reference/agents/listScorers.md +34 -0
- package/.docs/reference/agents/listTools.md +34 -0
- package/.docs/reference/agents/listWorkflows.md +34 -0
- package/.docs/reference/agents/network.md +133 -0
- package/.docs/reference/ai-sdk/chat-route.md +82 -0
- package/.docs/reference/ai-sdk/handle-chat-stream.md +53 -0
- package/.docs/reference/ai-sdk/handle-network-stream.md +37 -0
- package/.docs/reference/ai-sdk/handle-workflow-stream.md +55 -0
- package/.docs/reference/ai-sdk/network-route.md +74 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +231 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +79 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +76 -0
- package/.docs/reference/ai-sdk/with-mastra.md +59 -0
- package/.docs/reference/ai-sdk/workflow-route.md +79 -0
- package/.docs/reference/auth/auth0.md +73 -0
- package/.docs/reference/auth/better-auth.md +71 -0
- package/.docs/reference/auth/clerk.md +36 -0
- package/.docs/reference/auth/firebase.md +80 -0
- package/.docs/reference/auth/jwt.md +26 -0
- package/.docs/reference/auth/supabase.md +33 -0
- package/.docs/reference/auth/workos.md +84 -0
- package/.docs/reference/cli/create-mastra.md +137 -0
- package/.docs/reference/cli/mastra.md +336 -0
- package/.docs/reference/client-js/agents.md +437 -0
- package/.docs/reference/client-js/error-handling.md +16 -0
- package/.docs/reference/client-js/logs.md +24 -0
- package/.docs/reference/client-js/mastra-client.md +63 -0
- package/.docs/reference/client-js/memory.md +221 -0
- package/.docs/reference/client-js/observability.md +72 -0
- package/.docs/reference/client-js/telemetry.md +20 -0
- package/.docs/reference/client-js/tools.md +44 -0
- package/.docs/reference/client-js/vectors.md +79 -0
- package/.docs/reference/client-js/workflows.md +199 -0
- package/.docs/reference/configuration.md +752 -0
- package/.docs/reference/core/addGateway.md +42 -0
- package/.docs/reference/core/getAgent.md +21 -0
- package/.docs/reference/core/getAgentById.md +21 -0
- package/.docs/reference/core/getDeployer.md +22 -0
- package/.docs/reference/core/getGateway.md +38 -0
- package/.docs/reference/core/getGatewayById.md +41 -0
- package/.docs/reference/core/getLogger.md +22 -0
- package/.docs/reference/core/getMCPServer.md +47 -0
- package/.docs/reference/core/getMCPServerById.md +55 -0
- package/.docs/reference/core/getMemory.md +50 -0
- package/.docs/reference/core/getScorer.md +54 -0
- package/.docs/reference/core/getScorerById.md +54 -0
- package/.docs/reference/core/getServer.md +22 -0
- package/.docs/reference/core/getStorage.md +22 -0
- package/.docs/reference/core/getStoredAgentById.md +89 -0
- package/.docs/reference/core/getTelemetry.md +22 -0
- package/.docs/reference/core/getVector.md +22 -0
- package/.docs/reference/core/getWorkflow.md +42 -0
- package/.docs/reference/core/listAgents.md +21 -0
- package/.docs/reference/core/listGateways.md +40 -0
- package/.docs/reference/core/listLogs.md +38 -0
- package/.docs/reference/core/listLogsByRunId.md +36 -0
- package/.docs/reference/core/listMCPServers.md +55 -0
- package/.docs/reference/core/listMemory.md +56 -0
- package/.docs/reference/core/listScorers.md +29 -0
- package/.docs/reference/core/listStoredAgents.md +93 -0
- package/.docs/reference/core/listVectors.md +22 -0
- package/.docs/reference/core/listWorkflows.md +21 -0
- package/.docs/reference/core/mastra-class.md +66 -0
- package/.docs/reference/core/mastra-model-gateway.md +153 -0
- package/.docs/reference/core/setLogger.md +26 -0
- package/.docs/reference/core/setStorage.md +27 -0
- package/.docs/reference/datasets/addItem.md +37 -0
- package/.docs/reference/datasets/addItems.md +35 -0
- package/.docs/reference/datasets/compareExperiments.md +52 -0
- package/.docs/reference/datasets/create.md +51 -0
- package/.docs/reference/datasets/dataset.md +82 -0
- package/.docs/reference/datasets/datasets-manager.md +94 -0
- package/.docs/reference/datasets/delete.md +25 -0
- package/.docs/reference/datasets/deleteExperiment.md +27 -0
- package/.docs/reference/datasets/deleteItem.md +27 -0
- package/.docs/reference/datasets/deleteItems.md +29 -0
- package/.docs/reference/datasets/get.md +31 -0
- package/.docs/reference/datasets/getDetails.md +47 -0
- package/.docs/reference/datasets/getExperiment.md +30 -0
- package/.docs/reference/datasets/getItem.md +33 -0
- package/.docs/reference/datasets/getItemHistory.md +31 -0
- package/.docs/reference/datasets/list.md +31 -0
- package/.docs/reference/datasets/listExperimentResults.md +39 -0
- package/.docs/reference/datasets/listExperiments.md +33 -0
- package/.docs/reference/datasets/listItems.md +46 -0
- package/.docs/reference/datasets/listVersions.md +33 -0
- package/.docs/reference/datasets/startExperiment.md +62 -0
- package/.docs/reference/datasets/startExperimentAsync.md +43 -0
- package/.docs/reference/datasets/update.md +48 -0
- package/.docs/reference/datasets/updateItem.md +38 -0
- package/.docs/reference/deployer/cloudflare.md +79 -0
- package/.docs/reference/deployer/netlify.md +80 -0
- package/.docs/reference/deployer/vercel.md +91 -0
- package/.docs/reference/deployer.md +100 -0
- package/.docs/reference/evals/answer-relevancy.md +105 -0
- package/.docs/reference/evals/answer-similarity.md +99 -0
- package/.docs/reference/evals/bias.md +120 -0
- package/.docs/reference/evals/completeness.md +136 -0
- package/.docs/reference/evals/content-similarity.md +101 -0
- package/.docs/reference/evals/context-precision.md +196 -0
- package/.docs/reference/evals/context-relevance.md +531 -0
- package/.docs/reference/evals/create-scorer.md +270 -0
- package/.docs/reference/evals/faithfulness.md +114 -0
- package/.docs/reference/evals/hallucination.md +213 -0
- package/.docs/reference/evals/keyword-coverage.md +128 -0
- package/.docs/reference/evals/mastra-scorer.md +123 -0
- package/.docs/reference/evals/noise-sensitivity.md +675 -0
- package/.docs/reference/evals/prompt-alignment.md +614 -0
- package/.docs/reference/evals/run-evals.md +179 -0
- package/.docs/reference/evals/scorer-utils.md +326 -0
- package/.docs/reference/evals/textual-difference.md +113 -0
- package/.docs/reference/evals/tone-consistency.md +119 -0
- package/.docs/reference/evals/tool-call-accuracy.md +533 -0
- package/.docs/reference/evals/toxicity.md +123 -0
- package/.docs/reference/harness/harness-class.md +708 -0
- package/.docs/reference/index.md +277 -0
- package/.docs/reference/logging/pino-logger.md +117 -0
- package/.docs/reference/mastra-code/createMastraCode.md +108 -0
- package/.docs/reference/memory/clone-utilities.md +199 -0
- package/.docs/reference/memory/cloneThread.md +130 -0
- package/.docs/reference/memory/createThread.md +68 -0
- package/.docs/reference/memory/deleteMessages.md +38 -0
- package/.docs/reference/memory/getThreadById.md +24 -0
- package/.docs/reference/memory/listThreads.md +145 -0
- package/.docs/reference/memory/memory-class.md +147 -0
- package/.docs/reference/memory/observational-memory.md +565 -0
- package/.docs/reference/memory/recall.md +91 -0
- package/.docs/reference/observability/tracing/bridges/otel.md +131 -0
- package/.docs/reference/observability/tracing/configuration.md +178 -0
- package/.docs/reference/observability/tracing/exporters/arize.md +141 -0
- package/.docs/reference/observability/tracing/exporters/braintrust.md +93 -0
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +163 -0
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +138 -0
- package/.docs/reference/observability/tracing/exporters/datadog.md +116 -0
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +174 -0
- package/.docs/reference/observability/tracing/exporters/laminar.md +78 -0
- package/.docs/reference/observability/tracing/exporters/langfuse.md +134 -0
- package/.docs/reference/observability/tracing/exporters/langsmith.md +108 -0
- package/.docs/reference/observability/tracing/exporters/otel.md +199 -0
- package/.docs/reference/observability/tracing/exporters/posthog.md +92 -0
- package/.docs/reference/observability/tracing/exporters/sentry.md +184 -0
- package/.docs/reference/observability/tracing/instances.md +107 -0
- package/.docs/reference/observability/tracing/interfaces.md +743 -0
- package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +144 -0
- package/.docs/reference/observability/tracing/spans.md +224 -0
- package/.docs/reference/processors/batch-parts-processor.md +61 -0
- package/.docs/reference/processors/language-detector.md +82 -0
- package/.docs/reference/processors/message-history-processor.md +85 -0
- package/.docs/reference/processors/moderation-processor.md +104 -0
- package/.docs/reference/processors/pii-detector.md +108 -0
- package/.docs/reference/processors/processor-interface.md +521 -0
- package/.docs/reference/processors/prompt-injection-detector.md +72 -0
- package/.docs/reference/processors/semantic-recall-processor.md +117 -0
- package/.docs/reference/processors/system-prompt-scrubber.md +80 -0
- package/.docs/reference/processors/token-limiter-processor.md +115 -0
- package/.docs/reference/processors/tool-call-filter.md +85 -0
- package/.docs/reference/processors/tool-search-processor.md +111 -0
- package/.docs/reference/processors/unicode-normalizer.md +62 -0
- package/.docs/reference/processors/working-memory-processor.md +152 -0
- package/.docs/reference/rag/chunk.md +221 -0
- package/.docs/reference/rag/database-config.md +261 -0
- package/.docs/reference/rag/document.md +114 -0
- package/.docs/reference/rag/embeddings.md +92 -0
- package/.docs/reference/rag/extract-params.md +168 -0
- package/.docs/reference/rag/graph-rag.md +111 -0
- package/.docs/reference/rag/metadata-filters.md +216 -0
- package/.docs/reference/rag/rerank.md +75 -0
- package/.docs/reference/rag/rerankWithScorer.md +80 -0
- package/.docs/reference/server/create-route.md +262 -0
- package/.docs/reference/server/express-adapter.md +176 -0
- package/.docs/reference/server/fastify-adapter.md +90 -0
- package/.docs/reference/server/hono-adapter.md +162 -0
- package/.docs/reference/server/koa-adapter.md +127 -0
- package/.docs/reference/server/mastra-server.md +298 -0
- package/.docs/reference/server/register-api-route.md +249 -0
- package/.docs/reference/server/routes.md +306 -0
- package/.docs/reference/storage/cloudflare-d1.md +218 -0
- package/.docs/reference/storage/cloudflare.md +88 -0
- package/.docs/reference/storage/composite.md +235 -0
- package/.docs/reference/storage/convex.md +161 -0
- package/.docs/reference/storage/dynamodb.md +282 -0
- package/.docs/reference/storage/lance.md +131 -0
- package/.docs/reference/storage/libsql.md +135 -0
- package/.docs/reference/storage/mongodb.md +262 -0
- package/.docs/reference/storage/mssql.md +157 -0
- package/.docs/reference/storage/overview.md +121 -0
- package/.docs/reference/storage/postgresql.md +526 -0
- package/.docs/reference/storage/upstash.md +160 -0
- package/.docs/reference/streaming/ChunkType.md +292 -0
- package/.docs/reference/streaming/agents/MastraModelOutput.md +182 -0
- package/.docs/reference/streaming/agents/stream.md +221 -0
- package/.docs/reference/streaming/agents/streamLegacy.md +142 -0
- package/.docs/reference/streaming/workflows/observeStream.md +42 -0
- package/.docs/reference/streaming/workflows/resumeStream.md +61 -0
- package/.docs/reference/streaming/workflows/stream.md +88 -0
- package/.docs/reference/streaming/workflows/timeTravelStream.md +142 -0
- package/.docs/reference/templates/overview.md +194 -0
- package/.docs/reference/tools/create-tool.md +237 -0
- package/.docs/reference/tools/document-chunker-tool.md +89 -0
- package/.docs/reference/tools/graph-rag-tool.md +182 -0
- package/.docs/reference/tools/mcp-client.md +954 -0
- package/.docs/reference/tools/mcp-server.md +1271 -0
- package/.docs/reference/tools/vector-query-tool.md +459 -0
- package/.docs/reference/vectors/astra.md +121 -0
- package/.docs/reference/vectors/chroma.md +264 -0
- package/.docs/reference/vectors/convex.md +300 -0
- package/.docs/reference/vectors/couchbase.md +226 -0
- package/.docs/reference/vectors/duckdb.md +318 -0
- package/.docs/reference/vectors/elasticsearch.md +189 -0
- package/.docs/reference/vectors/lance.md +220 -0
- package/.docs/reference/vectors/libsql.md +305 -0
- package/.docs/reference/vectors/mongodb.md +295 -0
- package/.docs/reference/vectors/opensearch.md +99 -0
- package/.docs/reference/vectors/pg.md +408 -0
- package/.docs/reference/vectors/pinecone.md +168 -0
- package/.docs/reference/vectors/qdrant.md +222 -0
- package/.docs/reference/vectors/s3vectors.md +277 -0
- package/.docs/reference/vectors/turbopuffer.md +157 -0
- package/.docs/reference/vectors/upstash.md +294 -0
- package/.docs/reference/vectors/vectorize.md +147 -0
- package/.docs/reference/voice/azure.md +148 -0
- package/.docs/reference/voice/cloudflare.md +83 -0
- package/.docs/reference/voice/composite-voice.md +121 -0
- package/.docs/reference/voice/deepgram.md +79 -0
- package/.docs/reference/voice/elevenlabs.md +98 -0
- package/.docs/reference/voice/google-gemini-live.md +378 -0
- package/.docs/reference/voice/google.md +228 -0
- package/.docs/reference/voice/mastra-voice.md +311 -0
- package/.docs/reference/voice/murf.md +122 -0
- package/.docs/reference/voice/openai-realtime.md +203 -0
- package/.docs/reference/voice/openai.md +88 -0
- package/.docs/reference/voice/playai.md +80 -0
- package/.docs/reference/voice/sarvam.md +126 -0
- package/.docs/reference/voice/speechify.md +75 -0
- package/.docs/reference/voice/voice.addInstructions.md +55 -0
- package/.docs/reference/voice/voice.addTools.md +67 -0
- package/.docs/reference/voice/voice.answer.md +54 -0
- package/.docs/reference/voice/voice.close.md +51 -0
- package/.docs/reference/voice/voice.connect.md +94 -0
- package/.docs/reference/voice/voice.events.md +37 -0
- package/.docs/reference/voice/voice.getSpeakers.md +129 -0
- package/.docs/reference/voice/voice.listen.md +164 -0
- package/.docs/reference/voice/voice.off.md +54 -0
- package/.docs/reference/voice/voice.on.md +111 -0
- package/.docs/reference/voice/voice.send.md +65 -0
- package/.docs/reference/voice/voice.speak.md +157 -0
- package/.docs/reference/voice/voice.updateConfig.md +60 -0
- package/.docs/reference/workflows/run-methods/cancel.md +86 -0
- package/.docs/reference/workflows/run-methods/restart.md +33 -0
- package/.docs/reference/workflows/run-methods/resume.md +59 -0
- package/.docs/reference/workflows/run-methods/start.md +58 -0
- package/.docs/reference/workflows/run-methods/startAsync.md +67 -0
- package/.docs/reference/workflows/run-methods/timeTravel.md +142 -0
- package/.docs/reference/workflows/run.md +59 -0
- package/.docs/reference/workflows/step.md +119 -0
- package/.docs/reference/workflows/workflow-methods/branch.md +25 -0
- package/.docs/reference/workflows/workflow-methods/commit.md +17 -0
- package/.docs/reference/workflows/workflow-methods/create-run.md +63 -0
- package/.docs/reference/workflows/workflow-methods/dountil.md +25 -0
- package/.docs/reference/workflows/workflow-methods/dowhile.md +25 -0
- package/.docs/reference/workflows/workflow-methods/foreach.md +118 -0
- package/.docs/reference/workflows/workflow-methods/map.md +93 -0
- package/.docs/reference/workflows/workflow-methods/parallel.md +21 -0
- package/.docs/reference/workflows/workflow-methods/sleep.md +35 -0
- package/.docs/reference/workflows/workflow-methods/sleepUntil.md +35 -0
- package/.docs/reference/workflows/workflow-methods/then.md +21 -0
- package/.docs/reference/workflows/workflow.md +157 -0
- package/.docs/reference/workspace/e2b-sandbox.md +289 -0
- package/.docs/reference/workspace/filesystem.md +255 -0
- package/.docs/reference/workspace/gcs-filesystem.md +174 -0
- package/.docs/reference/workspace/local-filesystem.md +343 -0
- package/.docs/reference/workspace/local-sandbox.md +301 -0
- package/.docs/reference/workspace/s3-filesystem.md +175 -0
- package/.docs/reference/workspace/sandbox.md +87 -0
- package/.docs/reference/workspace/workspace-class.md +244 -0
- package/CHANGELOG.md +8 -0
- package/package.json +5 -5
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Baseten
|
|
2
|
+
|
|
3
|
+
Access 7 Baseten models through Mastra's model router. Authentication is handled automatically using the `BASETEN_API_KEY` environment variable.
|
|
4
|
+
|
|
5
|
+
Learn more in the [Baseten documentation](https://docs.baseten.co/development/model-apis/overview).
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
BASETEN_API_KEY=your-api-key
|
|
9
|
+
```
|
|
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: "baseten/Qwen/Qwen3-Coder-480B-A35B-Instruct"
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Generate a response
|
|
22
|
+
const response = await agent.generate("Hello!");
|
|
23
|
+
|
|
24
|
+
// Stream a response
|
|
25
|
+
const stream = await agent.stream("Tell me a story");
|
|
26
|
+
for await (const chunk of stream) {
|
|
27
|
+
console.log(chunk);
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Baseten documentation](https://docs.baseten.co/development/model-apis/overview) for details.
|
|
32
|
+
|
|
33
|
+
## Models
|
|
34
|
+
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| --------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `baseten/deepseek-ai/DeepSeek-V3.2` | 164K | | | | | | $0.30 | $0.45 |
|
|
38
|
+
| `baseten/moonshotai/Kimi-K2-Instruct-0905` | 262K | | | | | | $0.60 | $3 |
|
|
39
|
+
| `baseten/moonshotai/Kimi-K2-Thinking` | 262K | | | | | | $0.60 | $3 |
|
|
40
|
+
| `baseten/moonshotai/Kimi-K2.5` | 262K | | | | | | $0.60 | $3 |
|
|
41
|
+
| `baseten/Qwen/Qwen3-Coder-480B-A35B-Instruct` | 262K | | | | | | $0.38 | $2 |
|
|
42
|
+
| `baseten/zai-org/GLM-4.6` | 200K | | | | | | $0.60 | $2 |
|
|
43
|
+
| `baseten/zai-org/GLM-4.7` | 205K | | | | | | $0.60 | $2 |
|
|
44
|
+
|
|
45
|
+
## Advanced Configuration
|
|
46
|
+
|
|
47
|
+
### Custom Headers
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
const agent = new Agent({
|
|
51
|
+
id: "custom-agent",
|
|
52
|
+
name: "custom-agent",
|
|
53
|
+
model: {
|
|
54
|
+
url: "https://inference.baseten.co/v1",
|
|
55
|
+
id: "baseten/Qwen/Qwen3-Coder-480B-A35B-Instruct",
|
|
56
|
+
apiKey: process.env.BASETEN_API_KEY,
|
|
57
|
+
headers: {
|
|
58
|
+
"X-Custom-Header": "value"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Dynamic Model Selection
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
const agent = new Agent({
|
|
68
|
+
id: "dynamic-agent",
|
|
69
|
+
name: "Dynamic Agent",
|
|
70
|
+
model: ({ requestContext }) => {
|
|
71
|
+
const useAdvanced = requestContext.task === "complex";
|
|
72
|
+
return useAdvanced
|
|
73
|
+
? "baseten/zai-org/GLM-4.7"
|
|
74
|
+
: "baseten/Qwen/Qwen3-Coder-480B-A35B-Instruct";
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
```
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Berget.AI
|
|
2
|
+
|
|
3
|
+
Access 8 Berget.AI models through Mastra's model router. Authentication is handled automatically using the `BERGET_API_KEY` environment variable.
|
|
4
|
+
|
|
5
|
+
Learn more in the [Berget.AI documentation](https://api.berget.ai).
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
BERGET_API_KEY=your-api-key
|
|
9
|
+
```
|
|
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: "berget/BAAI/bge-reranker-v2-m3"
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Generate a response
|
|
22
|
+
const response = await agent.generate("Hello!");
|
|
23
|
+
|
|
24
|
+
// Stream a response
|
|
25
|
+
const stream = await agent.stream("Tell me a story");
|
|
26
|
+
for await (const chunk of stream) {
|
|
27
|
+
console.log(chunk);
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Berget.AI documentation](https://api.berget.ai) for details.
|
|
32
|
+
|
|
33
|
+
## Models
|
|
34
|
+
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| ------------------------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `berget/BAAI/bge-reranker-v2-m3` | 512 | | | | | | $0.10 | $0.10 |
|
|
38
|
+
| `berget/intfloat/multilingual-e5-large` | 512 | | | | | | $0.02 | — |
|
|
39
|
+
| `berget/intfloat/multilingual-e5-large-instruct` | 512 | | | | | | $0.02 | — |
|
|
40
|
+
| `berget/KBLab/kb-whisper-large` | 480K | | | | | | $3 | $3 |
|
|
41
|
+
| `berget/meta-llama/Llama-3.3-70B-Instruct` | 128K | | | | | | $0.90 | $0.90 |
|
|
42
|
+
| `berget/mistralai/Mistral-Small-3.2-24B-Instruct-2506` | 32K | | | | | | $0.30 | $0.30 |
|
|
43
|
+
| `berget/openai/gpt-oss-120b` | 128K | | | | | | $0.30 | $0.90 |
|
|
44
|
+
| `berget/zai-org/GLM-4.7` | 128K | | | | | | $0.70 | $2 |
|
|
45
|
+
|
|
46
|
+
## Advanced Configuration
|
|
47
|
+
|
|
48
|
+
### Custom Headers
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
const agent = new Agent({
|
|
52
|
+
id: "custom-agent",
|
|
53
|
+
name: "custom-agent",
|
|
54
|
+
model: {
|
|
55
|
+
url: "https://api.berget.ai/v1",
|
|
56
|
+
id: "berget/BAAI/bge-reranker-v2-m3",
|
|
57
|
+
apiKey: process.env.BERGET_API_KEY,
|
|
58
|
+
headers: {
|
|
59
|
+
"X-Custom-Header": "value"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Dynamic Model Selection
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
const agent = new Agent({
|
|
69
|
+
id: "dynamic-agent",
|
|
70
|
+
name: "Dynamic Agent",
|
|
71
|
+
model: ({ requestContext }) => {
|
|
72
|
+
const useAdvanced = requestContext.task === "complex";
|
|
73
|
+
return useAdvanced
|
|
74
|
+
? "berget/zai-org/GLM-4.7"
|
|
75
|
+
: "berget/BAAI/bge-reranker-v2-m3";
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
```
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Cerebras
|
|
2
|
+
|
|
3
|
+
Access 4 Cerebras models through Mastra's model router. Authentication is handled automatically using the `CEREBRAS_API_KEY` environment variable.
|
|
4
|
+
|
|
5
|
+
Learn more in the [Cerebras documentation](https://inference-docs.cerebras.ai/models/overview).
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
CEREBRAS_API_KEY=your-api-key
|
|
9
|
+
```
|
|
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: "cerebras/gpt-oss-120b"
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Generate a response
|
|
22
|
+
const response = await agent.generate("Hello!");
|
|
23
|
+
|
|
24
|
+
// Stream a response
|
|
25
|
+
const stream = await agent.stream("Tell me a story");
|
|
26
|
+
for await (const chunk of stream) {
|
|
27
|
+
console.log(chunk);
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Models
|
|
32
|
+
|
|
33
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
34
|
+
| ----------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
35
|
+
| `cerebras/gpt-oss-120b` | 131K | | | | | | $0.25 | $0.69 |
|
|
36
|
+
| `cerebras/llama3.1-8b` | 32K | | | | | | $0.10 | $0.10 |
|
|
37
|
+
| `cerebras/qwen-3-235b-a22b-instruct-2507` | 131K | | | | | | $0.60 | $1 |
|
|
38
|
+
| `cerebras/zai-glm-4.7` | 131K | | | | | | $2 | $3 |
|
|
39
|
+
|
|
40
|
+
## Advanced Configuration
|
|
41
|
+
|
|
42
|
+
### Custom Headers
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
const agent = new Agent({
|
|
46
|
+
id: "custom-agent",
|
|
47
|
+
name: "custom-agent",
|
|
48
|
+
model: {
|
|
49
|
+
id: "cerebras/gpt-oss-120b",
|
|
50
|
+
apiKey: process.env.CEREBRAS_API_KEY,
|
|
51
|
+
headers: {
|
|
52
|
+
"X-Custom-Header": "value"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Dynamic Model Selection
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
const agent = new Agent({
|
|
62
|
+
id: "dynamic-agent",
|
|
63
|
+
name: "Dynamic Agent",
|
|
64
|
+
model: ({ requestContext }) => {
|
|
65
|
+
const useAdvanced = requestContext.task === "complex";
|
|
66
|
+
return useAdvanced
|
|
67
|
+
? "cerebras/zai-glm-4.7"
|
|
68
|
+
: "cerebras/gpt-oss-120b";
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Direct Provider Installation
|
|
74
|
+
|
|
75
|
+
This provider can also be installed directly as a standalone package, which can be used instead of the Mastra model router string. View the [package documentation](https://www.npmjs.com/package/@ai-sdk/cerebras) for more details.
|
|
76
|
+
|
|
77
|
+
**npm**:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npm install @ai-sdk/cerebras
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**pnpm**:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pnpm add @ai-sdk/cerebras
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Yarn**:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
yarn add @ai-sdk/cerebras
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Bun**:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
bun add @ai-sdk/cerebras
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
For detailed provider-specific documentation, see the [AI SDK Cerebras provider docs](https://ai-sdk.dev/providers/ai-sdk-providers/cerebras).
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Chutes
|
|
2
|
+
|
|
3
|
+
Access 66 Chutes models through Mastra's model router. Authentication is handled automatically using the `CHUTES_API_KEY` environment variable.
|
|
4
|
+
|
|
5
|
+
Learn more in the [Chutes documentation](https://llm.chutes.ai).
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
CHUTES_API_KEY=your-api-key
|
|
9
|
+
```
|
|
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: "chutes/MiniMaxAI/MiniMax-M2.1-TEE"
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Generate a response
|
|
22
|
+
const response = await agent.generate("Hello!");
|
|
23
|
+
|
|
24
|
+
// Stream a response
|
|
25
|
+
const stream = await agent.stream("Tell me a story");
|
|
26
|
+
for await (const chunk of stream) {
|
|
27
|
+
console.log(chunk);
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Chutes documentation](https://llm.chutes.ai) for details.
|
|
32
|
+
|
|
33
|
+
## Models
|
|
34
|
+
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| ------------------------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `chutes/chutesai/Mistral-Small-3.1-24B-Instruct-2503` | 131K | | | | | | $0.03 | $0.11 |
|
|
38
|
+
| `chutes/chutesai/Mistral-Small-3.2-24B-Instruct-2506` | 131K | | | | | | $0.06 | $0.18 |
|
|
39
|
+
| `chutes/deepseek-ai/DeepSeek-R1-0528-TEE` | 164K | | | | | | $0.40 | $2 |
|
|
40
|
+
| `chutes/deepseek-ai/DeepSeek-R1-Distill-Llama-70B` | 131K | | | | | | $0.03 | $0.11 |
|
|
41
|
+
| `chutes/deepseek-ai/DeepSeek-R1-TEE` | 164K | | | | | | $0.30 | $1 |
|
|
42
|
+
| `chutes/deepseek-ai/DeepSeek-V3` | 164K | | | | | | $0.30 | $1 |
|
|
43
|
+
| `chutes/deepseek-ai/DeepSeek-V3-0324-TEE` | 164K | | | | | | $0.19 | $0.87 |
|
|
44
|
+
| `chutes/deepseek-ai/DeepSeek-V3.1-TEE` | 164K | | | | | | $0.20 | $0.80 |
|
|
45
|
+
| `chutes/deepseek-ai/DeepSeek-V3.1-Terminus-TEE` | 164K | | | | | | $0.23 | $0.90 |
|
|
46
|
+
| `chutes/deepseek-ai/DeepSeek-V3.2-Speciale-TEE` | 164K | | | | | | $0.27 | $0.41 |
|
|
47
|
+
| `chutes/deepseek-ai/DeepSeek-V3.2-TEE` | 164K | | | | | | $0.25 | $0.38 |
|
|
48
|
+
| `chutes/MiniMaxAI/MiniMax-M2.1-TEE` | 197K | | | | | | $0.27 | $1 |
|
|
49
|
+
| `chutes/MiniMaxAI/MiniMax-M2.5-TEE` | 197K | | | | | | $0.15 | $0.60 |
|
|
50
|
+
| `chutes/miromind-ai/MiroThinker-v1.5-235B` | 262K | | | | | | $0.30 | $1 |
|
|
51
|
+
| `chutes/mistralai/Devstral-2-123B-Instruct-2512-TEE` | 262K | | | | | | $0.05 | $0.22 |
|
|
52
|
+
| `chutes/moonshotai/Kimi-K2-Instruct-0905` | 262K | | | | | | $0.39 | $2 |
|
|
53
|
+
| `chutes/moonshotai/Kimi-K2-Thinking-TEE` | 262K | | | | | | $0.40 | $2 |
|
|
54
|
+
| `chutes/moonshotai/Kimi-K2.5-TEE` | 262K | | | | | | $0.60 | $3 |
|
|
55
|
+
| `chutes/NousResearch/DeepHermes-3-Mistral-24B-Preview` | 33K | | | | | | $0.02 | $0.10 |
|
|
56
|
+
| `chutes/NousResearch/Hermes-4-14B` | 41K | | | | | | $0.01 | $0.05 |
|
|
57
|
+
| `chutes/NousResearch/Hermes-4-405B-FP8-TEE` | 131K | | | | | | $0.30 | $1 |
|
|
58
|
+
| `chutes/NousResearch/Hermes-4-70B` | 131K | | | | | | $0.11 | $0.38 |
|
|
59
|
+
| `chutes/NousResearch/Hermes-4.3-36B` | 33K | | | | | | $0.10 | $0.39 |
|
|
60
|
+
| `chutes/nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16` | 262K | | | | | | $0.06 | $0.24 |
|
|
61
|
+
| `chutes/openai/gpt-oss-120b-TEE` | 131K | | | | | | $0.04 | $0.18 |
|
|
62
|
+
| `chutes/openai/gpt-oss-20b` | 131K | | | | | | $0.02 | $0.10 |
|
|
63
|
+
| `chutes/OpenGVLab/InternVL3-78B-TEE` | 33K | | | | | | $0.10 | $0.39 |
|
|
64
|
+
| `chutes/Qwen/Qwen2.5-72B-Instruct` | 33K | | | | | | $0.13 | $0.52 |
|
|
65
|
+
| `chutes/Qwen/Qwen2.5-Coder-32B-Instruct` | 33K | | | | | | $0.03 | $0.11 |
|
|
66
|
+
| `chutes/Qwen/Qwen2.5-VL-32B-Instruct` | 16K | | | | | | $0.05 | $0.22 |
|
|
67
|
+
| `chutes/Qwen/Qwen2.5-VL-72B-Instruct-TEE` | 33K | | | | | | $0.15 | $0.60 |
|
|
68
|
+
| `chutes/Qwen/Qwen3-14B` | 41K | | | | | | $0.05 | $0.22 |
|
|
69
|
+
| `chutes/Qwen/Qwen3-235B-A22B` | 41K | | | | | | $0.30 | $1 |
|
|
70
|
+
| `chutes/Qwen/Qwen3-235B-A22B-Instruct-2507-TEE` | 262K | | | | | | $0.08 | $0.55 |
|
|
71
|
+
| `chutes/Qwen/Qwen3-235B-A22B-Thinking-2507` | 262K | | | | | | $0.11 | $0.60 |
|
|
72
|
+
| `chutes/Qwen/Qwen3-30B-A3B` | 41K | | | | | | $0.06 | $0.22 |
|
|
73
|
+
| `chutes/Qwen/Qwen3-30B-A3B-Instruct-2507` | 262K | | | | | | $0.08 | $0.33 |
|
|
74
|
+
| `chutes/Qwen/Qwen3-32B` | 41K | | | | | | $0.08 | $0.24 |
|
|
75
|
+
| `chutes/Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8-TEE` | 262K | | | | | | $0.22 | $0.95 |
|
|
76
|
+
| `chutes/Qwen/Qwen3-Coder-Next` | 262K | | | | | | $0.07 | $0.30 |
|
|
77
|
+
| `chutes/Qwen/Qwen3-Next-80B-A3B-Instruct` | 262K | | | | | | $0.10 | $0.80 |
|
|
78
|
+
| `chutes/Qwen/Qwen3-VL-235B-A22B-Instruct` | 262K | | | | | | $0.30 | $1 |
|
|
79
|
+
| `chutes/Qwen/Qwen3Guard-Gen-0.6B` | 33K | | | | | | $0.01 | $0.01 |
|
|
80
|
+
| `chutes/rednote-hilab/dots.ocr` | 131K | | | | | | $0.01 | $0.01 |
|
|
81
|
+
| `chutes/tngtech/DeepSeek-R1T-Chimera` | 164K | | | | | | $0.30 | $1 |
|
|
82
|
+
| `chutes/tngtech/DeepSeek-TNG-R1T2-Chimera` | 164K | | | | | | $0.25 | $0.85 |
|
|
83
|
+
| `chutes/tngtech/TNG-R1T-Chimera-TEE` | 164K | | | | | | $0.25 | $0.85 |
|
|
84
|
+
| `chutes/tngtech/TNG-R1T-Chimera-Turbo` | 164K | | | | | | $0.22 | $0.60 |
|
|
85
|
+
| `chutes/unsloth/gemma-3-12b-it` | 131K | | | | | | $0.03 | $0.10 |
|
|
86
|
+
| `chutes/unsloth/gemma-3-27b-it` | 128K | | | | | | $0.04 | $0.15 |
|
|
87
|
+
| `chutes/unsloth/gemma-3-4b-it` | 96K | | | | | | $0.01 | $0.03 |
|
|
88
|
+
| `chutes/unsloth/Llama-3.2-1B-Instruct` | 33K | | | | | | $0.01 | $0.01 |
|
|
89
|
+
| `chutes/unsloth/Llama-3.2-3B-Instruct` | 16K | | | | | | $0.01 | $0.01 |
|
|
90
|
+
| `chutes/unsloth/Mistral-Nemo-Instruct-2407` | 131K | | | | | | $0.02 | $0.04 |
|
|
91
|
+
| `chutes/unsloth/Mistral-Small-24B-Instruct-2501` | 33K | | | | | | $0.03 | $0.11 |
|
|
92
|
+
| `chutes/XiaomiMiMo/MiMo-V2-Flash` | 33K | | | | | | $0.09 | $0.29 |
|
|
93
|
+
| `chutes/zai-org/GLM-4.5-Air` | 131K | | | | | | $0.05 | $0.22 |
|
|
94
|
+
| `chutes/zai-org/GLM-4.5-FP8` | 131K | | | | | | $0.30 | $1 |
|
|
95
|
+
| `chutes/zai-org/GLM-4.5-TEE` | 131K | | | | | | $0.35 | $2 |
|
|
96
|
+
| `chutes/zai-org/GLM-4.6-FP8` | 203K | | | | | | $0.30 | $1 |
|
|
97
|
+
| `chutes/zai-org/GLM-4.6-TEE` | 203K | | | | | | $0.35 | $2 |
|
|
98
|
+
| `chutes/zai-org/GLM-4.6V` | 131K | | | | | | $0.30 | $0.90 |
|
|
99
|
+
| `chutes/zai-org/GLM-4.7-Flash` | 203K | | | | | | $0.06 | $0.35 |
|
|
100
|
+
| `chutes/zai-org/GLM-4.7-FP8` | 203K | | | | | | $0.30 | $1 |
|
|
101
|
+
| `chutes/zai-org/GLM-4.7-TEE` | 203K | | | | | | $0.40 | $2 |
|
|
102
|
+
| `chutes/zai-org/GLM-5-TEE` | 203K | | | | | | $0.75 | $3 |
|
|
103
|
+
|
|
104
|
+
## Advanced Configuration
|
|
105
|
+
|
|
106
|
+
### Custom Headers
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
const agent = new Agent({
|
|
110
|
+
id: "custom-agent",
|
|
111
|
+
name: "custom-agent",
|
|
112
|
+
model: {
|
|
113
|
+
url: "https://llm.chutes.ai/v1",
|
|
114
|
+
id: "chutes/MiniMaxAI/MiniMax-M2.1-TEE",
|
|
115
|
+
apiKey: process.env.CHUTES_API_KEY,
|
|
116
|
+
headers: {
|
|
117
|
+
"X-Custom-Header": "value"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Dynamic Model Selection
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
const agent = new Agent({
|
|
127
|
+
id: "dynamic-agent",
|
|
128
|
+
name: "Dynamic Agent",
|
|
129
|
+
model: ({ requestContext }) => {
|
|
130
|
+
const useAdvanced = requestContext.task === "complex";
|
|
131
|
+
return useAdvanced
|
|
132
|
+
? "chutes/zai-org/GLM-5-TEE"
|
|
133
|
+
: "chutes/MiniMaxAI/MiniMax-M2.1-TEE";
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Cloudflare AI Gateway
|
|
2
|
+
|
|
3
|
+
Cloudflare AI Gateway is available through the AI SDK. Install the provider package to use their models with Mastra.
|
|
4
|
+
|
|
5
|
+
For detailed provider-specific documentation, see the [AI SDK Cloudflare AI Gateway provider docs](https://ai-sdk.dev/providers/community-providers/cloudflare-ai-gateway).
|
|
6
|
+
|
|
7
|
+
To use this provider with Mastra agents, see the [Agent Overview documentation](https://mastra.ai/docs/agents/overview).
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
**npm**:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install ai-gateway-provider
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**pnpm**:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm add ai-gateway-provider
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Yarn**:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
yarn add ai-gateway-provider
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Bun**:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
bun add ai-gateway-provider
|
|
33
|
+
```
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Cloudflare Workers AI
|
|
2
|
+
|
|
3
|
+
Access 39 Cloudflare Workers AI models through Mastra's model router. Authentication is handled automatically using the `CLOUDFLARE_ACCOUNT_ID` environment variable.
|
|
4
|
+
|
|
5
|
+
Learn more in the [Cloudflare Workers AI documentation](https://developers.cloudflare.com/workers-ai/models/).
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
CLOUDFLARE_ACCOUNT_ID=your-api-key
|
|
9
|
+
```
|
|
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: "cloudflare-workers-ai/@cf/ai4bharat/indictrans2-en-indic-1B"
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Generate a response
|
|
22
|
+
const response = await agent.generate("Hello!");
|
|
23
|
+
|
|
24
|
+
// Stream a response
|
|
25
|
+
const stream = await agent.stream("Tell me a story");
|
|
26
|
+
for await (const chunk of stream) {
|
|
27
|
+
console.log(chunk);
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Cloudflare Workers AI documentation](https://developers.cloudflare.com/workers-ai/models/) for details.
|
|
32
|
+
|
|
33
|
+
## Models
|
|
34
|
+
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| -------------------------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `cloudflare-workers-ai/@cf/ai4bharat/indictrans2-en-indic-1B` | 128K | | | | | | $0.34 | $0.34 |
|
|
38
|
+
| `cloudflare-workers-ai/@cf/aisingapore/gemma-sea-lion-v4-27b-it` | 128K | | | | | | $0.35 | $0.56 |
|
|
39
|
+
| `cloudflare-workers-ai/@cf/baai/bge-base-en-v1.5` | 128K | | | | | | $0.07 | — |
|
|
40
|
+
| `cloudflare-workers-ai/@cf/baai/bge-large-en-v1.5` | 128K | | | | | | $0.20 | — |
|
|
41
|
+
| `cloudflare-workers-ai/@cf/baai/bge-m3` | 128K | | | | | | $0.01 | — |
|
|
42
|
+
| `cloudflare-workers-ai/@cf/baai/bge-reranker-base` | 128K | | | | | | $0.00 | — |
|
|
43
|
+
| `cloudflare-workers-ai/@cf/baai/bge-small-en-v1.5` | 128K | | | | | | $0.02 | — |
|
|
44
|
+
| `cloudflare-workers-ai/@cf/deepgram/aura-2-en` | 128K | | | | | | — | — |
|
|
45
|
+
| `cloudflare-workers-ai/@cf/deepgram/aura-2-es` | 128K | | | | | | — | — |
|
|
46
|
+
| `cloudflare-workers-ai/@cf/deepgram/nova-3` | 128K | | | | | | — | — |
|
|
47
|
+
| `cloudflare-workers-ai/@cf/deepseek-ai/deepseek-r1-distill-qwen-32b` | 128K | | | | | | $0.50 | $5 |
|
|
48
|
+
| `cloudflare-workers-ai/@cf/facebook/bart-large-cnn` | 128K | | | | | | — | — |
|
|
49
|
+
| `cloudflare-workers-ai/@cf/google/gemma-3-12b-it` | 128K | | | | | | $0.35 | $0.56 |
|
|
50
|
+
| `cloudflare-workers-ai/@cf/huggingface/distilbert-sst-2-int8` | 128K | | | | | | $0.03 | — |
|
|
51
|
+
| `cloudflare-workers-ai/@cf/ibm-granite/granite-4.0-h-micro` | 128K | | | | | | $0.02 | $0.11 |
|
|
52
|
+
| `cloudflare-workers-ai/@cf/meta/llama-2-7b-chat-fp16` | 128K | | | | | | $0.56 | $7 |
|
|
53
|
+
| `cloudflare-workers-ai/@cf/meta/llama-3-8b-instruct` | 128K | | | | | | $0.28 | $0.83 |
|
|
54
|
+
| `cloudflare-workers-ai/@cf/meta/llama-3-8b-instruct-awq` | 128K | | | | | | $0.12 | $0.27 |
|
|
55
|
+
| `cloudflare-workers-ai/@cf/meta/llama-3.1-8b-instruct` | 128K | | | | | | $0.28 | $0.83 |
|
|
56
|
+
| `cloudflare-workers-ai/@cf/meta/llama-3.1-8b-instruct-awq` | 128K | | | | | | $0.12 | $0.27 |
|
|
57
|
+
| `cloudflare-workers-ai/@cf/meta/llama-3.1-8b-instruct-fp8` | 128K | | | | | | $0.15 | $0.29 |
|
|
58
|
+
| `cloudflare-workers-ai/@cf/meta/llama-3.2-11b-vision-instruct` | 128K | | | | | | $0.05 | $0.68 |
|
|
59
|
+
| `cloudflare-workers-ai/@cf/meta/llama-3.2-1b-instruct` | 128K | | | | | | $0.03 | $0.20 |
|
|
60
|
+
| `cloudflare-workers-ai/@cf/meta/llama-3.2-3b-instruct` | 128K | | | | | | $0.05 | $0.34 |
|
|
61
|
+
| `cloudflare-workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast` | 128K | | | | | | $0.29 | $2 |
|
|
62
|
+
| `cloudflare-workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct` | 128K | | | | | | $0.27 | $0.85 |
|
|
63
|
+
| `cloudflare-workers-ai/@cf/meta/llama-guard-3-8b` | 128K | | | | | | $0.48 | $0.03 |
|
|
64
|
+
| `cloudflare-workers-ai/@cf/meta/m2m100-1.2b` | 128K | | | | | | $0.34 | $0.34 |
|
|
65
|
+
| `cloudflare-workers-ai/@cf/mistral/mistral-7b-instruct-v0.1` | 128K | | | | | | $0.11 | $0.19 |
|
|
66
|
+
| `cloudflare-workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct` | 128K | | | | | | $0.35 | $0.56 |
|
|
67
|
+
| `cloudflare-workers-ai/@cf/myshell-ai/melotts` | 128K | | | | | | — | — |
|
|
68
|
+
| `cloudflare-workers-ai/@cf/openai/gpt-oss-120b` | 128K | | | | | | $0.35 | $0.75 |
|
|
69
|
+
| `cloudflare-workers-ai/@cf/openai/gpt-oss-20b` | 128K | | | | | | $0.20 | $0.30 |
|
|
70
|
+
| `cloudflare-workers-ai/@cf/pfnet/plamo-embedding-1b` | 128K | | | | | | $0.02 | — |
|
|
71
|
+
| `cloudflare-workers-ai/@cf/pipecat-ai/smart-turn-v2` | 128K | | | | | | — | — |
|
|
72
|
+
| `cloudflare-workers-ai/@cf/qwen/qwen2.5-coder-32b-instruct` | 128K | | | | | | $0.66 | $1 |
|
|
73
|
+
| `cloudflare-workers-ai/@cf/qwen/qwen3-30b-a3b-fp8` | 128K | | | | | | $0.05 | $0.34 |
|
|
74
|
+
| `cloudflare-workers-ai/@cf/qwen/qwen3-embedding-0.6b` | 128K | | | | | | $0.01 | — |
|
|
75
|
+
| `cloudflare-workers-ai/@cf/qwen/qwq-32b` | 128K | | | | | | $0.66 | $1 |
|
|
76
|
+
|
|
77
|
+
## Advanced Configuration
|
|
78
|
+
|
|
79
|
+
### Custom Headers
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
const agent = new Agent({
|
|
83
|
+
id: "custom-agent",
|
|
84
|
+
name: "custom-agent",
|
|
85
|
+
model: {
|
|
86
|
+
url: "https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/ai/v1",
|
|
87
|
+
id: "cloudflare-workers-ai/@cf/ai4bharat/indictrans2-en-indic-1B",
|
|
88
|
+
apiKey: process.env.CLOUDFLARE_ACCOUNT_ID,
|
|
89
|
+
headers: {
|
|
90
|
+
"X-Custom-Header": "value"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Dynamic Model Selection
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
const agent = new Agent({
|
|
100
|
+
id: "dynamic-agent",
|
|
101
|
+
name: "Dynamic Agent",
|
|
102
|
+
model: ({ requestContext }) => {
|
|
103
|
+
const useAdvanced = requestContext.task === "complex";
|
|
104
|
+
return useAdvanced
|
|
105
|
+
? "cloudflare-workers-ai/@cf/qwen/qwq-32b"
|
|
106
|
+
: "cloudflare-workers-ai/@cf/ai4bharat/indictrans2-en-indic-1B";
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Cohere
|
|
2
|
+
|
|
3
|
+
Cohere is available through the AI SDK. Install the provider package to use their models with Mastra.
|
|
4
|
+
|
|
5
|
+
For detailed provider-specific documentation, see the [AI SDK Cohere provider docs](https://ai-sdk.dev/providers/ai-sdk-providers/cohere).
|
|
6
|
+
|
|
7
|
+
To use this provider with Mastra agents, see the [Agent Overview documentation](https://mastra.ai/docs/agents/overview).
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
**npm**:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @ai-sdk/cohere
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**pnpm**:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm add @ai-sdk/cohere
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Yarn**:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
yarn add @ai-sdk/cohere
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Bun**:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
bun add @ai-sdk/cohere
|
|
33
|
+
```
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Cortecs
|
|
2
|
+
|
|
3
|
+
Access 21 Cortecs models through Mastra's model router. Authentication is handled automatically using the `CORTECS_API_KEY` environment variable.
|
|
4
|
+
|
|
5
|
+
Learn more in the [Cortecs documentation](https://cortecs.ai).
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
CORTECS_API_KEY=your-api-key
|
|
9
|
+
```
|
|
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: "cortecs/claude-4-5-sonnet"
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Generate a response
|
|
22
|
+
const response = await agent.generate("Hello!");
|
|
23
|
+
|
|
24
|
+
// Stream a response
|
|
25
|
+
const stream = await agent.stream("Tell me a story");
|
|
26
|
+
for await (const chunk of stream) {
|
|
27
|
+
console.log(chunk);
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Cortecs documentation](https://cortecs.ai) for details.
|
|
32
|
+
|
|
33
|
+
## Models
|
|
34
|
+
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| ---------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `cortecs/claude-4-5-sonnet` | 200K | | | | | | $3 | $16 |
|
|
38
|
+
| `cortecs/claude-sonnet-4` | 200K | | | | | | $3 | $17 |
|
|
39
|
+
| `cortecs/deepseek-v3-0324` | 128K | | | | | | $0.55 | $2 |
|
|
40
|
+
| `cortecs/devstral-2512` | 262K | | | | | | — | — |
|
|
41
|
+
| `cortecs/devstral-small-2512` | 262K | | | | | | — | — |
|
|
42
|
+
| `cortecs/gemini-2.5-pro` | 1.0M | | | | | | $2 | $11 |
|
|
43
|
+
| `cortecs/glm-4p5` | 131K | | | | | | $0.67 | $2 |
|
|
44
|
+
| `cortecs/glm-4p5-air` | 131K | | | | | | $0.22 | $1 |
|
|
45
|
+
| `cortecs/glm-4p7` | 198K | | | | | | $0.45 | $2 |
|
|
46
|
+
| `cortecs/gpt-4.1` | 1.0M | | | | | | $2 | $9 |
|
|
47
|
+
| `cortecs/gpt-oss-120b` | 128K | | | | | | — | — |
|
|
48
|
+
| `cortecs/intellect-3` | 128K | | | | | | $0.22 | $1 |
|
|
49
|
+
| `cortecs/kimi-k2-instruct` | 131K | | | | | | $0.55 | $3 |
|
|
50
|
+
| `cortecs/kimi-k2-thinking` | 262K | | | | | | $0.66 | $3 |
|
|
51
|
+
| `cortecs/llama-3.1-405b-instruct` | 128K | | | | | | — | — |
|
|
52
|
+
| `cortecs/minimax-m2` | 400K | | | | | | $0.39 | $2 |
|
|
53
|
+
| `cortecs/minimax-m2p1` | 196K | | | | | | $0.34 | $1 |
|
|
54
|
+
| `cortecs/nova-pro-v1` | 300K | | | | | | $1 | $4 |
|
|
55
|
+
| `cortecs/qwen3-32b` | 16K | | | | | | $0.10 | $0.33 |
|
|
56
|
+
| `cortecs/qwen3-coder-480b-a35b-instruct` | 262K | | | | | | $0.44 | $2 |
|
|
57
|
+
| `cortecs/qwen3-next-80b-a3b-thinking` | 128K | | | | | | $0.16 | $1 |
|
|
58
|
+
|
|
59
|
+
## Advanced Configuration
|
|
60
|
+
|
|
61
|
+
### Custom Headers
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
const agent = new Agent({
|
|
65
|
+
id: "custom-agent",
|
|
66
|
+
name: "custom-agent",
|
|
67
|
+
model: {
|
|
68
|
+
url: "https://api.cortecs.ai/v1",
|
|
69
|
+
id: "cortecs/claude-4-5-sonnet",
|
|
70
|
+
apiKey: process.env.CORTECS_API_KEY,
|
|
71
|
+
headers: {
|
|
72
|
+
"X-Custom-Header": "value"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Dynamic Model Selection
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
const agent = new Agent({
|
|
82
|
+
id: "dynamic-agent",
|
|
83
|
+
name: "Dynamic Agent",
|
|
84
|
+
model: ({ requestContext }) => {
|
|
85
|
+
const useAdvanced = requestContext.task === "complex";
|
|
86
|
+
return useAdvanced
|
|
87
|
+
? "cortecs/qwen3-next-80b-a3b-thinking"
|
|
88
|
+
: "cortecs/claude-4-5-sonnet";
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
```
|