
SmolLM2-Rethink-135M is an experimental lightweight model trained on the Celestia3-DeepSeek-R1-0528 reasoning dataset. Based on the SmolLM2-135M-Instruct architecture, this model is specifically optimized for reasoning, structured outputs, and efficient small-scale deployment. Despite its compact size (135M parameters), it demonstrates strong capabilities in logical deduction, conversational coherence, and lightweight inference tasks.
1%%capture
2!pip install transformers1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3checkpoint = "prithivMLmods/SmolLM2-Rethink-135M"
4device = "cuda" # or "cpu"
5
6tokenizer = AutoTokenizer.from_pretrained(checkpoint)
7model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
8
9messages = [{"role": "user", "content": "What is gravity?"}]
10input_text = tokenizer.apply_chat_template(messages, tokenize=False)
11print(input_text)
12
13inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
14outputs = model.generate(
15 inputs,
16 max_new_tokens=1024,
17 temperature=0.2,
18 top_p=0.9,
19 do_sample=True
20)
21
22print(tokenizer.decode(outputs[0]))