Mastra推出私有模型网关
Mastra推出自定义模型网关,可将智能体请求路由至自托管开放权重模型,并以自定义网关ID作为智能体配置中的模型前缀。厂商演示了通过Ollama运行gpt-oss:20b的研究智能体,Studio还可隐藏外部提供商,仅显示自有网关提供的模型。Mastra称自托管有助于敏感数据留在用户网络内并简化HIPAA或GDPR合规,但相关收益尚未经独立验证。
该功能为Mastra开发者提供了使用本地开放权重模型运行智能体并限制Studio可选提供商的明确路径,适用于重视隐私和部署控制的场景。
You can now route agent requests to self-hosted open-weight models using a custom model gateway. Give the gateway a custom ID, then use it as the model prefix in your agent's config: private/ollama/gpt-oss:20b.
Your browser does not support the video tag.A research agent in Studio runs on gpt-oss:20b through the gateway while the ollama serve logs show each request arrive locally, then the agent answers with a guide to deploying the model on AWS.
Using a hosted provider service can complicate HIPAA or GDPR compliance (unless data retention agreements are in place). Self-hosting removes the third party, preventing sensitive data from reaching models outside of your network.
Costs may also be reduced as you're only paying for infrastructure, not tokens, and you control which models your agents can use.
To hide external providers from Studio's model picker, set AUTO_BLOCK_EXTERNAL_PROVIDERS=true in your .env so users can only select models from your own gateways.
Get started
Install the latest @mastra/core and an AI SDK provider for your gateway's API:
#Mastra#Mastra Studio#Ollama#gpt-oss:20b#@mastra/core#@ai-sdk/openai-compatible