Skip to content

Commit 5de2a3a

Browse files
authored
feat(aihubmix): add Qwen3.7 Max, Gemini 3.5 Flash, Grok 4.3 models and improve Anthropic support (#3179)
* feat(aihubmix): add Gemini 3.5 Flash and Grok 4.3 model support * feat(aihubmix): add default max_tokens parameter for Anthropic models * feat(aihubmix): add Qwen3.7 Max model support * chore(aihubmix): bump version to 0.0.29 * fix(aihubmix): update max_tokens defaults and remove hardcoded fallback - Remove hardcoded max_tokens=128000 fallback in anthropic.py - Set claude-haiku-4-5 max_tokens default/max to 64000 - Set claude-opus-4-5 max_tokens default/max to 64000 - Set claude-opus-4-7 max_tokens default/max to 128000 - Change gemini-3.5-flash thinking level default to Medium * refactor(aihubmix): use exact model name matching for max_tokens defaults
1 parent 3b1ddbf commit 5de2a3a

9 files changed

Lines changed: 260 additions & 11 deletions

File tree

models/aihubmix/manifest.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.0.28
1+
version: 0.0.29
22
type: plugin
33
author: langgenius
44
name: aihubmix
@@ -8,10 +8,10 @@ label:
88
zh_Hans: Aihubmix
99
pt_BR: Aihubmix
1010
description:
11-
en_US: 'One Gateway, Infinite Models;one-stop request: OpenAI, Claude, Gemini, DeepSeek, Qwen, and over 500 AI models.'
12-
ja_JP: '1つのAPIで無限のAIモデルを利用可能。OpenAI、Claude、Gemini、DeepSeek、Qwenなど、500種類以上のAIモデルにワンストップでアクセス。'
13-
zh_Hans: '一个接口,无限模型;一站式请求:OpenAI、Claude、Gemini、DeepSeek、Qwen等 500+AI 模型'
14-
pt_BR: 'Um Gateway, Modelos Infinitos; solicitação única: OpenAI, Claude, Gemini, DeepSeek, Qwen e mais de 500 modelos de IA.'
11+
en_US: "One Gateway, Infinite Models;one-stop request: OpenAI, Claude, Gemini, DeepSeek, Qwen, and over 500 AI models."
12+
ja_JP: "1つのAPIで無限のAIモデルを利用可能。OpenAI、Claude、Gemini、DeepSeek、Qwenなど、500種類以上のAIモデルにワンストップでアクセス。"
13+
zh_Hans: "一个接口,无限模型;一站式请求:OpenAI、Claude、Gemini、DeepSeek、Qwen等 500+AI 模型"
14+
pt_BR: "Um Gateway, Modelos Infinitos; solicitação única: OpenAI, Claude, Gemini, DeepSeek, Qwen e mais de 500 modelos de IA."
1515
icon: icon.svg
1616
resource:
1717
memory: 268435456

models/aihubmix/models/llm/_position.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
- qwen3.7-max
2+
- gemini-3.5-flash
3+
- grok-4.3
14
- gpt-5.5
25
- claude-opus-4-7
36
- deepseek-v4-flash

models/aihubmix/models/llm/anthropic.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,35 @@ def _chat_generate(
201201
"max_tokens_to_sample"
202202
)
203203

204+
if "max_tokens" not in model_parameters:
205+
# Model-aware default: use each model's native max output limit
206+
# See: https://platform.claude.com/docs/en/about-claude/models/overview
207+
_MAX_TOKENS_128K = {
208+
"claude-opus-4-7", "claude-opus-4-7-think",
209+
"claude-opus-4-6", "claude-opus-4-6-think",
210+
}
211+
_MAX_TOKENS_64K = {
212+
"claude-sonnet-4-6", "claude-sonnet-4-6-think",
213+
"claude-sonnet-4-5",
214+
"claude-sonnet-4-20250514",
215+
"claude-haiku-4-5",
216+
"claude-opus-4-5", "claude-opus-4-5-think",
217+
"claude-opus-4-1-20250805",
218+
"claude-opus-4-20250514",
219+
}
220+
_MAX_TOKENS_8K = {
221+
"claude-3-5-sonnet-20241022",
222+
"claude-3-5-haiku-20241022",
223+
}
224+
if model in _MAX_TOKENS_128K:
225+
model_parameters["max_tokens"] = 128000
226+
elif model in _MAX_TOKENS_64K:
227+
model_parameters["max_tokens"] = 64000
228+
elif model in _MAX_TOKENS_8K:
229+
model_parameters["max_tokens"] = 8192
230+
else:
231+
model_parameters["max_tokens"] = 4096
232+
204233
thinking = model_parameters.pop("thinking", False)
205234
thinking_budget = model_parameters.pop("thinking_budget", 1024)
206235
context_1m = model_parameters.pop("context_1m", False)

models/aihubmix/models/llm/claude-haiku-4-5.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ parameter_rules:
3737
use_template: top_p
3838
- name: max_tokens
3939
use_template: max_tokens
40-
default: 8192
40+
default: 64000
4141
min: 1
42-
max: 131072
42+
max: 64000
4343
- name: response_format
4444
label:
4545
zh_Hans: 回复格式

models/aihubmix/models/llm/claude-opus-4-5.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ parameter_rules:
1818
use_template: top_p
1919
- name: max_tokens
2020
use_template: max_tokens
21-
default: 8192
21+
default: 64000
2222
min: 1
23-
max: 32000
23+
max: 64000
2424
- name: response_format
2525
label:
2626
zh_Hans: 回复格式

models/aihubmix/models/llm/claude-opus-4-7.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ parameter_rules:
1818
use_template: top_p
1919
- name: max_tokens
2020
use_template: max_tokens
21-
default: 8192
21+
default: 128000
2222
min: 1
23-
max: 32000
23+
max: 128000
2424
- name: response_format
2525
label:
2626
zh_Hans: 回复格式
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
model: gemini-3.5-flash
2+
label:
3+
en_US: Gemini 3.5 Flash
4+
model_type: llm
5+
features:
6+
- tool-call
7+
- multi-tool-call
8+
- agent-thought
9+
- vision
10+
- stream-tool-call
11+
- document
12+
- video
13+
- audio
14+
- structured-output
15+
model_properties:
16+
mode: chat
17+
context_size: 1048576
18+
parameter_rules:
19+
- name: include_thoughts
20+
type: boolean
21+
required: true
22+
default: false
23+
label:
24+
en_US: Include thoughts
25+
zh_Hans: 返回思考过程
26+
help:
27+
en_US: Indicates whether to include thoughts in the response. If true, thoughts are returned only if the model supports thought and thoughts are available. Default is false.
28+
zh_Hans: 是否返回思考过程。若为 true 则只有模型支持思考且启动思考模式时才返回思考过程。默认为 false。
29+
- name: media_resolution
30+
type: string
31+
required: true
32+
default: "Default"
33+
options:
34+
- Default
35+
- Low
36+
- Medium
37+
- High
38+
label:
39+
en_US: Media resolution
40+
zh_Hans: 媒体分辨率
41+
help:
42+
en_US: |
43+
Gemini 3 introduces fine-grained control over multimodal visual processing via the `media_resolution` parameter. Higher resolution improves the model's ability to read small text or recognize fine details, but increases token usage and latency.
44+
45+
Recommended Settings:
46+
- Images: `media_resolution_high` (1120 tokens) - Recommended for most image analysis tasks to ensure best quality.
47+
- PDF: `media_resolution_medium` (560 tokens) - Great for document understanding; quality usually saturates at medium.
48+
- Video (Regular): `media_resolution_low` or `medium` (70 tokens/frame) - Sufficient for most action recognition and description tasks.
49+
- Video (Text-heavy): `media_resolution_high` (280 tokens/frame) - Needed only when use cases involve reading dense text (OCR) or tiny details in video frames.
50+
51+
Note: If not specified, the model uses the best default value based on the media type.
52+
zh_Hans: |
53+
Gemini 3 通过 `media_resolution` 参数引入了对多模态视觉处理的精细控制。分辨率越高,模型读取细小文本或识别细微细节的能力就越强,但会增加令牌用量和延迟时间。
54+
55+
推荐设置:
56+
- 图片:`media_resolution_high` (1120 tokens) - 建议用于大多数图片分析任务,以确保获得最佳质量。
57+
- PDF:`media_resolution_medium` (560 tokens) - 非常适合文档理解;质量通常在 medium 时达到饱和。
58+
- 视频(常规):`media_resolution_low` 或 `medium` (70 tokens/帧) - 对于大多数动作识别和描述任务来说已经足够。
59+
- 视频(文字较多):`media_resolution_high` (280 tokens/帧) - 仅当用例涉及读取密集文本 (OCR) 或视频帧中的微小细节时才需要。
60+
61+
注意:如果不指定,模型会根据媒体类型使用最佳默认值。
62+
- name: thinking_level
63+
type: string
64+
required: true
65+
default: "Medium"
66+
options:
67+
- Minimal
68+
- Low
69+
- Medium
70+
- High
71+
label:
72+
en_US: Thinking level
73+
zh_Hans: 思考层级
74+
help:
75+
en_US: Indicates the thinking level. Default is Medium.
76+
zh_Hans: 思考层级。默认为 Medium。
77+
- name: grounding
78+
type: boolean
79+
required: true
80+
default: false
81+
label:
82+
en_US: Grounding
83+
zh_Hans: 事实核查
84+
ja_JP: 事実チェック
85+
help:
86+
en_US: Grounding with Google Search
87+
zh_Hans: Google 事实核查
88+
ja_JP: Google 検索に基づいた応答をします。
89+
- name: url_context
90+
type: boolean
91+
required: true
92+
default: false
93+
label:
94+
en_US: URL context
95+
zh_Hans: 链接详情
96+
ja_JP: 網羅閲覧
97+
help:
98+
en_US: Browse the url context
99+
zh_Hans: 获取并分析该链接的详细信息,为回答提供参考依据。
100+
ja_JP: リンク先の詳細情報を取得し、文脈を理解します。
101+
- name: code_execution
102+
type: boolean
103+
required: true
104+
default: false
105+
label:
106+
en_US: Code execution
107+
zh_Hans: 代码执行
108+
ja_JP: コード実行
109+
help:
110+
en_US: Lets Gemini use code to solve complex tasks
111+
zh_Hans: 让 Gemini 使用代码来解决复杂任务。
112+
ja_JP: Gemini にコードを使って複雑なタスクを解決させましょう。
113+
- name: use_inline_file
114+
type: boolean
115+
required: true
116+
default: false
117+
label:
118+
en_US: Use inline file mode
119+
zh_Hans: 使用内嵌文件模式
120+
help:
121+
en_US: |
122+
When enabled, files will be embedded directly in the request (inline mode) for better performance.
123+
When disabled, files will be uploaded using the Files API. Default is disabled (Files API).
124+
zh_Hans: |
125+
启用后,文件将直接内嵌在请求中(内联模式)以提高性能。
126+
禁用后,文件将使用 Files API 上传。默认为禁用(使用 Files API)。
127+
- name: json_schema
128+
use_template: json_schema
129+
# https://ai.google.dev/gemini-api/docs/pricing#gemini-3-flash-preview
130+
pricing:
131+
input: "1.5"
132+
output: "9"
133+
unit: "0.000001"
134+
currency: USD
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
model: grok-4.3
2+
label:
3+
en_US: Grok 4.3
4+
model_type: llm
5+
features:
6+
- agent-thought
7+
- tool-call
8+
- stream-tool-call
9+
- multi-tool-call
10+
- vision
11+
model_properties:
12+
mode: chat
13+
context_size: 1000000
14+
parameter_rules:
15+
- name: reasoning_effort
16+
label:
17+
zh_Hans: 推理努力程度
18+
en_US: Reasoning Effort
19+
type: string
20+
help:
21+
zh_Hans: 控制模型的推理强度。none 为关闭思考,low/medium/high 为推荐值。
22+
en_US: Controls the model's reasoning intensity. none disables thinking, low/medium/high are recommended.
23+
required: false
24+
default: none
25+
options:
26+
- none
27+
- low
28+
- medium
29+
- high
30+
- name: response_format
31+
label:
32+
zh_Hans: 回复格式
33+
en_US: Response Format
34+
type: string
35+
required: false
36+
options:
37+
- text
38+
- json_object
39+
- json_schema
40+
- name: json_schema
41+
use_template: json_schema
42+
pricing:
43+
input: "1.25"
44+
output: "2.5"
45+
unit: "0.000001"
46+
currency: USD
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
model: qwen3.7-max
2+
label:
3+
en_US: Qwen3.7 Max
4+
model_type: llm
5+
features:
6+
- agent-thought
7+
- tool-call
8+
- stream-tool-call
9+
- multi-tool-call
10+
model_properties:
11+
mode: chat
12+
context_size: 1014784
13+
parameter_rules:
14+
- name: enable_thinking
15+
required: false
16+
type: boolean
17+
default: false
18+
label:
19+
zh_Hans: 深度思考
20+
en_US: Deep Thinking
21+
help:
22+
zh_Hans: 是否开启深度思考模式,开启后模型会先进行推理再给出回答。
23+
en_US: Whether to enable deep thinking mode. When enabled, the model will reason before answering.
24+
- name: response_format
25+
label:
26+
zh_Hans: 回复格式
27+
en_US: Response Format
28+
type: string
29+
required: false
30+
options:
31+
- text
32+
- json_object
33+
pricing:
34+
input: "1.69"
35+
output: "5.07"
36+
unit: "0.000001"
37+
currency: USD

0 commit comments

Comments
 (0)