Skip to content

Commit acb834d

Browse files
author
1bcMax
committed
fix: use backend model names (claude-sonnet-4 not anthropic/claude-sonnet-4-6)
Backend only supports bare model names without anthropic/ prefix
1 parent cc075a5 commit acb834d

6 files changed

Lines changed: 48 additions & 68 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@blockrun/clawrouter",
3-
"version": "0.9.30",
3+
"version": "0.9.31",
44
"description": "Smart LLM router — save 78% on inference costs. 30+ models, one wallet, x402 micropayments.",
55
"type": "module",
66
"main": "dist/index.js",

scripts/reinstall.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ echo ""
275275
echo "Run: openclaw gateway restart"
276276
echo ""
277277
echo "Model aliases available:"
278-
echo " /model sonnet4.6 → anthropic/claude-sonnet-4-6"
279-
echo " /model opus4.6 → anthropic/claude-opus-4-6"
278+
echo " /model sonnet → claude-sonnet-4"
279+
echo " /model opus claude-opus-4"
280280
echo " /model codex → openai/gpt-5.2-codex"
281281
echo " /model deepseek → deepseek/deepseek-chat"
282282
echo " /model minimax → minimax/minimax-m2.5"

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ function injectModelsConfig(logger: { info: (msg: string) => void }): void {
259259
{ id: "eco", alias: "eco" },
260260
{ id: "premium", alias: "premium" },
261261
{ id: "free", alias: "free" },
262-
{ id: "sonnet", alias: "sonnet4.6" },
263-
{ id: "opus", alias: "opus4.6" },
262+
{ id: "sonnet", alias: "sonnet" },
263+
{ id: "opus", alias: "opus" },
264264
{ id: "haiku", alias: "haiku" },
265265
{ id: "gpt5", alias: "gpt5" },
266266
{ id: "codex", alias: "codex" },

src/models.ts

Lines changed: 25 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@ import type { ModelDefinitionConfig, ModelProviderConfig } from "./types.js";
1515
* Users can type `/model claude` instead of `/model blockrun/anthropic/claude-sonnet-4-6`.
1616
*/
1717
export const MODEL_ALIASES: Record<string, string> = {
18-
// Claude - short names (use dashes in version, not dots - Anthropic API format)
19-
claude: "anthropic/claude-sonnet-4-6",
20-
sonnet: "anthropic/claude-sonnet-4-6",
21-
opus: "anthropic/claude-opus-4-6",
22-
"opus-46": "anthropic/claude-opus-4-6",
23-
"opus-45": "anthropic/claude-opus-4-5",
24-
haiku: "anthropic/claude-haiku-4-5",
18+
// Claude - short names (backend uses bare model names without anthropic/ prefix)
19+
claude: "claude-sonnet-4",
20+
sonnet: "claude-sonnet-4",
21+
opus: "claude-opus-4",
22+
"opus-4": "claude-opus-4",
23+
haiku: "claude-haiku-4.5",
2524
// Claude - provider/shortname patterns (common in agent frameworks)
26-
"anthropic/sonnet": "anthropic/claude-sonnet-4-6",
27-
"anthropic/opus": "anthropic/claude-opus-4-6",
28-
"anthropic/haiku": "anthropic/claude-haiku-4-5",
29-
"anthropic/claude": "anthropic/claude-sonnet-4-6",
30-
// Backward compatibility - old dot notation still works
31-
"anthropic/claude-sonnet-4.6": "anthropic/claude-sonnet-4-6",
32-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4-6",
33-
"anthropic/claude-opus-4.5": "anthropic/claude-opus-4-5",
34-
"anthropic/claude-haiku-4.5": "anthropic/claude-haiku-4-5",
35-
// Base model names without version -> route to latest
36-
"anthropic/claude-sonnet-4": "anthropic/claude-sonnet-4-6",
37-
"anthropic/claude-opus-4": "anthropic/claude-opus-4-6",
38-
"anthropic/claude-haiku-4": "anthropic/claude-haiku-4-5",
25+
"anthropic/sonnet": "claude-sonnet-4",
26+
"anthropic/opus": "claude-opus-4",
27+
"anthropic/haiku": "claude-haiku-4.5",
28+
"anthropic/claude": "claude-sonnet-4",
29+
// Backward compatibility - various formats all route to backend names
30+
"anthropic/claude-sonnet-4": "claude-sonnet-4",
31+
"anthropic/claude-sonnet-4-6": "claude-sonnet-4",
32+
"anthropic/claude-sonnet-4.6": "claude-sonnet-4",
33+
"anthropic/claude-opus-4": "claude-opus-4",
34+
"anthropic/claude-opus-4-6": "claude-opus-4",
35+
"anthropic/claude-opus-4.6": "claude-opus-4",
36+
"anthropic/claude-haiku-4": "claude-haiku-4.5",
37+
"anthropic/claude-haiku-4-5": "claude-haiku-4.5",
38+
"anthropic/claude-haiku-4.5": "claude-haiku-4.5",
3939

4040
// OpenAI
4141
gpt: "openai/gpt-4o",
@@ -270,8 +270,9 @@ export const BLOCKRUN_MODELS: BlockRunModel[] = [
270270
},
271271

272272
// Anthropic - all Claude models excel at agentic workflows
273+
// Backend uses bare model names (claude-sonnet-4, not anthropic/claude-sonnet-4-6)
273274
{
274-
id: "anthropic/claude-haiku-4-5",
275+
id: "claude-haiku-4.5",
275276
name: "Claude Haiku 4.5",
276277
inputPrice: 1.0,
277278
outputPrice: 5.0,
@@ -280,8 +281,8 @@ export const BLOCKRUN_MODELS: BlockRunModel[] = [
280281
agentic: true,
281282
},
282283
{
283-
id: "anthropic/claude-sonnet-4-6",
284-
name: "Claude Sonnet 4.6",
284+
id: "claude-sonnet-4",
285+
name: "Claude Sonnet 4",
285286
inputPrice: 3.0,
286287
outputPrice: 15.0,
287288
contextWindow: 200000,
@@ -290,7 +291,7 @@ export const BLOCKRUN_MODELS: BlockRunModel[] = [
290291
agentic: true,
291292
},
292293
{
293-
id: "anthropic/claude-opus-4",
294+
id: "claude-opus-4",
294295
name: "Claude Opus 4",
295296
inputPrice: 15.0,
296297
outputPrice: 75.0,
@@ -299,27 +300,6 @@ export const BLOCKRUN_MODELS: BlockRunModel[] = [
299300
reasoning: true,
300301
agentic: true,
301302
},
302-
{
303-
id: "anthropic/claude-opus-4-5",
304-
name: "Claude Opus 4.5",
305-
inputPrice: 5.0,
306-
outputPrice: 25.0,
307-
contextWindow: 200000,
308-
maxOutput: 32000,
309-
reasoning: true,
310-
agentic: true,
311-
},
312-
{
313-
id: "anthropic/claude-opus-4-6",
314-
name: "Claude Opus 4.6",
315-
inputPrice: 5.0,
316-
outputPrice: 25.0,
317-
contextWindow: 200000,
318-
maxOutput: 64000,
319-
reasoning: true,
320-
vision: true,
321-
agentic: true,
322-
},
323303

324304
// Google
325305
{

src/router/config.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ export const DEFAULT_ROUTING_CONFIG: RoutingConfig = {
663663
"xai/grok-4-0709",
664664
"openai/gpt-5.2", // Newer and cheaper input than gpt-4o
665665
"openai/gpt-4o",
666-
"anthropic/claude-sonnet-4-6",
666+
"claude-sonnet-4",
667667
],
668668
},
669669
REASONING: {
@@ -717,32 +717,32 @@ export const DEFAULT_ROUTING_CONFIG: RoutingConfig = {
717717
premiumTiers: {
718718
SIMPLE: {
719719
primary: "moonshot/kimi-k2.5", // $0.50/$2.40 - good for simple coding
720-
fallback: ["anthropic/claude-haiku-4-5", "google/gemini-2.5-flash", "xai/grok-code-fast-1"],
720+
fallback: ["claude-haiku-4.5", "google/gemini-2.5-flash", "xai/grok-code-fast-1"],
721721
},
722722
MEDIUM: {
723723
primary: "openai/gpt-5.2-codex", // $2.50/$10 - strong coding for medium tasks
724724
fallback: [
725725
"moonshot/kimi-k2.5",
726726
"google/gemini-2.5-pro",
727727
"xai/grok-4-0709",
728-
"anthropic/claude-sonnet-4-6",
728+
"claude-sonnet-4",
729729
],
730730
},
731731
COMPLEX: {
732-
primary: "anthropic/claude-opus-4-6", // Best quality for complex tasks
732+
primary: "claude-opus-4", // Best quality for complex tasks
733733
fallback: [
734734
"openai/gpt-5.2-codex",
735-
"anthropic/claude-opus-4-5",
736-
"anthropic/claude-sonnet-4-6",
735+
"claude-opus-4",
736+
"claude-sonnet-4",
737737
"google/gemini-3-pro-preview",
738738
"moonshot/kimi-k2.5",
739739
],
740740
},
741741
REASONING: {
742-
primary: "anthropic/claude-sonnet-4-6", // $3/$15 - best for reasoning/instructions
742+
primary: "claude-sonnet-4", // $3/$15 - best for reasoning/instructions
743743
fallback: [
744-
"anthropic/claude-opus-4-6",
745-
"anthropic/claude-opus-4-5",
744+
"claude-opus-4",
745+
"claude-opus-4",
746746
"openai/o4-mini", // Newer and cheaper than o3 ($1.10 vs $2.00)
747747
"openai/o3",
748748
"xai/grok-4-1-fast-reasoning",
@@ -756,7 +756,7 @@ export const DEFAULT_ROUTING_CONFIG: RoutingConfig = {
756756
primary: "moonshot/kimi-k2.5", // Cheaper than Haiku ($0.5/$2.4 vs $1/$5), larger context
757757
fallback: [
758758
"minimax/minimax-m2.5", // $0.30/$1.20 - agentic capable, cheaper than kimi
759-
"anthropic/claude-haiku-4-5",
759+
"claude-haiku-4.5",
760760
"xai/grok-4-1-fast-non-reasoning",
761761
"openai/gpt-4o-mini",
762762
],
@@ -766,24 +766,24 @@ export const DEFAULT_ROUTING_CONFIG: RoutingConfig = {
766766
fallback: [
767767
"minimax/minimax-m2.5", // $0.30/$1.20 - agentic capable
768768
"moonshot/kimi-k2.5",
769-
"anthropic/claude-haiku-4-5",
770-
"anthropic/claude-sonnet-4-6",
769+
"claude-haiku-4.5",
770+
"claude-sonnet-4",
771771
],
772772
},
773773
COMPLEX: {
774-
primary: "anthropic/claude-sonnet-4-6",
774+
primary: "claude-sonnet-4",
775775
fallback: [
776-
"anthropic/claude-opus-4-6", // Latest Opus - best agentic
776+
"claude-opus-4", // Latest Opus - best agentic
777777
"minimax/minimax-m2.5", // $0.30/$1.20 - cheap agentic fallback
778778
"openai/gpt-5.2",
779779
"google/gemini-3-pro-preview",
780780
"xai/grok-4-0709",
781781
],
782782
},
783783
REASONING: {
784-
primary: "anthropic/claude-sonnet-4-6", // Strong tool use + reasoning for agentic tasks
784+
primary: "claude-sonnet-4", // Strong tool use + reasoning for agentic tasks
785785
fallback: [
786-
"anthropic/claude-opus-4-6",
786+
"claude-opus-4",
787787
"minimax/minimax-m2.5", // $0.30/$1.20 - reasoning + agentic
788788
"xai/grok-4-1-fast-reasoning",
789789
"deepseek/deepseek-reasoner",

0 commit comments

Comments
 (0)