Skip to content

Commit

Permalink
refactor: several improvements (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden authored Feb 6, 2025
1 parent 470eeb2 commit 4812e44
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 14 deletions.
3 changes: 1 addition & 2 deletions assets/arena.html
Original file line number Diff line number Diff line change
Expand Up @@ -1047,9 +1047,8 @@
}
},
renderer(token) {
const isOpen = !token.raw.endsWith('</think>');
const text = '<p>' + token.text.trim().replace(/\n+/g, '</p><p>') + '</p>';
return `<details ${isOpen ? "open" : ""} class="think">
return `<details open class="think">
<summary>Deeply thought</summary>
<blockquote>${text}</blockquote>
</details>`;
Expand Down
3 changes: 1 addition & 2 deletions assets/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -1528,9 +1528,8 @@
}
},
renderer(token) {
const isOpen = !token.raw.endsWith('</think>');
const text = '<p>' + token.text.trim().replace(/\n+/g, '</p><p>') + '</p>';
return `<details ${isOpen ? "open" : ""} class="think">
return `<details open class="think">
<summary>Deeply thought</summary>
<blockquote>${text}</blockquote>
</details>`;
Expand Down
62 changes: 53 additions & 9 deletions models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,13 @@
supports_vision: true
supports_function_calling: true
supports_reasoning: true
no_system_message: true
- name: o1
max_input_tokens: 200000
input_price: 15
output_price: 60
supports_vision: true
supports_function_calling: true
supports_reasoning: true
no_system_message: true
- name: o1-preview
max_input_tokens: 128000
max_output_tokens: 32768
Expand Down Expand Up @@ -122,6 +120,20 @@
output_price: 0
supports_vision: true
supports_function_calling: true
- name: gemini-2.0-flash
max_input_tokens: 1048576
max_output_tokens: 8192
input_price: 0
output_price: 0
supports_vision: true
supports_function_calling: true
- name: gemini-2.0-flash-lite-preview
max_input_tokens: 1048576
max_output_tokens: 8192
input_price: 0
output_price: 0
supports_vision: true
supports_function_calling: true
- name: gemini-2.0-flash-exp
max_input_tokens: 1048576
max_output_tokens: 8192
Expand All @@ -136,7 +148,7 @@
output_price: 0
supports_vision: true
supports_reasoning: true
- name: gemini-exp-1206
- name: gemini-2.0-pro-exp
max_input_tokens: 2097152
max_output_tokens: 8192
input_price: 0
Expand Down Expand Up @@ -468,10 +480,24 @@
- name: gemini-1.5-flash-002
max_input_tokens: 1048576
max_output_tokens: 8192
input_price: 0.01875
input_price: 0.019
output_price: 0.075
supports_vision: true
supports_function_calling: true
- name: gemini-2.0-flash-001
max_input_tokens: 1048576
max_output_tokens: 8192
input_price: 0.15
output_price: 0.6
supports_vision: true
supports_function_calling: true
- name: gemini-2.0-flash-lite-preview-02-05
max_input_tokens: 1048576
max_output_tokens: 8192
input_price: 0.075
output_price: 0.3
supports_vision: true
supports_function_calling: true
- name: gemini-2.0-flash-exp
max_input_tokens: 1048576
max_output_tokens: 8192
Expand All @@ -482,6 +508,11 @@
max_output_tokens: 8192
supports_vision: true
supports_reasoning: true
- name: gemini-2.0-pro-exp-02-05
max_input_tokens: 2097152
max_output_tokens: 8192
supports_vision: true
supports_function_calling: true
- name: claude-3-5-sonnet-v2@20241022
max_input_tokens: 200000
max_output_tokens: 8192
Expand Down Expand Up @@ -757,7 +788,7 @@
max_batch_size: 100

# Links:
# - https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu
# - https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Fm2vrveyu
# - https://cloud.baidu.com/doc/WENXINWORKSHOP/s/hlrk4akp7
- provider: ernie
models:
Expand Down Expand Up @@ -1141,15 +1172,13 @@
supports_vision: true
supports_function_calling: true
supports_reasoning: true
no_system_message: true
- name: openai/o1
max_input_tokens: 128000
input_price: 15
output_price: 60
supports_vision: true
supports_function_calling: true
supports_reasoning: true
no_system_message: true
- name: openai/o1-preview
max_input_tokens: 128000
input_price: 15
Expand Down Expand Up @@ -1185,6 +1214,12 @@
output_price: 0.15
supports_vision: true
supports_function_calling: true
- name: google/gemini-2.0-flash-001
max_input_tokens: 1000000
input_price: 0.1
output_price: 0.4
supports_vision: true
supports_function_calling: true
- name: anthropic/claude-3.5-sonnet
max_input_tokens: 200000
max_output_tokens: 8192
Expand Down Expand Up @@ -1442,13 +1477,11 @@
supports_function_calling: true
supports_vision: true
supports_reasoning: true
no_system_message: true
- name: o1
max_input_tokens: 200000
supports_function_calling: true
supports_vision: true
supports_reasoning: true
no_system_message: true
- name: o1-preview
max_input_tokens: 128000
supports_reasoning: true
Expand Down Expand Up @@ -1729,6 +1762,7 @@
max_tokens_per_chunk: 512
default_chunk_size: 1000
max_batch_size: 100

# Links
# - https://cloud.siliconflow.cn/models
# - https://docs.siliconflow.cn/api-reference/chat-completions/chat-completions
Expand Down Expand Up @@ -1798,6 +1832,16 @@
input_price: 2.24
output_price: 2.24
supports_reasoning: true
- name: deepseek-ai/DeepSeek-R1-Distill-Llama-70B
max_input_tokens: 32768
input_price: 0.578
output_price: 0.578
supports_reasoning: true
- name: deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
max_input_tokens: 32768
input_price: 0.176
output_price: 0.176
supports_reasoning: true
- name: deepseek-ai/DeepSeek-V2.5
max_input_tokens: 32768
input_price: 0.7
Expand Down
2 changes: 1 addition & 1 deletion src/client/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl Model {
capabilities.push('⚒');
};
if *supports_reasoning {
capabilities.push('🄡');
capabilities.push('💭');
}
let capabilities: String = capabilities
.into_iter()
Expand Down

0 comments on commit 4812e44

Please sign in to comment.