Skip to content

Conversation

@ethanndickson
Copy link
Member

Gateway models like mux-gateway:anthropic/claude-opus-4-5 were not recognized for cost tracking, 1M context detection, or cache control because they don't match the expected provider:model format.

Changes

Add normalizeGatewayModel() utility that converts:

  • mux-gateway:provider/modelprovider:model

Applied at entry points of:

  • getModelStats() - cost/token lookups
  • supports1MContext() - 1M context detection
  • supportsAnthropicCache() - cache control
  • tokenizer resolveModelName() - tokenizer model resolution
  • getModelName() - model name extraction

Testing

Added unit tests for the new utility and updated existing test files.

Generated with mux

Gateway models like mux-gateway:anthropic/claude-opus-4-5 were not
recognized for cost tracking, 1M context detection, or cache control
because they don't match the expected provider:model format.

Add normalizeGatewayModel() utility that converts:
- mux-gateway:provider/model → provider:model

Applied at entry points of:
- getModelStats() - cost/token lookups
- supports1MContext() - 1M context detection
- supportsAnthropicCache() - cache control
- tokenizer resolveModelName() - tokenizer model resolution
- getModelName() - model name extraction

_Generated with `mux`_
@ethanndickson ethanndickson added this pull request to the merge queue Dec 1, 2025
Merged via the queue into main with commit 36eb40e Dec 1, 2025
13 checks passed
@ethanndickson ethanndickson deleted the strip-mux-gateway-prefix branch December 1, 2025 02:15
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