Instructions to use unsloth/MiniMax-M2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/MiniMax-M2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/MiniMax-M2") 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("unsloth/MiniMax-M2") model = AutoModelForCausalLM.from_pretrained("unsloth/MiniMax-M2", 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 unsloth/MiniMax-M2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/MiniMax-M2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/MiniMax-M2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/unsloth/MiniMax-M2
- SGLang
How to use unsloth/MiniMax-M2 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 "unsloth/MiniMax-M2" \ --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": "unsloth/MiniMax-M2", "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 "unsloth/MiniMax-M2" \ --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": "unsloth/MiniMax-M2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use unsloth/MiniMax-M2 with Docker Model Runner:
docker model run hf.co/unsloth/MiniMax-M2
Upload folder using huggingface_hub
Browse filesFiles changed (6)
- chat_template.jinja+4-3
- config.json+75-2
- merges.txt+1-1
- tokenizer.json+2-2
- tokenizer_config.json+248-243
- vocab.json
116 unmodified lines117118119120121122123124125126127128129116 unmodified lines{%- if tool_call.function %}{%- set tool_call = tool_call.function %}{%- endif %}{{- '<invoke name="' + tool_call.name + '">' }}{% set _args = tool_call.arguments %}{%- for k, v in _args.items() %}{{- '<parameter name="' + k + '">' }}{{- v | tojson | string if v is not string else v }}{{- '</parameter>' }}{% endfor %}{{- '</invoke>' ~ '\n' }}{%- endfor -%}116 unmodified lines117118119120121122123124125126127128129130116 unmodified lines{%- if tool_call.function %}{%- set tool_call = tool_call.function %}{%- endif %}{{- '<invoke name="' + tool_call.name + '">\n' }}{%- if tool_call.arguments is defined and tool_call.arguments is mapping -%}{% set _args = tool_call.arguments %}{%- for k, v in _args|items %}{{- '<parameter name="' + k + '">' }}{{- v | tojson | string if v is not string else v }}{{- '</parameter>' }}{% endfor %}{%- endif -%}{{- '</invoke>' ~ '\n' }}{%- endfor -%}
66 unmodified lines67686970717273747576777879808182834 unmodified lines88899091929314 unmodified lines10810911011111211311411511611766 unmodified lines1,1],"bos_token_id": null,"eos_token_id": null,"head_dim": 128,"hidden_act": "silu","hidden_size": 3072,"initializer_range": 0.02,"intermediate_size": 1536,"layernorm_full_attention_beta": 1.0,"layernorm_linear_attention_beta": 1.0,"layernorm_mlp_beta": 1.0,"max_position_embeddings": 196608,"mlp_intermediate_size": 8192,"model_type": "minimax","mtp_transformer_layers": 1,4 unmodified lines"num_local_experts": 256,"num_mtp_modules": 3,"output_router_logits": false,"qk_norm_type": "per_layer","quantization_config": {"activation_scheme": "dynamic",14 unmodified lines"shared_moe_mode": "sigmoid","sliding_window": null,"tie_word_embeddings": false,"transformers_version": "4.46.1","use_cache": true,"use_mtp": true,"use_qk_norm": true,"use_routing_bias": true,"vocab_size": 200064}66 unmodified lines6768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531544 unmodified lines15916016116216316416514 unmodified lines18018118218318418518618718818919066 unmodified lines1,1],"block_size": 256,"bos_token_id": null,"eos_token_id": null,"full_attn_alpha_factor": 1,"full_attn_beta_factor": 1,"head_dim": 128,"hidden_act": "silu","hidden_size": 3072,"initializer_range": 0.02,"intermediate_size": 1536,"layer_types": ["full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention","full_attention","linear_attention"],"layernorm_full_attention_beta": 1.0,"layernorm_linear_attention_beta": 1.0,"layernorm_mlp_beta": 1.0,"linear_attn_alpha_factor": 1,"linear_attn_beta_factor": 1,"max_position_embeddings": 196608,"mlp_alpha_factor": 1,"mlp_beta_factor": 1,"mlp_intermediate_size": 8192,"model_type": "minimax","mtp_transformer_layers": 1,4 unmodified lines"num_local_experts": 256,"num_mtp_modules": 3,"output_router_logits": false,"pad_token_id": 200004,"qk_norm_type": "per_layer","quantization_config": {"activation_scheme": "dynamic",14 unmodified lines"shared_moe_mode": "sigmoid","sliding_window": null,"tie_word_embeddings": false,"transformers_version": "4.57.1","unsloth_fixed": true,"use_cache": true,"use_mtp": true,"use_qk_norm": true,"use_routing_bias": true,"vocab_size": 200064}
199741 unmodified lines199742199743199744199745199741 unmodified linesع اÙĨĠdel vingĠت ÙĥÙĪÙĬÙĨ.ch romium199741 unmodified lines199742199743199744199745199741 unmodified linesع اÙĨĠdel vingĠت ÙĥÙĪÙĬÙĨ.ch romium
123version https://git-lfs.github.com/spec/v1oid sha256:757622126525aeeb131756849d93298070ff3f0319c455ec8c5bb0f6b1cebbe8size 9730160123version https://git-lfs.github.com/spec/v1oid sha256:e7b90ed7f55d905175bc26771d6d7d33b40b46742f073675bc816fedaf482ea1size 15522763
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495{"added_tokens_decoder": {"200000": {"content": "]!p~[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200001": {"content": "<fim_prefix>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200002": {"content": "<fim_middle>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200003": {"content": "<fim_suffix>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200004": {"content": "<fim_pad>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200005": {"content": "<reponame>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200006": {"content": "<filename>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200007": {"content": "<gh_stars>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200008": {"content": "<issue_start>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200009": {"content": "<issue_comment>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200010": {"content": "<issue_closed>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200011": {"content": "<jupyter_start>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200012": {"content": "<jupyter_text>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200013": {"content": "<jupyter_code>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200014": {"content": "<jupyter_output>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200015": {"content": "<empty_output>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200016": {"content": "<commit_before>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200017": {"content": "<commit_msg>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200018": {"content": "<commit_after>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200019": {"content": "]~b]","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200020": {"content": "[e~[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200021": {"content": "]!d~[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200022": {"content": "<function_call>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200023": {"content": "<code_interpreter>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200024": {"content": "]<]speech[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200025": {"content": "]<]image[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200026": {"content": "]<]video[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200027": {"content": "]<]start of speech[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200028": {"content": "]<]end of speech[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200029": {"content": "]<]start of image[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200030": {"content": "]<]end of image[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200031": {"content": "]<]start of video[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200032": {"content": "]<]end of video[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200033": {"content": "]<]vision pad[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200034": {"content": "]~!b[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200035": {"content": "<jupyter_error>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200036": {"content": "<add_file>","single_word": false,"lstrip": false,"rstrip": false,"normalized": false,"special": true},"200037": {"content": "<delete_file>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200038": {"content": "<rename_file>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200039": {"content": "<edit_file>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200040": {"content": "<commit_message>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200041": {"content": "<empty_source_file>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200042": {"content": "<repo_struct>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200043": {"content": "<code_context>","single_word": false,"lstrip": false,"rstrip": false,"normalized": false,"special": true},"200044": {"content": "<file_content>","single_word": false,"lstrip": false,"rstrip": false,"normalized": false,"special": true},"200045": {"content": "<source_files>","single_word": false,"lstrip": false,"rstrip": false,"normalized": false,"special": true},"200046": {"content": "<pr_start>","single_word": false,"lstrip": false,"rstrip": false,"normalized": false,"special": true},"200047": {"content": "<review_comment>","single_word": false,"lstrip": false,"rstrip": false,"normalized": false,"special": true},"200048": {"content": "<filepath>","single_word": false,"lstrip": false,"rstrip": false,"normalized": false,"special": true},"200049": {"content": "<file_sep>","single_word": false,"lstrip": false,"rstrip": false,"normalized": false,"special": true},"200050": {"content": "<think>","single_word": false,"lstrip": false,"rstrip": false,"normalized": false,"special": false},"200051": {"content": "</think>","single_word": false,"lstrip": false,"rstrip": false,"normalized": false,"special": false},"200052": {"content": "<minimax:tool_call>","single_word": false,"lstrip": false,"rstrip": false,"normalized": false,"special": false},"200053": {"content": "</minimax:tool_call>","single_word": false,"lstrip": false,"rstrip": false,"normalized": false,"special": false}},"additional_special_tokens": ["<code_interpreter>","<commit_after>","<commit_before>","<commit_msg>","<empty_output>","<filename>","<fim_middle>","<fim_pad>","<fim_prefix>","<fim_suffix>","<function_call>","<gh_stars>","]<]speech[>[","]<]image[>[","]<]video[>[","]<]start of speech[>[","]<]end of speech[>[","]<]start of image[>[","]<]end of image[>[","]<]start of video[>[","]<]end of video[>[","]<]vision pad[>[","]~!b[","<issue_closed>","<issue_comment>","<issue_start>","<jupyter_code>","<jupyter_output>","<jupyter_start>","<jupyter_text>","<reponame>","[e~[","]!d~[","]!p~[","]~b]","<jupyter_error>","<add_file>","<delete_file>","<rename_file>","<edit_file>","<commit_message>","<empty_source_file>","<repo_struct>","<code_context>","<file_content>","<source_files>","<pr_start>","<review_comment>","<filepath>","<file_sep>"],"add_prefix_space": false,"bos_token": "]~!b[","clean_up_tokenization_spaces": false,"eos_token": "[e~[","model_max_length": 40960000,"tokenizer_class": "GPT2Tokenizer","unk_token": "]!d~["}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500{"add_bos_token": true,"add_prefix_space": false,"added_tokens_decoder": {"200000": {"content": "]!p~[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200001": {"content": "<fim_prefix>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200002": {"content": "<fim_middle>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200003": {"content": "<fim_suffix>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200004": {"content": "<fim_pad>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200005": {"content": "<reponame>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200006": {"content": "<filename>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200007": {"content": "<gh_stars>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200008": {"content": "<issue_start>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200009": {"content": "<issue_comment>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200010": {"content": "<issue_closed>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200011": {"content": "<jupyter_start>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200012": {"content": "<jupyter_text>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200013": {"content": "<jupyter_code>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200014": {"content": "<jupyter_output>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200015": {"content": "<empty_output>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200016": {"content": "<commit_before>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200017": {"content": "<commit_msg>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200018": {"content": "<commit_after>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200019": {"content": "]~b]","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200020": {"content": "[e~[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200021": {"content": "]!d~[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200022": {"content": "<function_call>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200023": {"content": "<code_interpreter>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200024": {"content": "]<]speech[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200025": {"content": "]<]image[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200026": {"content": "]<]video[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200027": {"content": "]<]start of speech[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200028": {"content": "]<]end of speech[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200029": {"content": "]<]start of image[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200030": {"content": "]<]end of image[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200031": {"content": "]<]start of video[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200032": {"content": "]<]end of video[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200033": {"content": "]<]vision pad[>[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200034": {"content": "]~!b[","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200035": {"content": "<jupyter_error>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200036": {"content": "<add_file>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200037": {"content": "<delete_file>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200038": {"content": "<rename_file>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200039": {"content": "<edit_file>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200040": {"content": "<commit_message>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200041": {"content": "<empty_source_file>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200042": {"content": "<repo_struct>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200043": {"content": "<code_context>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200044": {"content": "<file_content>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200045": {"content": "<source_files>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200046": {"content": "<pr_start>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200047": {"content": "<review_comment>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200048": {"content": "<filepath>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200049": {"content": "<file_sep>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"200050": {"content": "<think>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"200051": {"content": "</think>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"200052": {"content": "<minimax:tool_call>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"200053": {"content": "</minimax:tool_call>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false}},"additional_special_tokens": ["<code_interpreter>","<commit_after>","<commit_before>","<commit_msg>","<empty_output>","<filename>","<fim_middle>","<fim_pad>","<fim_prefix>","<fim_suffix>","<function_call>","<gh_stars>","]<]speech[>[","]<]image[>[","]<]video[>[","]<]start of speech[>[","]<]end of speech[>[","]<]start of image[>[","]<]end of image[>[","]<]start of video[>[","]<]end of video[>[","]<]vision pad[>[","]~!b[","<issue_closed>","<issue_comment>","<issue_start>","<jupyter_code>","<jupyter_output>","<jupyter_start>","<jupyter_text>","<reponame>","[e~[","]!d~[","]!p~[","]~b]","<jupyter_error>","<add_file>","<delete_file>","<rename_file>","<edit_file>","<commit_message>","<empty_source_file>","<repo_struct>","<code_context>","<file_content>","<source_files>","<pr_start>","<review_comment>","<filepath>","<file_sep>"],"bos_token": "]~!b[","clean_up_tokenization_spaces": false,"eos_token": "[e~[","extra_special_tokens": {},"model_max_length": 196608,"pad_token": "<fim_pad>","padding_side": "left","tokenizer_class": "GPT2Tokenizer","unk_token": "]!d~[","chat_template": "{# Unsloth template fixes #}\n{# ----------‑‑‑ special token variables ‑‑‑---------- #}\n{%- set toolcall_begin_token = '<minimax:tool_call>' -%}\n{%- set toolcall_end_token = '</minimax:tool_call>' -%}\n{#- Tool Rendering Functions ============================================== -#}\n{%- macro render_tool_namespace(namespace_name, tool_list) -%}\n{%- for tool in tool_list -%}\n<tool>{{ tool.function | tojson | string }}</tool>\n{% endfor -%}\n{%- endmacro -%}\n{%- macro visible_text(content) -%}\n {%- if content is string -%}\n {{ content }}\n {%- elif content is iterable and content is not mapping -%}\n {%- for item in content -%}\n {%- if item is mapping and item.type == 'text' -%}\n {{- item.text }}\n {%- elif item is string -%}\n {{- item }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{- content }}\n {%- endif -%}\n{%- endmacro -%}\n{#- System Message Construction ============================================ -#}\n{%- macro build_system_message(system_message) -%}\n {%- if system_message and system_message.content -%}\n {{- visible_text(system_message.content) }}\n {%- else -%}\n {%- if model_identity is not defined -%}\n {%- set model_identity = \"You are a helpful assistant.\" -%}\n {%- endif -%}\n {{- model_identity }}\n {%- endif -%}\n \n {#- Handle current_date -#}\n {%- if system_message and system_message.current_date -%}\n {{- '\\n' ~ 'Current date: ' + system_message.current_date }}\n {%- endif -%}\n {#- Handle current_location -#}\n {%- if system_message and system_message.current_location -%}\n {{- '\\n' ~ 'Current location: ' + system_message.current_location }}\n {%- endif -%}\n{%- endmacro -%}\n{#- Main Template Logic ================================================= -#}\n{#- Extract system message (only first message if it's system) -#}\n{%- set system_message = none -%}\n{%- set conversation_messages = messages -%}\n{%- if messages and messages[0].role == \"system\" -%}\n {%- set system_message = messages[0] -%}\n {%- set conversation_messages = messages[1:] -%}\n{%- endif -%}\n{#- Get the last user message turn, for interleved thinking -#}\n{%- set ns = namespace(last_user_index=-1) %}\n{% for m in conversation_messages %}\n {%- if m.role == 'user' %}\n {% set ns.last_user_index = loop.index0 -%}\n {%- endif %}\n{%- endfor %}\n{#- Render system message -#}\n{{- ']~!b[' ~ ']~b]system' ~ '\\n' }}\n{{- build_system_message(system_message) }}\n{#- Render tools if available -#}\n{%- if tools -%}\n {{- '\\n\\n' ~ '# Tools' ~ '\\n' ~ 'You may call one or more tools to assist with the user query.\\nHere are the tools available in JSONSchema format:' ~ '\\n' }}\n {{- '\\n' ~ '<tools>' ~ '\\n' }}\n {{- render_tool_namespace(\"functions\", tools) }}\n {{- '</tools>' ~ '\\n\\n' }}\n{{- 'When making tool calls, use XML format to invoke tools and pass parameters:' ~ '\\n' }}\n{{- '\\n' ~ toolcall_begin_token }}\n<invoke name=\"tool-name-1\">\n<parameter name=\"param-key-1\">param-value-1</parameter>\n<parameter name=\"param-key-2\">param-value-2</parameter>\n...\n</invoke>\n{{- '\\n' ~ toolcall_end_token }}\n{%- endif -%}\n{{- '[e~[\\n' }}\n\n{#- Render messages -#}\n{%- set last_tool_call = namespace(name=none) -%}\n{%- for message in conversation_messages -%}\n {%- if message.role == 'assistant' -%}\n {#- Only render reasoning_content if no user message follows -#}\n {{- ']~b]ai' ~ '\\n' }}\n\n {%- set reasoning_content = '' %}\n {%- set content = visible_text(message.content) %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {# Unsloth template fixes - must change to for loop since llama.cpp will error out if not #}\n {%- set parts = content.split('</think>') %}\n {%- for part in parts %}\n {%- if loop.index0 == 0 -%}\n {%- set reasoning_content = part.strip('\\n') %}\n {%- set reasoning_content = (reasoning_content.split('<think>')|last) %}\n {%- set reasoning_content = reasoning_content.strip('\\n') -%}\n {%- else -%}\n {%- set content = part.strip('\\n') %}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {%- endif %}\n {%- if reasoning_content and loop.index0 > ns.last_user_index -%}\n {{- '<think>' ~ '\\n' ~ reasoning_content ~ '\\n' ~ '</think>' ~ '\\n\\n' }}\n {%- endif -%}\n {%- if content -%}\n {{- content }}\n {%- endif -%}\n {%- if message.tool_calls -%}\n {{- '\\n' ~ toolcall_begin_token ~ '\\n' }}\n\n {%- for tool_call in message.tool_calls -%}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<invoke name=\"' + tool_call.name + '\">\\n' }}\n {%- if tool_call.arguments is defined and tool_call.arguments is mapping -%}\n {% set _args = tool_call.arguments %}\n {%- for k, v in _args|items %}\n {{- '<parameter name=\"' + k + '\">' }}\n {{- v | tojson | string if v is not string else v }}\n {{- '</parameter>' }}\n {% endfor %}{%- endif -%}\n {{- '</invoke>' ~ '\\n' }}\n {%- endfor -%}\n \n {{- toolcall_end_token}}\n {%- set last_tool_call.name = message.tool_calls[-1].name -%}\n {%- else -%}\n {%- set last_tool_call.name = none -%}\n {%- endif -%}\n {{- '[e~[' ~ '\\n' }}\n \n {%- elif message.role == 'tool' -%}\n {%- if last_tool_call.name is none -%}\n {{- raise_exception(\"Message has tool role, but there was no previous assistant message with a tool call!\") }}\n {%- endif -%}\n {%- if loop.first or (conversation_messages[loop.index0 - 1].role != 'tool') -%}\n {{- ']~b]tool' }}\n {%- endif -%}\n {%- if message.content is string -%}\n {{- '\\n<response>' }}\n {{- message.content }}\n {{- '</response>' }}\n {%- else -%}\n {%- for tr in message.content -%}\n {{- '\\n<response>' }}\n {{- tr.output if tr.output is defined else (tr.text if tr.type == 'text' and tr.text is defined else tr) }}\n {{- '\\n</response>' }}\n {%- endfor -%}\n {%- endif -%}\n {%- if loop.last or (conversation_messages[loop.index0 + 1].role != 'tool') -%}\n {{- '[e~[\\n' -}}\n {%- endif -%}\n \n {%- elif message.role == 'user' -%}\n {{- ']~b]user' ~ '\\n' }}\n {{- visible_text(message.content) }}\n {{- '[e~[' ~ '\\n' }}\n {%- endif -%}\n{%- endfor -%}\n\n{#- Generation prompt -#}\n{%- if add_generation_prompt -%}\n{{- ']~b]ai' ~ '\\n' ~ '<think>' ~ '\\n' }}\n{%- endif -%}\n{# Copyright 2025-present Unsloth. Apache 2.0 License. #}\n"}
chat_template.jinja+4-3
config.json+75-2
merges.txt+1-1
tokenizer.json+2-2
tokenizer_config.json+248-243
vocab.json