Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
49592897
authored
Jun 18, 2025
by
RedwindA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ratio): add new Gemini model ratios and enhance flash model handling
parent
423796e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
setting/operation_setting/model-ratio.go
+13
-5
No files found.
setting/operation_setting/model-ratio.go
View file @
49592897
...
...
@@ -139,6 +139,7 @@ var defaultModelRatio = map[string]float64{
"gemini-2.0-flash"
:
0.05
,
"gemini-2.5-pro-exp-03-25"
:
0.625
,
"gemini-2.5-pro-preview-03-25"
:
0.625
,
"gemini-2.5-pro"
:
0.625
,
"gemini-2.5-flash-preview-04-17"
:
0.075
,
"gemini-2.5-flash-preview-04-17-thinking"
:
0.075
,
"gemini-2.5-flash-preview-04-17-nothinking"
:
0.075
,
...
...
@@ -147,6 +148,8 @@ var defaultModelRatio = map[string]float64{
"gemini-2.5-flash-preview-05-20-nothinking"
:
0.075
,
"gemini-2.5-flash-thinking-*"
:
0.075
,
// 用于为后续所有2.5 flash thinking budget 模型设置默认倍率
"gemini-2.5-pro-thinking-*"
:
0.625
,
// 用于为后续所有2.5 pro thinking budget 模型设置默认倍率
"gemini-2.5-flash-lite-preview-06-17"
:
0.05
,
"gemini-2.5-flash"
:
0.15
,
"text-embedding-004"
:
0.001
,
"chatglm_turbo"
:
0.3572
,
// ¥0.005 / 1k tokens
"chatglm_pro"
:
0.7143
,
// ¥0.01 / 1k tokens
...
...
@@ -487,12 +490,17 @@ func getHardcodedCompletionModelRatio(name string) (float64, bool) {
return
4
,
true
}
else
if
strings
.
HasPrefix
(
name
,
"gemini-2.5-pro"
)
{
// 移除preview来增加兼容性,这里假设正式版的倍率和preview一致
return
8
,
true
}
else
if
strings
.
HasPrefix
(
name
,
"gemini-2.5-flash"
)
{
// 同上
if
strings
.
HasSuffix
(
name
,
"-nothinking"
)
{
return
4
,
false
}
else
{
return
3.5
/
0.6
,
false
}
else
if
strings
.
HasPrefix
(
name
,
"gemini-2.5-flash"
)
{
// 处理不同的flash模型倍率
if
strings
.
HasPrefix
(
name
,
"gemini-2.5-flash-preview"
)
{
if
strings
.
HasSuffix
(
name
,
"-nothinking"
)
{
return
4
,
true
}
return
3.5
/
0.15
,
true
}
if
strings
.
HasPrefix
(
name
,
"gemini-2.5-flash-lite-preview"
)
{
return
4
,
true
}
return
2.5
/
0.3
,
true
}
return
4
,
false
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment