Text Generation
Transformers
Safetensors
qwen3_next
heretic
uncensored
decensored
abliterated
conversational
modelopt
Instructions to use trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4") model = AutoModelForCausalLM.from_pretrained("trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4
- SGLang
How to use trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4 with Docker Model Runner:
docker model run hf.co/trohrbaugh/Qwen3-Coder-Next-heretic-nvfp4
Sync tokenizer_config.json from upstream Qwen/Qwen3-Coder-Next
Browse files- tokenizer_config.json +20 -33
tokenizer_config.json
CHANGED
|
@@ -1,17 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"<|box_end|>": "<|box_end|>",
|
| 3 |
-
"<|box_start|>": "<|box_start|>",
|
| 4 |
-
"<|im_end|>": "<|im_end|>",
|
| 5 |
-
"<|im_start|>": "<|im_start|>",
|
| 6 |
-
"<|image_pad|>": "<|image_pad|>",
|
| 7 |
-
"<|object_ref_end|>": "<|object_ref_end|>",
|
| 8 |
-
"<|object_ref_start|>": "<|object_ref_start|>",
|
| 9 |
-
"<|quad_end|>": "<|quad_end|>",
|
| 10 |
-
"<|quad_start|>": "<|quad_start|>",
|
| 11 |
-
"<|video_pad|>": "<|video_pad|>",
|
| 12 |
-
"<|vision_end|>": "<|vision_end|>",
|
| 13 |
-
"<|vision_pad|>": "<|vision_pad|>",
|
| 14 |
-
"<|vision_start|>": "<|vision_start|>",
|
| 15 |
"add_prefix_space": false,
|
| 16 |
"added_tokens_decoder": {
|
| 17 |
"151643": {
|
|
@@ -223,30 +210,30 @@
|
|
| 223 |
"special": false
|
| 224 |
}
|
| 225 |
},
|
| 226 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
"bos_token": null,
|
|
|
|
| 228 |
"clean_up_tokenization_spaces": false,
|
| 229 |
"eos_token": "<|im_end|>",
|
| 230 |
"errors": "replace",
|
| 231 |
-
"extra_special_tokens": {
|
| 232 |
-
"<|box_end|>": "<|box_end|>",
|
| 233 |
-
"<|box_start|>": "<|box_start|>",
|
| 234 |
-
"<|im_end|>": "<|im_end|>",
|
| 235 |
-
"<|im_start|>": "<|im_start|>",
|
| 236 |
-
"<|image_pad|>": "<|image_pad|>",
|
| 237 |
-
"<|object_ref_end|>": "<|object_ref_end|>",
|
| 238 |
-
"<|object_ref_start|>": "<|object_ref_start|>",
|
| 239 |
-
"<|quad_end|>": "<|quad_end|>",
|
| 240 |
-
"<|quad_start|>": "<|quad_start|>",
|
| 241 |
-
"<|video_pad|>": "<|video_pad|>",
|
| 242 |
-
"<|vision_end|>": "<|vision_end|>",
|
| 243 |
-
"<|vision_pad|>": "<|vision_pad|>",
|
| 244 |
-
"<|vision_start|>": "<|vision_start|>"
|
| 245 |
-
},
|
| 246 |
-
"is_local": false,
|
| 247 |
"model_max_length": 1048576,
|
| 248 |
-
"pad_token": "<|
|
| 249 |
"split_special_tokens": false,
|
| 250 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 251 |
-
"unk_token": null
|
| 252 |
-
|
|
|
|
|
|
| 1 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
"add_prefix_space": false,
|
| 3 |
"added_tokens_decoder": {
|
| 4 |
"151643": {
|
|
|
|
| 210 |
"special": false
|
| 211 |
}
|
| 212 |
},
|
| 213 |
+
"additional_special_tokens": [
|
| 214 |
+
"<|im_start|>",
|
| 215 |
+
"<|im_end|>",
|
| 216 |
+
"<|object_ref_start|>",
|
| 217 |
+
"<|object_ref_end|>",
|
| 218 |
+
"<|box_start|>",
|
| 219 |
+
"<|box_end|>",
|
| 220 |
+
"<|quad_start|>",
|
| 221 |
+
"<|quad_end|>",
|
| 222 |
+
"<|vision_start|>",
|
| 223 |
+
"<|vision_end|>",
|
| 224 |
+
"<|vision_pad|>",
|
| 225 |
+
"<|image_pad|>",
|
| 226 |
+
"<|video_pad|>"
|
| 227 |
+
],
|
| 228 |
"bos_token": null,
|
| 229 |
+
"chat_template": "{% macro render_extra_keys(json_dict, handled_keys) %}\n {%- if json_dict is mapping %}\n {%- for json_key in json_dict if json_key not in handled_keys %}\n {%- if json_dict[json_key] is string %}\n {{-'\\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | string) ~ '</' ~ json_key ~ '>' }}\n {%- else %}\n {{- '\\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | tojson | safe) ~ '</' ~ json_key ~ '>' }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n{%- endmacro %}\n\n{%- if messages[0][\"role\"] == \"system\" %}\n {%- set system_message = messages[0][\"content\"] %}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set loop_messages = messages %}\n{%- endif %}\n\n{%- if not tools is defined %}\n {%- set tools = [] %}\n{%- endif %}\n\n{%- if system_message is defined %}\n {{- \"<|im_start|>system\\n\" + system_message }}\n{%- else %}\n {%- if tools is iterable and tools | length > 0 %}\n {{- \"<|im_start|>system\\nYou are Qwen, a helpful AI assistant that can interact with a computer to solve tasks.\" }}\n {%- endif %}\n{%- endif %}\n{%- if tools is iterable and tools | length > 0 %}\n {{- \"\\n\\n# Tools\\n\\nYou have access to the following functions:\\n\\n\" }}\n {{- \"<tools>\" }}\n {%- for tool in tools %}\n {%- if tool.function is defined %}\n {%- set tool = tool.function %}\n {%- endif %}\n {{- \"\\n<function>\\n<name>\" ~ tool.name ~ \"</name>\" }}\n {%- if tool.description is defined %}\n {{- '\\n<description>' ~ (tool.description | trim) ~ '</description>' }}\n {%- endif %}\n {{- '\\n<parameters>' }}\n {%- if tool.parameters is defined and tool.parameters is mapping and tool.parameters.properties is defined and tool.parameters.properties is mapping %}\n {%- for param_name, param_fields in tool.parameters.properties|items %}\n {{- '\\n<parameter>' }}\n {{- '\\n<name>' ~ param_name ~ '</name>' }}\n {%- if param_fields.type is defined %}\n {{- '\\n<type>' ~ (param_fields.type | string) ~ '</type>' }}\n {%- endif %}\n {%- if param_fields.description is defined %}\n {{- '\\n<description>' ~ (param_fields.description | trim) ~ '</description>' }}\n {%- endif %}\n {%- set handled_keys = ['name', 'type', 'description'] %}\n {{- render_extra_keys(param_fields, handled_keys) }}\n {{- '\\n</parameter>' }}\n {%- endfor %}\n {%- endif %}\n {%- set handled_keys = ['type', 'properties'] %}\n {{- render_extra_keys(tool.parameters, handled_keys) }}\n {{- '\\n</parameters>' }}\n {%- set handled_keys = ['type', 'name', 'description', 'parameters'] %}\n {{- render_extra_keys(tool, handled_keys) }}\n {{- '\\n</function>' }}\n {%- endfor %}\n {{- \"\\n</tools>\" }}\n {{- '\\n\\nIf you choose to call a function ONLY reply in the following format with NO suffix:\\n\\n<tool_call>\\n<function=example_function_name>\\n<parameter=example_parameter_1>\\nvalue_1\\n</parameter>\\n<parameter=example_parameter_2>\\nThis is the value for the second parameter\\nthat can span\\nmultiple lines\\n</parameter>\\n</function>\\n</tool_call>\\n\\n<IMPORTANT>\\nReminder:\\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\\n- Required parameters MUST be specified\\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\\n</IMPORTANT>' }}\n{%- endif %}\n{%- if system_message is defined %}\n {{- '<|im_end|>\\n' }}\n{%- else %}\n {%- if tools is iterable and tools | length > 0 %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in loop_messages %}\n {%- if message.role == \"assistant\" and message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls | length > 0 %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content is defined and message.content is string and message.content | trim | length > 0 %}\n {{- '\\n' + message.content | trim + '\\n' }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- if tool_call.arguments is defined %}\n {%- for args_name, args_value in tool_call.arguments|items %}\n {{- '<parameter=' + args_name + '>\\n' }}\n {%- set args_value = args_value if args_value is string else args_value | tojson | safe %}\n {{- args_value }}\n {{- '\\n</parameter>\\n' }}\n {%- endfor %}\n {%- endif %}\n {{- '</function>\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"user\" or message.role == \"system\" or message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.previtem and loop.previtem.role != \"tool\" %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if not loop.last and loop.nextitem.role != \"tool\" %}\n {{- '<|im_end|>\\n' }}\n {%- elif loop.last %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}",
|
| 230 |
"clean_up_tokenization_spaces": false,
|
| 231 |
"eos_token": "<|im_end|>",
|
| 232 |
"errors": "replace",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
"model_max_length": 1048576,
|
| 234 |
+
"pad_token": "<|endoftext|>",
|
| 235 |
"split_special_tokens": false,
|
| 236 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 237 |
+
"unk_token": null,
|
| 238 |
+
"add_bos_token": false
|
| 239 |
+
}
|