Skip to content

Move an AI agent to a self-hosted model with your own guardrails

Watch how to move an existing AI agent from a frontier model to a self-hosted model, add custom guardrails and protect sensitive data without rebuilding the agent or its workflows.

· Josh Noble

Why it matters

When your product depends on AI, changes to a model provider’s policies or guardrails can affect what your agent can do. Self-hosting gives you control over the model, its behavior and where your data goes. But switching models and protecting sensitive information shouldn’t mean rebuilding your agent from scratch.

With Tray.ai, you can swap an agent’s underlying model while keeping its existing tools and workflows intact. In this demo, a healthcare agent moves from Claude on AWS Bedrock to a locally hosted model using LM Studio. A Microsoft Presidio masking step then protects patient information before it reaches the model, with the original details restored afterward. The result is an agent running on your chosen model, with guardrails you control.

What you’ll see

  • A CareNavigator AI agent embedded in OpenEMR that retrieves patient records, checks coverage, finds in-network therapists and drafts insurance appeals
  • How to switch the agent from Claude on AWS Bedrock to a self-hosted model in LM Studio using Tray’s Merlin Agent Builder, without changing its tools or workflows
  • How Tray’s on-premise agent securely connects cloud workflows to a locally hosted model and Microsoft Presidio
  • How a Presidio masking step removes sensitive patient identifiers before they reach the model, then restores the original details in the completed insurance appeal