Blank white background with no objects or features visible.

We’re sharing complimentary access to the full Gartner Hype Cycle for AI Governance 2026. Get your copy →

Migrating from Bifrost: Moving a Self-Hosted AI Gateway to a Managed One

By Ashish Dubey

Updated: October 29, 2026

Published: October 29, 2026

Bifrost is a good open source AI gateway, and many teams start there for the right reasons: it is free, fast and runs anywhere. The reasons teams later move off a self-hosted AI gateway are usually operational rather than functional. Someone has to run the cluster, keep PostgreSQL highly available, upgrade through breaking releases, and answer the security review. When that work stops being worth it, the question becomes how to move without breaking every application that calls the gateway.

This guide is the plan we would follow. It maps Bifrost’s concepts to a managed gateway (we use the TrueFoundry AI Gateway as the destination), lists the client changes, and lays out a cutover with a rollback path. It also covers what does not carry over, so you can scope the work honestly.

Where we lean on our own experience, from running Bifrost OSS v2.0.0 and from installing a TrueFoundry gateway plane in our own cluster in October 2026, we say so.

When a self-hosted AI gateway stops being worth it

The free tier of Bifrost is a complete gateway, so feature gaps are rarely the trigger. These usually are:

  • You need more than one node. OSS replicas don’t share state. They read the same static config.json, need a restart for every change, and keep budgets, rate-limit counters and key revocations per pod. Live sync is Enterprise only.
  • Security review. SSO, RBAC, audit logs, vault-backed secrets and guardrails are Enterprise features, priced by quote. Service identities don’t exist in either tier; services hold long-lived virtual keys.
  • Upgrades. The v1.5.0 release carried 16 breaking changes and database migrations that cannot be rolled back. Someone has to read every release note and back up PostgreSQL before each upgrade.
  • On-call. The gateway sits in the path of every model call. If it goes down at 2 a.m., it is your page.

If two or more of these are true, a managed gateway usually costs less than the engineering time. Our posts on Bifrost pricing and [USER TO FILL: link to Bifrost Enterprise vs OSS post when live] cover the buy-versus-run math in more detail.

Pick the deployment model first

“Managed” covers more than one shape, and the choice decides how much of the migration is infrastructure work. TrueFoundry offers three (deployment options):

ModelWhat runs wherePick it when
SaaS gatewayGateway and control plane run on TrueFoundry’s infrastructure. Apps call https://gateway.truefoundry.ai.You want zero infrastructure and your data policy allows a hosted gateway.
Gateway plane in your clusterThe gateway (data plane) runs in your Kubernetes cluster; the control plane stays hosted. Config syncs down to the gateway.Model traffic must stay in your network, but you don’t want to run the control plane.
Fully self-hostedControl plane and gateway both run in your environment, including air-gapped.Regulated environments where nothing may leave your network.

We used the middle option for our own evaluation. The gateway plane installs from a Helm chart and authenticates to the control plane with a gateway token; models, routing and access rules are configured in the control plane and synced to the gateway. The chart also deploys a Redis pod next to the gateway. Prerequisites are Kubernetes 1.27 or later, block-storage volumes, a domain and certificate for the gateway endpoint, an image pull secret from TrueFoundry, and egress from the cluster to your control plane URL (deploy gateway plane). Self-hosting the gateway plane is on TrueFoundry’s Enterprise tier.

Step 1: inventory what Bifrost is doing today

Most migration surprises come from config nobody remembers writing. Before creating anything in the new gateway, list:

  • Providers and keys: every provider, every key, key weights, and custom endpoints such as vLLM or Ollama.
  • Virtual keys: owner (team, customer or none), allowed providers and models, budgets, rate limits, MCP tool access, and expiry.
  • Routing: weighted provider configs, fallback chains, retry settings and every CEL routing rule, with its scope and priority.
  • MCP: connected MCP servers, tool groups and their auth modes.
  • Observability: content-logging settings, OTel and other connectors, retention, and any dashboards or alerts built on bifrost_* metrics.
  • Plugins: custom Go plugins, semantic caching, and the Maxim plugin.
  • Callers: every application, which SDK it uses, which Bifrost route it calls (OpenAI-compatible or a provider-native route), and which x-bf-* headers it sends.

If you run Bifrost with a file-based config, config.json is most of this list. If you use the database-backed config store, read it back through the management API rather than the UI, so nothing is missed.

Step 2: map Bifrost concepts to the new gateway

The mapping below is the core of the migration. Bifrost behavior comes from Bifrost’s docs; TrueFoundry behavior comes from the TrueFoundry docs linked in each row.

BifrostTrueFoundry AI GatewayNotes
Provider with weighted keysProvider (model) account with models; several accounts per provider (quick start)Split keys you want to route between into separate accounts.
Model name openai/gpt-4o-mini<account>/<model>, for example openai-main/gpt-4o-miniEvery caller’s model string changes unless you put a virtual model in front.
Virtual key (bearer secret, owned by a team, a customer or nothing)Personal access tokens for people; virtual account tokens for services, with auto-rotation and secret-store sync (API keys)The step that improves security most: each service gets its own identity.
Allowed providers and models on a keyModel access granted to users, teams and virtual accounts through rolesGrant per model, not tenant-wide.
Budgets (key, team, customer, provider, model)Budget limiting rules matched on subjects, models, provider accounts and metadata; all matching rules must pass (budget limiting)Start new budgets in audit mode for a week to compare against Bifrost’s numbers.
Request and token rate limitsRate limiting rules for requests and tokens, partitioned by user, model, virtual account or metadata (rate limiting)Rate limits cap throughput; budgets cap spend. Keep them separate.
Weighted routing, fallbacks, retriesVirtual models with weight, priority or latency strategies, retries and fallback status codes (virtual models)A virtual model also gives callers one stable name across providers.
CEL routing rulesNo one-to-one equivalentRewrite each rule as a virtual model, a metadata-scoped policy, or app-side model selection. See below.
x-bf-dim-* and x-bf-lh-* headersX-TFY-METADATA header, usable in budget, rate-limit and logging rules and as metric labelsCallers change one header instead of many.
Guardrails (Enterprise)Guardrails with validate and mutate modes, enforce or audit (guardrails)Check which tenant-wide rules already exist before routing traffic; see the gotchas.
MCP clients and tool groupsMCP Gateway servers with inbound and outbound auth (MCP auth)Per-user OAuth flows need users to re-consent.
Content logging on or off (global, per request, per connector)Logging configs per user, team, virtual account, model or metadata, with redaction (logging configuration)Decide logging rules before cutover; see below.
OTel plugin, Prometheus /metricsOTel export from gateway settings; Prometheus /metrics when the gateway runs in your cluster (OTel export)Dashboards on bifrost_* metric names must be rebuilt.
Custom Go pluginsNo direct equivalentRe-implement as a custom guardrail, or move the logic into the app.

Rewriting CEL routing rules

CEL rules are the part of a Bifrost config that does not translate mechanically. Sort each rule by what it is really doing:

  • Splitting traffic or failing over (weighted targets, fallbacks): becomes a virtual model.
  • Routing by team or environment (for example, a header like x-environment): becomes a separate virtual model per environment, with access granted to the right team, or metadata-scoped policies.
  • Reacting to budget usage (moving traffic to a cheaper model past a threshold): becomes a budget rule plus a fallback, or a decision in the application.
  • Anything else: write it down and decide whether it belongs in the gateway at all.

Step 3: change the clients

For an application using the OpenAI SDK, the change is three values: base URL, API key and model name.

from openai import OpenAI

# Before: Bifrost
client = OpenAI(base_url="http://bifrost.internal:8080/v1",
                api_key="unused",
                default_headers={"x-bf-vk": "sk-bf-team-search",
                                 "x-bf-dim-environment": "production"})
client.chat.completions.create(model="openai/gpt-4o-mini", messages=msgs)

# After: TrueFoundry AI Gateway
client = OpenAI(base_url=GATEWAY_BASE_URL,               # e.g. https://gateway.truefoundry.ai
                api_key=VIRTUAL_ACCOUNT_TOKEN,           # one per service
                default_headers={"X-TFY-METADATA": '{"environment": "production"}'})
client.chat.completions.create(model="openai-main/gpt-4o-mini", messages=msgs)

A few things to check per caller:

  • Auth becomes mandatory. In our testing, a default Bifrost OSS install accepted requests with no credentials, so some internal callers may never have sent one. Every TrueFoundry request carries a bearer token. Find those callers before cutover, not during it.
  • Provider-native routes. If a caller uses Bifrost’s Anthropic, Gemini or Bedrock-compatible routes with the provider’s own SDK, check the destination’s native SDK support. TrueFoundry supports the OpenAI, Anthropic, Google Gen AI, Azure OpenAI and boto3 SDKs, with routing configuration supported for some and not others (native SDK support).
  • Response shape. When we pointed the OpenAI Python SDK at Bifrost v2.0.0, four of six scenarios matched OpenAI exactly; the streaming role, logprobs and error shape differed. Code that parses Bifrost’s error bodies or works around its streaming quirks may need adjusting when it talks to a different gateway. Test error handling, not only the happy path.
  • Provider differences don’t go away. In our Bifrost tests the same request shape produced different tool-schema strictness, reasoning parameters and model-retirement errors across providers. That is true behind any gateway, so keep per-provider contract tests in your CI.

Step 4: cut over gradually, with a way back

  1. Stand up the new gateway next to Bifrost. Recreate providers, models, virtual accounts, budgets in audit mode, rate limits, guardrails and logging configs. Leave Bifrost untouched.
  2. Run contract tests against both gateways: non-streaming and streaming chat, tool calls, structured output, embeddings, error cases and each provider-native route you use.
  3. Move one low-risk service first. Switch its base URL, token and model names through config or a feature flag, so switching back is a deploy, not a code change.
  4. Compare for a week. Token counts and calculated cost per service should line up between Bifrost’s logs and the new gateway’s dashboard. A difference usually means a pricing or model-name mapping is wrong.
  5. Move the rest in batches, highest-volume services last. Flip budgets from audit to enforce once numbers agree.
  6. Keep Bifrost running read-only for a rollback window, then revoke its virtual keys. On multi-replica OSS, revoking a key does not propagate between pods, so restart every replica after revoking, or simply shut Bifrost down.

What does not carry over

  • Request history. Bifrost’s SQLite or PostgreSQL schema is not a stable interchange format. If you need the history for audits or evals, export it through the logs API or your existing connectors before decommissioning, and keep it outside the gateway.
  • Custom Go plugins. They are compiled against a specific Bifrost core and Go version, so they move as a rewrite.
  • CEL expressions, as above.
  • Cache contents. Semantic and exact-match caches start cold on the new gateway.
  • Dashboards and alerts built on bifrost_* metric names and labels.
  • Bifrost-specific headers such as x-bf-vk, x-bf-dim-*, x-bf-lh-* and the per-request logging override.
  • MCP OAuth consents for per-user connections; users authorize again.

Gotchas from our own setup

These come from installing a TrueFoundry gateway plane in our cluster and pointing test traffic at it.

  • Tenant-wide guardrail rules apply to new callers immediately. Our tenant already had a PII guardrail rule; our first test requests were rejected with HTTP 400 until we excluded the test virtual account from it. Review existing guardrail rules, and run new ones in audit mode, before moving production traffic.
  • Request logging is on by default. With a hosted control plane, the gateway sends request logs to it. You can keep the request and response data in a bucket in your own cloud instead, and logging configs can turn body logging off or redact it per team, model or metadata. Decide this with your security team before the first production request, not after.
  • Self-hosted models register like any other provider. We registered an OpenAI-compatible endpoint running in our cluster as a self-hosted model and called it as <account>/<model>. Internal vLLM or similar endpoints you reach through Bifrost today move the same way.
  • Size for the extra pod. The gateway-plane chart runs Redis alongside the gateway. Include it in your capacity and cost plan.

Is a managed gateway right for you?

Stay on self-hosted Bifrost if you run a single node, have the platform engineers to own it, and don’t need SSO, audit or service identities.

Move to Bifrost Enterprise if you want to stay on Bifrost and keep operating the gateway yourself, but need clustering and the security features. You will still own the cluster, HA PostgreSQL and upgrades.

Move to a managed gateway if the operational load is the problem. Choose SaaS if your data policy allows it, or a gateway plane in your own cluster if model traffic has to stay inside your network.

Why TrueFoundry as the destination

  • You choose how managed. SaaS, a gateway plane in your cluster with a hosted control plane, or fully self-hosted, including air-gapped.
  • Config sync is the architecture. Gateway pods are stateless and receive config, users, virtual accounts and authorization rules from the control plane in real time; the full config is republished every 10 minutes so a missed update cannot drift, and gateways keep serving on their last config if the control plane is unreachable (gateway plane architecture). That replaces Bifrost’s restart-every-pod model on OSS.
  • Service identity built in. Virtual accounts give each application its own token with scheduled rotation, a grace period and secret-store sync.
  • Policy as rules. Budgets, rate limits, guardrails and logging are separate rule sets matched on who, which model and request metadata, with audit modes for safe rollout.

If you are planning a move off a self-hosted AI gateway, book a demo and bring your Bifrost config; we can walk through the mapping with you. To see the product first, start at the TrueFoundry AI Gateway page.

Related reading

Conclusion

Moving off a self-hosted AI gateway is less about the client change, which is small, and more about faithfully recreating keys, policies and routing, then cutting over one service at a time with a way back. Do the inventory first, map every virtual key to a real identity, rewrite CEL rules on purpose rather than by translation, and keep Bifrost running until the numbers agree. If you want a second pair of eyes on the mapping, book a TrueFoundry demo.

Try now.

One gateway for all your models, MCP servers, and agents.
No credit card needed.

Start free
Table of Contents

One Gateway for Every LLM, Agent and MCP Server

Book a 30-min with our AI expert

Book a Demo

The fastest way to build, govern and scale your AI

Book Demo
Summarize with
ChatGPT logo by OpenAI
Perplexity AI logo
Blurry red snowflake on white background, symmetrical frosty design with soft edges and abstract shape.

Discover More

No items found.
Know everything about graph engineering
October 29, 2026
|
5 min read

Graph Engineering for Multi-Agent Systems: Architecture, Governance, and Observability

No items found.
A guide on AI governance best practices
October 29, 2026
|
5 min read

AI Governance Best Practices: A Practical Guide for Scaling AI Safely

No items found.
October 29, 2026
|
5 min read

LLM Monitoring with Bifrost: Prometheus and OpenTelemetry in Practice

No items found.
October 29, 2026
|
5 min read

Migrating from Bifrost: Moving a Self-Hosted AI Gateway to a Managed One

No items found.
No items found.

Recent Blogs

Frequently asked questions

How hard is it to migrate off a self-hosted AI gateway like Bifrost?

For applications using the OpenAI-compatible API, the client change is a base URL, a token and model names. Most of the work is recreating keys, budgets, rate limits and routing rules, and rewriting anything Bifrost-specific such as CEL rules and Go plugins.

Can I keep my application code unchanged when moving from Bifrost?

Mostly, if the code reads the base URL, API key and model names from config. Code that parses Bifrost error bodies, sends x-bf-* headers or uses provider-native routes needs review.

Do I lose my Bifrost request history?

It does not migrate automatically. Export it through Bifrost’s logs API or your existing connectors before you shut Bifrost down, and store it separately.

Can I deploy TrueFoundry in my own VPC or on-prem?

Yes. TrueFoundry runs as managed SaaS, as a gateway plane in your cloud, or fully self-hosted in your VPC, on-prem or air-gapped. Regulated teams usually pick a self-hosted option so request data stays in their environment.

Is TrueFoundry SOC 2 / HIPAA / GDPR compliant?

TrueFoundry supports SOC 2, HIPAA, and GDPR standards, with RBAC, SSO, and immutable audit logging built in. See the Trust Center for current attestations.

Take a quick product tour
Start Product Tour
Product Tour