Skip to content

Commit 4db6700

Browse files
authored
FEAT: support skywork-or1-preview (#3274)
1 parent 96438c2 commit 4db6700

3 files changed

Lines changed: 240 additions & 0 deletions

File tree

xinference/model/llm/llm_family.json

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10989,5 +10989,122 @@
1098910989
"<|user|>",
1099010990
"<|observation|>"
1099110991
]
10992+
},
10993+
{
10994+
"version": 1,
10995+
"context_length": 32768,
10996+
"model_name": "skywork-or1-preview",
10997+
"model_lang": [
10998+
"en",
10999+
"zh"
11000+
],
11001+
"model_ability": [
11002+
"chat"
11003+
],
11004+
"model_description": "The Skywork-OR1 (Open Reasoner 1) model series consists of powerful math and code reasoning models trained using large-scale rule-based reinforcement learning with carefully designed datasets and training recipes.",
11005+
"model_specs": [
11006+
{
11007+
"model_format": "pytorch",
11008+
"model_size_in_billions": 32,
11009+
"quantizations": [
11010+
"none"
11011+
],
11012+
"model_id": "Skywork/Skywork-OR1-32B-Preview"
11013+
},
11014+
{
11015+
"model_format": "gptq",
11016+
"model_size_in_billions": 32,
11017+
"quantizations": [
11018+
"Int4",
11019+
"int8"
11020+
],
11021+
"model_id": "JunHowie/Skywork-OR1-32B-Preview-GPTQ-{quantization}"
11022+
},
11023+
{
11024+
"model_format": "pytorch",
11025+
"model_size_in_billions": 7,
11026+
"quantizations": [
11027+
"none"
11028+
],
11029+
"model_id": "Skywork/Skywork-OR1-7B-Preview"
11030+
},
11031+
{
11032+
"model_format": "ggufv2",
11033+
"model_size_in_billions": 32,
11034+
"quantizations": [
11035+
"IQ2_M",
11036+
"IQ2_S",
11037+
"IQ2_XS",
11038+
"IQ3_M",
11039+
"IQ3_XS",
11040+
"IQ3_XXS",
11041+
"IQ4_NL",
11042+
"IQ4_XS",
11043+
"Q2_K",
11044+
"Q2_K_L",
11045+
"Q3_K_L",
11046+
"Q3_K_M",
11047+
"Q3_K_S",
11048+
"Q3_K_XL",
11049+
"Q4_0",
11050+
"Q4_1",
11051+
"Q4_K_L",
11052+
"Q4_K_M",
11053+
"Q4_K_S",
11054+
"Q5_K_L",
11055+
"Q5_K_M",
11056+
"Q5_K_S",
11057+
"Q6_K",
11058+
"Q6_K_L",
11059+
"Q8_0"
11060+
],
11061+
"model_id": "bartowski/Skywork_Skywork-OR1-32B-Preview-GGUF",
11062+
"model_file_name_template": "Skywork_Skywork-OR1-32B-Preview-{quantization}.gguf"
11063+
},
11064+
{
11065+
"model_format": "ggufv2",
11066+
"model_size_in_billions": 7,
11067+
"quantizations": [
11068+
"IQ2_M",
11069+
"IQ2_S",
11070+
"IQ2_XS",
11071+
"IQ3_M",
11072+
"IQ3_XS",
11073+
"IQ3_XXS",
11074+
"IQ4_NL",
11075+
"IQ4_XS",
11076+
"Q2_K",
11077+
"Q2_K_L",
11078+
"Q3_K_L",
11079+
"Q3_K_M",
11080+
"Q3_K_S",
11081+
"Q3_K_XL",
11082+
"Q4_0",
11083+
"Q4_1",
11084+
"Q4_K_L",
11085+
"Q4_K_M",
11086+
"Q4_K_S",
11087+
"Q5_K_L",
11088+
"Q5_K_M",
11089+
"Q5_K_S",
11090+
"Q6_K",
11091+
"Q6_K_L",
11092+
"Q8_0"
11093+
],
11094+
"model_id": "bartowski/Skywork_Skywork-OR1-7B-Preview-GGUF",
11095+
"model_file_name_template": "Skywork_Skywork-OR1-7B-Preview-{quantization}.gguf"
11096+
}
11097+
],
11098+
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|><think>\\n'}}{% endif %}",
11099+
"stop_token_ids": [
11100+
151643,
11101+
151644,
11102+
151645
11103+
],
11104+
"stop": [
11105+
"<|endoftext|>",
11106+
"<|im_start|>",
11107+
"<|im_end|>"
11108+
]
1099211109
}
1099311110
]

xinference/model/llm/llm_family_modelscope.json

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8764,5 +8764,127 @@
87648764
"<|user|>",
87658765
"<|observation|>"
87668766
]
8767+
},
8768+
{
8769+
"version": 1,
8770+
"context_length": 32768,
8771+
"model_name": "skywork-or1-preview",
8772+
"model_lang": [
8773+
"en",
8774+
"zh"
8775+
],
8776+
"model_ability": [
8777+
"chat"
8778+
],
8779+
"model_description": "The Skywork-OR1 (Open Reasoner 1) model series consists of powerful math and code reasoning models trained using large-scale rule-based reinforcement learning with carefully designed datasets and training recipes.",
8780+
"model_specs": [
8781+
{
8782+
"model_format": "pytorch",
8783+
"model_size_in_billions": 32,
8784+
"quantizations": [
8785+
"none"
8786+
],
8787+
"model_id": "Skywork/Skywork-OR1-32B-Preview",
8788+
"model_hub": "modelscope"
8789+
},
8790+
{
8791+
"model_format": "gptq",
8792+
"model_size_in_billions": 32,
8793+
"quantizations": [
8794+
"Int4",
8795+
"int8"
8796+
],
8797+
"model_id": "JunHowie/Skywork-OR1-32B-Preview-GPTQ-{quantization}",
8798+
"model_hub": "modelscope"
8799+
},
8800+
{
8801+
"model_format": "pytorch",
8802+
"model_size_in_billions": 7,
8803+
"quantizations": [
8804+
"none"
8805+
],
8806+
"model_id": "Skywork/Skywork-OR1-7B-Preview",
8807+
"model_hub": "modelscope"
8808+
},
8809+
{
8810+
"model_format": "ggufv2",
8811+
"model_size_in_billions": 32,
8812+
"quantizations": [
8813+
"IQ2_M",
8814+
"IQ2_S",
8815+
"IQ2_XS",
8816+
"IQ3_M",
8817+
"IQ3_XS",
8818+
"IQ3_XXS",
8819+
"IQ4_NL",
8820+
"IQ4_XS",
8821+
"Q2_K",
8822+
"Q2_K_L",
8823+
"Q3_K_L",
8824+
"Q3_K_M",
8825+
"Q3_K_S",
8826+
"Q3_K_XL",
8827+
"Q4_0",
8828+
"Q4_1",
8829+
"Q4_K_L",
8830+
"Q4_K_M",
8831+
"Q4_K_S",
8832+
"Q5_K_L",
8833+
"Q5_K_M",
8834+
"Q5_K_S",
8835+
"Q6_K",
8836+
"Q6_K_L",
8837+
"Q8_0"
8838+
],
8839+
"model_id": "bartowski/Skywork_Skywork-OR1-32B-Preview-GGUF",
8840+
"model_file_name_template": "Skywork_Skywork-OR1-32B-Preview-{quantization}.gguf",
8841+
"model_hub": "modelscope"
8842+
},
8843+
{
8844+
"model_format": "ggufv2",
8845+
"model_size_in_billions": 7,
8846+
"quantizations": [
8847+
"IQ2_M",
8848+
"IQ2_S",
8849+
"IQ2_XS",
8850+
"IQ3_M",
8851+
"IQ3_XS",
8852+
"IQ3_XXS",
8853+
"IQ4_NL",
8854+
"IQ4_XS",
8855+
"Q2_K",
8856+
"Q2_K_L",
8857+
"Q3_K_L",
8858+
"Q3_K_M",
8859+
"Q3_K_S",
8860+
"Q3_K_XL",
8861+
"Q4_0",
8862+
"Q4_1",
8863+
"Q4_K_L",
8864+
"Q4_K_M",
8865+
"Q4_K_S",
8866+
"Q5_K_L",
8867+
"Q5_K_M",
8868+
"Q5_K_S",
8869+
"Q6_K",
8870+
"Q6_K_L",
8871+
"Q8_0"
8872+
],
8873+
"model_id": "bartowski/Skywork_Skywork-OR1-7B-Preview-GGUF",
8874+
"model_file_name_template": "Skywork_Skywork-OR1-7B-Preview-{quantization}.gguf",
8875+
"model_hub": "modelscope"
8876+
}
8877+
],
8878+
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|><think>\\n'}}{% endif %}",
8879+
"stop_token_ids": [
8880+
151643,
8881+
151644,
8882+
151645
8883+
],
8884+
"stop": [
8885+
"<|endoftext|>",
8886+
"<|im_start|>",
8887+
"<|im_end|>"
8888+
]
87678889
}
87688890
]

xinference/model/llm/vllm/core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ class VLLMGenerateConfig(TypedDict, total=False):
175175
VLLM_SUPPORTED_CHAT_MODELS.append("deepseek-r1-distill-qwen")
176176
VLLM_SUPPORTED_CHAT_MODELS.append("fin-r1")
177177
VLLM_SUPPORTED_CHAT_MODELS.append("seallms-v3")
178+
VLLM_SUPPORTED_CHAT_MODELS.append("skywork-or1-preview")
178179

179180
if VLLM_INSTALLED and vllm.__version__ >= "0.3.2":
180181
VLLM_SUPPORTED_CHAT_MODELS.append("gemma-it")

0 commit comments

Comments
 (0)