Try Bifrost Enterprise free for 14 days.
Request access
Back to Blog

Regex key aliases: one alias row for a whole model family

Suresh Chaudhary

Suresh Chaudhary

Nov 20, 2026 · 4 min read

Regex key aliases: one alias row for a whole model family

Bifrost keys could already map a model name your apps send to the ID a provider expects, one name per row. With v2.6.0, an alias can now be a regex pattern, so one row covers every model whose name matches.

Say your platform team serves Claude through Amazon Bedrock. Your apps send plain model names like claude-opus-5 and claude-sonnet-5, but Bedrock wants an inference profile ID such as global.anthropic.claude-opus-5, which spreads requests across regions.

Bifrost has handled that gap for a while with key aliases. On the Bedrock key, under Deployments, you add a row that maps claude-opus-5 to global.anthropic.claude-opus-5, and your apps never see the profile ID.

That works for one model. A team that allows the whole Claude family needs a row for every model, and another one each time Anthropic ships a release. Miss a row and a request for the new model goes to Bedrock under its plain name, which Bedrock rejects.

With Bifrost v2.6.0, the alias name can be a regex: pattern, and the target can reuse what the pattern captured. It ships in open source and Bifrost Enterprise.

Cover every Claude model with one row

Here is the whole Bedrock key in config.json:

The models entry allows the Claude names on this key, and the alias rewrites them. A request for claude-opus-5 goes to Bedrock as global.anthropic.claude-opus-5. So does any Claude model that ships next month, with no config change.

The pattern is RE2, case-insensitive, and has to match the whole requested name. That is the same rule regex: entries already follow in a key's models and blacklisted_models lists. In the target, $1 inserts whatever the first set of brackets in the pattern matched. ${1} and named groups like ${name} work too.

In the UI, open Model Providers, edit the Bedrock key, and add a row under Deployments whose name starts with regex:. A regex icon appears at the end of the name field, so you can tell pattern rows from exact ones at a glance. One key can hold a pattern per model family, as the key below does for Claude, GPT and Grok.

Pin one model to a different profile

Sometimes one model needs to go somewhere else. Maybe claude-opus-4-8 should stay on the US profile for a data-residency requirement.

Add an exact row next to the pattern:

An exact name always beats a pattern, in any casing. claude-opus-4-8 goes to the us. profile, and every other Claude model still follows the pattern.

Keep logs and cost on the model that ran

Open a request in LLM Logs and look under Request Details. Model is the upstream ID and Alias is the name your app sent. A request for claude-opus-5 shows Model global.anthropic.claude-opus-5 and Alias claude-opus-5.

Bifrost prices the request from the pricing row for the upstream ID, so a us.anthropic.$1 target costs the us. profile rate, not the base anthropic. rate.

Here is a request for gpt-6.2-sol that went through the regex:(gpt-.*) row above and reached the provider as openai.gpt-6.2-sol:

Access control still applies to the name your app sends

A pattern alias does not allow a model by itself. The key's models list still has to admit the requested name, with * or a matching regex: entry. That is why the example above has regex:claude-.* in both places.

Block lists check the requested name too, never the upstream ID. To block a model, block claude-opus-5, not global.anthropic.claude-opus-5.

Bifrost rejects an invalid pattern, or a target like $2 in a pattern with one set of brackets, when you save the key. The UI shows the error inline on the row.

One thing patterns do not change is /v1/models. Bifrost cannot list every name a pattern could match, so the listing shows what Bedrock returns, filtered by the key's models list. Bedrock lists anthropic.claude-opus-5, which claude-.* does not match. If your clients pick model names from that listing, make the vendor prefix optional in both places, and both claude-opus-5 and anthropic.claude-opus-5 will reach global.anthropic.claude-opus-5:

Get started today

Regex key aliases ship in open source and Bifrost Enterprise from v2.6.0. The model aliasing docs cover the full syntax and precedence rules.