Skip to content

Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.

usage: a Bedrock model of a newer maker answered by its own name is no swap

ggbdpqc2d6a64c7d7a
diff --git a/internal/gateway/bedrock_served_test.go b/internal/gateway/bedrock_served_test.go
index 688c94936..3b6c2f9e4 100644
--- a/internal/gateway/bedrock_served_test.go
+++ b/internal/gateway/bedrock_served_test.go
@@ -43,9 +43,20 @@ func TestBedrockProfileAnsweredByItsModelIsNoSwap(t *testing.T) {
{"global.anthropic.claude-haiku-4-5-20251001-v1:0", "claude-haiku-4-5-20251001", false},
{"global.openai.gpt-6-luna", "gpt-6-luna", false},
{"apac.anthropic.claude-opus-5-5", "claude-opus-5-5", false},
+ // models.dev's bedrock list has since grown makers whose models
+ // are answered by their own name as Anthropic's are: xAI's, Writer's,
+ // Moonshot's and NVIDIA's, asked for as geography. maker ids
+ {"global.xai.grok-4.7", "grok-4.7", false},
+ {"us.xai.grok-4.6", "xai.grok-4.6", false},
+ {"us.writer.palmyra-x5-v1:0", "palmyra-x5", false},
+ {"us.writer.palmyra-x5-v1:0", "writer.palmyra-x5-v1:0", false},
+ {"moonshot.kimi-k2-thinking", "kimi-k2-thinking", false},
+ {"nvidia.nemotron-nano-12b-v2", "nemotron-nano-12b-v2", false},
// another model is still a swap
{"global.anthropic.claude-opus-5-5", "claude-sonnet-5", true},
{"global.openai.gpt-6-sol", "gpt-6-luna", true},
+ {"global.xai.grok-4.7", "grok-4.6", true},
+ {"us.writer.palmyra-x5-v1:0", "palmyra-x4", true},
} {
if got := usage.Swapped(c.sent, c.served); got != c.swapped {
t.Errorf("Swapped(%q, %q) = %v, want %v", c.sent, c.served, got, c.swapped)
diff --git a/internal/usage/served.go b/internal/usage/served.go
index 6019d2c2b..64b96c9de 100644
--- a/internal/usage/served.go
+++ b/internal/usage/served.go
@@ -24,8 +24,11 @@ var versionTail = regexp.MustCompile(`(?:[-_@:](?:\d{4}-\d{2}-\d{2}|\d{2}-\d{2}|
// vendorDot is Bedrock's region and maker before a model's name
// (us.anthropic.claude-…), the geography of an inference profile as
-// catalog's bedrockGeos has them: global. and us-gov. among them.
-var vendorDot = regexp.MustCompile(`^(?:(?:global|us-gov|[a-z]{2,4})\.)?(?:anthropic|amazon|meta|mistral|cohere|ai21|deepseek|qwen|openai|google|moonshotai|minimax|zai)\.`)
+// catalog's bedrockGeos has them: global. and us-gov. among them. The
+// makers are those models.dev's bedrock list names ids by (xai.grok-4.7,
+// writer.palmyra-x5, moonshot.kimi-k2-thinking, nvidia.nemotron), which
+// the reply names as Anthropic's own are, without the geography.
+var vendorDot = regexp.MustCompile(`^(?:(?:global|us-gov|[a-z]{2,4})\.)?(?:anthropic|amazon|meta|mistral|cohere|ai21|deepseek|qwen|openai|google|moonshotai|moonshot|minimax|nvidia|writer|xai|zai)\.`)
// contextTail is what Claude Code writes after a model's name for the size of
// its context: claude-opus-5[1m].