Instructions to use CreitinGameplays/Mistral-Nemo-12B-R1-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CreitinGameplays/Mistral-Nemo-12B-R1-v0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CreitinGameplays/Mistral-Nemo-12B-R1-v0.1") 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("CreitinGameplays/Mistral-Nemo-12B-R1-v0.1") model = AutoModelForCausalLM.from_pretrained("CreitinGameplays/Mistral-Nemo-12B-R1-v0.1", 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CreitinGameplays/Mistral-Nemo-12B-R1-v0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CreitinGameplays/Mistral-Nemo-12B-R1-v0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CreitinGameplays/Mistral-Nemo-12B-R1-v0.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CreitinGameplays/Mistral-Nemo-12B-R1-v0.1
- SGLang
How to use CreitinGameplays/Mistral-Nemo-12B-R1-v0.1 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 "CreitinGameplays/Mistral-Nemo-12B-R1-v0.1" \ --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": "CreitinGameplays/Mistral-Nemo-12B-R1-v0.1", "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 "CreitinGameplays/Mistral-Nemo-12B-R1-v0.1" \ --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": "CreitinGameplays/Mistral-Nemo-12B-R1-v0.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use CreitinGameplays/Mistral-Nemo-12B-R1-v0.1 with Docker Model Runner:
docker model run hf.co/CreitinGameplays/Mistral-Nemo-12B-R1-v0.1
update
#21
by CreitinGameplays - opened
- tokenizer_config.json +1 -1
tokenizer_config.json
CHANGED
|
@@ -8005,7 +8005,7 @@
|
|
| 8005 |
}
|
| 8006 |
},
|
| 8007 |
"bos_token": "<s>",
|
| 8008 |
-
"chat_template": "{%- set default_sys = \"You are an AI assistant
|
| 8009 |
"clean_up_tokenization_spaces": false,
|
| 8010 |
"eos_token": "</s>",
|
| 8011 |
"extra_special_tokens": {},
|
|
|
|
| 8005 |
}
|
| 8006 |
},
|
| 8007 |
"bos_token": "<s>",
|
| 8008 |
+
"chat_template": "{%- set default_sys = \"You are an AI assistant that provides systematic, well-reasoned responses. Response Structure: <think>{reasoning}</think>{answer}. Reasoning should include at least 6 logical steps when needed. Process: Think first, then answer.\" %}\n{%- if messages and messages[0][\"role\"] == \"system\" %}\n {%- set system_message = default_sys ~ '\\n' ~ messages[0][\"content\"] %}\n {%- set conversation_messages = messages[1:] %}\n{%- else %}\n {%- set system_message = default_sys %}\n {%- set conversation_messages = messages %}\n{%- endif %}\n\n{# Validate that non-tool messages alternate between user and assistant #}\n{%- set valid_messages = conversation_messages | rejectattr(\"role\", \"in\", [\"tool\", \"tool_results\"]) | list %}\n{%- for i in range(valid_messages|length) %}\n {%- if i is even and valid_messages[i][\"role\"] != \"user\" %}\n {{ raise_exception(\"Expected a user message at position \" ~ i ~ \", but got \" ~ valid_messages[i][\"role\"]) }}\n {%- elif i is odd and valid_messages[i][\"role\"] != \"assistant\" %}\n {{ raise_exception(\"Expected an assistant message at position \" ~ i ~ \", but got \" ~ valid_messages[i][\"role\"]) }}\n {%- endif %}\n{%- endfor %}\n\n{%- set conversation_token = bos_token %}\n{%- for message in conversation_messages %}\n {%- if message.role == \"user\" %}\n {# If this is the last user message and tools are available, list them #}\n {%- if tools is not none and message == (conversation_messages | last) %}\n {{ conversation_token ~ \"[AVAILABLE_TOOLS] [\" }}\n {%- for tool in tools %}\n {%- set tool_fn = tool.function %}\n {{ '{\"type\": \"function\", \"function\": ' ~ tool_fn | tojson ~ '}' ~ (\", \" if not loop.last else \"\") }}\n {%- endfor %}\n {{ \"][/AVAILABLE_TOOLS]\" }}\n {%- endif %}\n {# Attach system instruction for the first turn or for the last user message #}\n {%- if loop.last and system_message is defined %}\n {{ conversation_token ~ \"[INST] \" ~ system_message ~ \"[/INST][INST]\" ~ message.content ~ \"[/INST]<think>\" }}\n {%- else %}\n {{ conversation_token ~ \"[INST] \" ~ default_sys ~ \"[/INST][INST]\" ~ message.content ~ \"[/INST]<think>\" }}\n {%- endif %}\n {%- elif message.role == \"assistant\" %}\n {{ \" \" ~ message.content | trim ~ eos_token }}\n {%- elif message.role in [\"tool\", \"tool_results\"] %}\n {%- set content = (message.content.content if message.content is mapping and message.content.content is defined else message.content) %}\n {{ \"[TOOL_RESULTS] {\\\"content\\\": \" ~ content|string ~ \", \" ~ \"\\\"call_id\\\": \\\"\" ~ (message.tool_call_id if message.tool_call_id is defined else \"N/A\") ~ \"\\\"}[/TOOL_RESULTS]\" }}\n {%- elif message.tool_calls is defined and message.tool_calls is not none %}\n {{ \"[TOOL_CALLS] [\" }}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.id is not defined or tool_call.id|length != 9 %}\n {{ raise_exception(\"Tool call IDs must be 9 characters long!\") }}\n {%- endif %}\n {{ tool_call.function | tojson ~ (\", \" if not loop.last else \"\") }}\n {%- endfor %}\n {{ \"][\" ~ eos_token }}\n {%- else %}\n {{ raise_exception(\"Unsupported message role: \" ~ message.role) }}\n {%- endif %}\n{%- endfor %}",
|
| 8009 |
"clean_up_tokenization_spaces": false,
|
| 8010 |
"eos_token": "</s>",
|
| 8011 |
"extra_special_tokens": {},
|