Skip to content

Model name aliasing for multi-provider fallback #186

@sarth6

Description

@sarth6

Hi there, we're running into an issue with provider fallback in the Gateway and wanted to get your guidance on the recommended approach.

The setup

We have a routing group for Anthropic that includes Vertex AI as a low-priority fallback:

anthropic routing group:
  - anthropic prod key (priority 1)
  - anthropic builtin (priority 0)
  - google-vertex builtin (priority -1)

Our goal is that if our Anthropic API key hits rate limits or has issues, we can fall back to Vertex AI which hosts the same Claude models.

The problem

When the Anthropic providers are unavailable and requests fall back to Vertex AI, we get 404 errors because the model name formats are incompatible:

  • Our code sends: claude-sonnet-4-0 (Anthropic API format)
  • Vertex AI expects: claude-sonnet-4@20250514 (uses @ instead of - for versions)

The actual error we see:

Publisher Model `projects/xxx/locations/global/publishers/anthropic/models/claude-sonnet-4` was not found

Looks like Vertex strips the -0 suffix and then can't find the model.

What we're wondering

  1. Is there a way to configure model name mappings per provider? Something like "when using the vertex provider, translate claude-sonnet-4-0 to claude-sonnet-4@20250514"?

  2. Or is mixing providers with different model name conventions in the same routing group just not supported? If so, what's the recommended way to get cross-provider redundancy for Claude models?

  3. Should we just remove Vertex from the anthropic routing group entirely and accept that fallback won't work across provider types?

We're seeing this in production when Anthropic has intermittent availability issues - works fine most of the time, but when fallback kicks in we get a burst of 404s.

Any guidance appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions