Skip to content

Claude: support custom models in gateway discovery - #375

Open
andy-xu-db wants to merge 1 commit into
mainfrom
andy.xu/claude-gateway-model-aliases
Open

Claude: support custom models in gateway discovery#375
andy-xu-db wants to merge 1 commit into
mainfrom
andy.xu/claude-gateway-model-aliases

Conversation

@andy-xu-db

Copy link
Copy Markdown
Collaborator

Summary

Claude Code filters gateway-discovered models by ID, which hides custom model-service FQNs that do not contain claude or anthropic.

This change updates the relayed gateway proxy to:

  • advertise those models with an anthropic-aigw- ID while preserving the original display_name
  • rewrite pagination cursors to the upstream IDs
  • rewrite selected model IDs back before forwarding Messages API requests
  • reverse only aliases observed in discovery responses, leaving unrelated prefixed IDs untouched

Testing

  • uv run ruff check .
  • uv run pytest tests/test_gateway_proxy.py (28 passed)
  • uv run pytest (1944 passed, 37 skipped, 1 environment-dependent failure: the Claude user-agent e2e timed out before reaching its local capture server)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant