Mastra agents can now call self-hosted open-weight models: a private gateway keeps requests on your own network
Mastra introduced private model gateways, letting agent requests route to self-hosted open-weight models. Previously, using a hosted provider meant sensitive data left the local network and HIPAA or GDPR compliance became more complicated unless data retention agreements were in place; now a gateway gets a custom ID and the agent config references a model such as private/ollama/gpt-oss:20b. Self-hosting removes the third party, costs cover infrastructure rather than tokens, and an environment variable can hide external providers.