Text Generation
Transformers
Safetensors
English
smollm3
text-generation-inference
unsloth
conversational
Instructions to use N-Bot-Int/SmolSam3-MEMGRPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use N-Bot-Int/SmolSam3-MEMGRPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="N-Bot-Int/SmolSam3-MEMGRPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("N-Bot-Int/SmolSam3-MEMGRPO") model = AutoModelForCausalLM.from_pretrained("N-Bot-Int/SmolSam3-MEMGRPO") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use N-Bot-Int/SmolSam3-MEMGRPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "N-Bot-Int/SmolSam3-MEMGRPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "N-Bot-Int/SmolSam3-MEMGRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/N-Bot-Int/SmolSam3-MEMGRPO
- SGLang
How to use N-Bot-Int/SmolSam3-MEMGRPO 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 "N-Bot-Int/SmolSam3-MEMGRPO" \ --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": "N-Bot-Int/SmolSam3-MEMGRPO", "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 "N-Bot-Int/SmolSam3-MEMGRPO" \ --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": "N-Bot-Int/SmolSam3-MEMGRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use N-Bot-Int/SmolSam3-MEMGRPO with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for N-Bot-Int/SmolSam3-MEMGRPO to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for N-Bot-Int/SmolSam3-MEMGRPO to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for N-Bot-Int/SmolSam3-MEMGRPO to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="N-Bot-Int/SmolSam3-MEMGRPO", max_seq_length=2048, ) - Docker Model Runner
How to use N-Bot-Int/SmolSam3-MEMGRPO with Docker Model Runner:
docker model run hf.co/N-Bot-Int/SmolSam3-MEMGRPO
| { | |
| "backend": "tokenizers", | |
| "bos_token": null, | |
| "clean_up_tokenization_spaces": true, | |
| "eos_token": "<|im_end|>", | |
| "fast": false, | |
| "is_local": false, | |
| "max_length": null, | |
| "model_input_names": [ | |
| "input_ids", | |
| "attention_mask" | |
| ], | |
| "model_max_length": 131072, | |
| "pad_to_multiple_of": null, | |
| "pad_token": "<|finetune_right_pad_id|>", | |
| "pad_token_type_id": 0, | |
| "padding_side": "right", | |
| "tokenizer_class": "TokenizersBackend", | |
| "chat_template": "{# ───── defaults ───── #}\n{%- if enable_thinking is not defined -%}\n{%- set enable_thinking = true -%}\n{%- endif -%}\n\n{# ───── reasoning mode ───── #}\n{%- if enable_thinking -%}\n {%- set reasoning_mode = \"/think\" -%}\n{%- else -%}\n {%- set reasoning_mode = \"/no_think\" -%}\n{%- endif -%}\n\n{# ───── header (system message) ───── #}\n{{- \"<|im_start|>system\\n\" -}}\n\n{%- if messages[0].role == \"system\" -%}\n {%- set system_message = messages[0].content -%}\n {%- if \"/no_think\" in system_message -%}\n {%- set reasoning_mode = \"/no_think\" -%}\n {%- elif \"/think\" in system_message -%}\n {%- set reasoning_mode = \"/think\" -%}\n {%- endif -%}\n {%- set custom_instructions = system_message.replace(\"/no_think\", \"\").replace(\"/think\", \"\").rstrip() -%}\n{%- endif -%}\n\n{%- if \"/system_override\" in system_message -%}\n {{- custom_instructions.replace(\"/system_override\", \"\").rstrip() -}}\n {{- \"<|im_end|>\\n\" -}}\n{%- else -%}\n {{- \"## Metadata\\n\\n\" -}}\n {{- \"Knowledge Cutoff Date: June 2025\\n\" -}}\n {%- set today = strftime_now(\"%d %B %Y\") -%}\n {{- \"Today Date: \" ~ today ~ \"\\n\" -}}\n {{- \"Reasoning Mode: \" + reasoning_mode + \"\\n\\n\" -}}\n \n {{- \"## Custom Instructions\\n\\n\" -}}\n {%- if custom_instructions -%}\n {{- custom_instructions + \"\\n\\n\" -}}\n {%- elif reasoning_mode == \"/think\" -%}\n {{- \"You are a helpful AI assistant named SmolLM, trained by Hugging Face. Your role as an assistant involves thoroughly exploring questions through a systematic thinking process before providing the final precise and accurate solutions. This requires engaging in a comprehensive cycle of analysis, summarizing, exploration, reassessment, reflection, backtracking, and iteration to develop well-considered thinking process. Please structure your response into two main sections: Thought and Solution using the specified format: <think> Thought section </think> Solution section. In the Thought section, detail your reasoning process in steps. Each step should include detailed considerations such as analysing questions, summarizing relevant findings, brainstorming new ideas, verifying the accuracy of the current steps, refining any errors, and revisiting previous steps. In the Solution section, based on various attempts, explorations, and reflections from the Thought section, systematically present the final solution that you deem correct. The Solution section should be logical, accurate, and concise and detail necessary steps needed to reach the conclusion.\\n\\n\" -}}\n {%- else -%}\n {{- \"You are a helpful AI assistant named SmolLM, trained by Hugging Face.\\n\\n\" -}}\n {%- endif -%}\n\n {%- if xml_tools or python_tools or tools -%}\n {{- \"### Tools\\n\\n\" -}}\n {%- if xml_tools or tools -%}\n {%- if tools -%}\n {%- set xml_tools = tools -%}\n {%- endif -%}\n {%- set ns = namespace(xml_tool_string=\"You may call one or more functions to assist with the user query.\\nYou are provided with function signatures within <tools></tools> XML tags:\\n\\n<tools>\\n\") -%}\n {%- for tool in xml_tools[:] -%} {# The slicing makes sure that xml_tools is a list #}\n {%- set ns.xml_tool_string = ns.xml_tool_string ~ (tool | string) ~ \"\\n\" -%}\n {%- endfor -%}\n {%- set xml_tool_string = ns.xml_tool_string + \"</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call>\" -%}\n {{- xml_tool_string -}}\n {%- endif -%}\n {%- if python_tools -%}\n {%- set ns = namespace(python_tool_string=\"When you send a message containing Python code between '<code>' and '</code>' tags, it will be executed in a stateful Jupyter notebook environment, and you will then be given the output to continued reasoning in an agentic loop.\\n\\nYou can use the following tools in your python code like regular functions:\\n<tools>\\n\") -%}\n {%- for tool in python_tools[:] -%} {# The slicing makes sure that python_tools is a list #}\n {%- set ns.python_tool_string = ns.python_tool_string ~ (tool | string) ~ \"\\n\" -%}\n {%- endfor -%}\n {%- set python_tool_string = ns.python_tool_string + \"</tools>\\n\\nThe state persists between code executions: so variables that you define in one step are still available thereafter.\" -%}\n {{- python_tool_string -}}\n {%- endif -%}\n {{- \"\\n\\n\" -}}\n {{- \"<|im_end|>\\n\" -}}\n {%- endif -%}\n{%- endif -%}\n{# ───── main loop ───── #}\n{%- for message in messages -%}\n {%- set content = message.content if message.content is string else \"\" -%}\n {%- if message.role == \"user\" -%}\n {{ \"<|im_start|>\" + message.role + \"\\n\" + content + \"<|im_end|>\\n\" }}\n {%- elif message.role == \"assistant\" -%}\n {% generation %}\n {%- if reasoning_mode == \"/think\" -%}\n {{ \"<|im_start|>assistant\\n\" + content.lstrip(\"\\n\") + \"<|im_end|>\\n\" }}\n {%- else -%}\n {{ \"<|im_start|>assistant\\n\" + \"<think>\\n\\n</think>\\n\" + content.lstrip(\"\\n\") + \"<|im_end|>\\n\" }}\n {%- endif -%}\n {% endgeneration %}\n {%- elif message.role == \"tool\" -%}\n {{ \"<|im_start|>\" + \"user\\n\" + content + \"<|im_end|>\\n\" }}\n {%- endif -%}\n{%- endfor -%}\n{# ───── generation prompt ───── #}\n{%- if add_generation_prompt -%}\n {%- if reasoning_mode == \"/think\" -%}\n {{ \"<|im_start|>assistant\\n\" }}\n {%- else -%}\n {{ \"<|im_start|>assistant\\n\" + \"<think>\\n\\n</think>\\n\" }}\n {%- endif -%}\n{%- endif -%}" | |
| } |