Skip to content

Commit 20d3a33

Browse files
chore: add aihubmix models (#81)
1 parent 62b9aad commit 20d3a33

File tree

3 files changed

+163
-0
lines changed

3 files changed

+163
-0
lines changed
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
{
2+
"name": "AIHubMix",
3+
"id": "aihubmix",
4+
"api_key": "$AIHUBMIX_API_KEY",
5+
"api_endpoint": "https://aihubmix.com/v1",
6+
"type": "openai",
7+
"default_large_model_id": "claude-sonnet-4-5",
8+
"default_small_model_id": "claude-3-5-haiku",
9+
"default_headers": {
10+
"APP-Code": "IUFF7106"
11+
},
12+
"models": [
13+
{
14+
"id": "claude-sonnet-4-5",
15+
"name": "Claude Sonnet 4.5",
16+
"cost_per_1m_in": 3,
17+
"cost_per_1m_out": 15,
18+
"cost_per_1m_in_cached": 3.75,
19+
"cost_per_1m_out_cached": 0.3,
20+
"context_window": 200000,
21+
"default_max_tokens": 50000,
22+
"can_reason": true,
23+
"supports_attachments": true
24+
},
25+
{
26+
"id": "claude-opus-4-1",
27+
"name": "Claude Opus 4.1",
28+
"cost_per_1m_in": 15,
29+
"cost_per_1m_out": 75,
30+
"cost_per_1m_in_cached": 18.75,
31+
"cost_per_1m_out_cached": 1.5,
32+
"context_window": 200000,
33+
"default_max_tokens": 32000,
34+
"can_reason": true,
35+
"supports_attachments": true
36+
},
37+
{
38+
"id": "claude-3-5-haiku",
39+
"name": "Claude 3.5 Haiku",
40+
"cost_per_1m_in": 0.7999999999999999,
41+
"cost_per_1m_out": 4,
42+
"cost_per_1m_in_cached": 1,
43+
"cost_per_1m_out_cached": 0.08,
44+
"context_window": 200000,
45+
"default_max_tokens": 5000,
46+
"can_reason": false,
47+
"supports_attachments": true
48+
},
49+
{
50+
"id": "gemini-2.5-pro",
51+
"name": "Gemini 2.5 Pro",
52+
"cost_per_1m_in": 1.25,
53+
"cost_per_1m_out": 10,
54+
"cost_per_1m_in_cached": 1.625,
55+
"cost_per_1m_out_cached": 0.31,
56+
"context_window": 1048576,
57+
"default_max_tokens": 50000,
58+
"can_reason": true,
59+
"supports_attachments": true
60+
},
61+
{
62+
"id": "gemini-2.5-flash",
63+
"name": "Gemini 2.5 Flash",
64+
"cost_per_1m_in": 0.3,
65+
"cost_per_1m_out": 2.5,
66+
"cost_per_1m_in_cached": 0.3833,
67+
"cost_per_1m_out_cached": 0.075,
68+
"context_window": 1048576,
69+
"default_max_tokens": 50000,
70+
"can_reason": true,
71+
"supports_attachments": true
72+
},
73+
{
74+
"id": "gpt-5",
75+
"name": "GPT-5",
76+
"cost_per_1m_in": 1.25,
77+
"cost_per_1m_out": 10,
78+
"cost_per_1m_in_cached": 0.25,
79+
"cost_per_1m_out_cached": 0.25,
80+
"context_window": 400000,
81+
"default_max_tokens": 128000,
82+
"can_reason": true,
83+
"has_reasoning_efforts": true,
84+
"default_reasoning_effort": "minimal",
85+
"supports_attachments": true
86+
},
87+
{
88+
"id": "gpt-5-mini",
89+
"name": "GPT-5 Mini",
90+
"cost_per_1m_in": 0.25,
91+
"cost_per_1m_out": 2,
92+
"cost_per_1m_in_cached": 0.025,
93+
"cost_per_1m_out_cached": 0.025,
94+
"context_window": 400000,
95+
"default_max_tokens": 128000,
96+
"can_reason": true,
97+
"has_reasoning_efforts": true,
98+
"default_reasoning_effort": "low",
99+
"supports_attachments": true
100+
},
101+
{
102+
"id": "gpt-5-nano",
103+
"name": "GPT-5 Nano",
104+
"cost_per_1m_in": 0.05,
105+
"cost_per_1m_out": 0.4,
106+
"cost_per_1m_in_cached": 0.005,
107+
"cost_per_1m_out_cached": 0.005,
108+
"context_window": 400000,
109+
"default_max_tokens": 128000,
110+
"can_reason": true,
111+
"has_reasoning_efforts": true,
112+
"default_reasoning_effort": "low",
113+
"supports_attachments": true
114+
},
115+
{
116+
"id": "Kimi-K2-0905",
117+
"name": "Kimi K2 0905",
118+
"cost_per_1m_in": 0.55,
119+
"cost_per_1m_out": 2.19,
120+
"cost_per_1m_in_cached": 0,
121+
"cost_per_1m_out_cached": 0,
122+
"context_window": 256000,
123+
"default_max_tokens": 10000,
124+
"can_reason": true,
125+
"has_reasoning_efforts": true,
126+
"default_reasoning_effort": "medium"
127+
},
128+
{
129+
"id": "glm-4.6",
130+
"name": "GLM-4.6",
131+
"cost_per_1m_in": 0.6,
132+
"cost_per_1m_out": 2.2,
133+
"cost_per_1m_in_cached": 0.11,
134+
"cost_per_1m_out_cached": 0,
135+
"context_window": 204800,
136+
"default_max_tokens": 131072,
137+
"can_reason": true,
138+
"has_reasoning_efforts": true,
139+
"default_reasoning_effort": "medium",
140+
"supports_attachments": false
141+
},
142+
{
143+
"id": "qwen3-coder-480b-a35b-instruct",
144+
"name": "Qwen 3 480B Coder",
145+
"cost_per_1m_in": 0.82,
146+
"cost_per_1m_out": 3.29,
147+
"context_window": 131072,
148+
"default_max_tokens": 65536,
149+
"can_reason": false,
150+
"supports_attachments": false
151+
}
152+
]
153+
}

internal/providers/providers.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ var deepSeekConfig []byte
5454
//go:embed configs/huggingface.json
5555
var huggingFaceConfig []byte
5656

57+
//go:embed configs/aihubmix.json
58+
var aiHubMixConfig []byte
59+
5760
// ProviderFunc is a function that returns a Provider.
5861
type ProviderFunc func() catwalk.Provider
5962

@@ -73,6 +76,7 @@ var providerRegistry = []ProviderFunc{
7376
chutesProvider,
7477
deepSeekProvider,
7578
huggingFaceProvider,
79+
aiHubMixProvider,
7680
}
7781

7882
// GetAll returns all registered providers.
@@ -152,3 +156,7 @@ func deepSeekProvider() catwalk.Provider {
152156
func huggingFaceProvider() catwalk.Provider {
153157
return loadProviderFromConfig(huggingFaceConfig)
154158
}
159+
160+
func aiHubMixProvider() catwalk.Provider {
161+
return loadProviderFromConfig(aiHubMixConfig)
162+
}

pkg/catwalk/provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const (
3232
InferenceProviderVenice InferenceProvider = "venice"
3333
InferenceProviderChutes InferenceProvider = "chutes"
3434
InferenceProviderHuggingFace InferenceProvider = "huggingface"
35+
InferenceAIHubMix InferenceProvider = "aihubmix"
3536
)
3637

3738
// Provider represents an AI provider configuration.
@@ -80,5 +81,6 @@ func KnownProviders() []InferenceProvider {
8081
InferenceProviderVenice,
8182
InferenceProviderChutes,
8283
InferenceProviderHuggingFace,
84+
InferenceAIHubMix,
8385
}
8486
}

0 commit comments

Comments
 (0)