Instructions to use Shekswess/trlm-stage-2-sft-final-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Shekswess/trlm-stage-2-sft-final-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Shekswess/trlm-stage-2-sft-final-2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Shekswess/trlm-stage-2-sft-final-2") model = AutoModelForCausalLM.from_pretrained("Shekswess/trlm-stage-2-sft-final-2") 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 Shekswess/trlm-stage-2-sft-final-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Shekswess/trlm-stage-2-sft-final-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Shekswess/trlm-stage-2-sft-final-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Shekswess/trlm-stage-2-sft-final-2
- SGLang
How to use Shekswess/trlm-stage-2-sft-final-2 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 "Shekswess/trlm-stage-2-sft-final-2" \ --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": "Shekswess/trlm-stage-2-sft-final-2", "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 "Shekswess/trlm-stage-2-sft-final-2" \ --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": "Shekswess/trlm-stage-2-sft-final-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Shekswess/trlm-stage-2-sft-final-2 with Docker Model Runner:
docker model run hf.co/Shekswess/trlm-stage-2-sft-final-2
π§ trlm-stage-2-sft-final-2
trlm-stage-2-sft-final-2 is the Stage 2 post-training model for the Tiny Reasoning Language Model (trlm) project.
This stage focuses on reasoning tasks, fine-tuned on a curated dataset of 78,000 entries with reasoning tokens (<think>...</think>).
π Model Description
- Base Model: Shekswess/trlm-stage-1-sft-final-2
- Type: Causal Language Model (decoder-only transformer)
- Stage: Post-training Stage 2 (SFT)
- Objective: Equip the model with reasoning ability, multi-turn thought structuring, and explicit
<think>chain-of-thought representations.
This stage teaches the model to analyze problems step-by-step, reason with intermediate thoughts, and provide structured answers.
π― Intended Uses & Limitations
Intended Uses
- Reasoning-based question answering
- Step-by-step logical explanations
- Multi-turn reasoning with
<think>traces - Precursor to preference optimization (Stage 3)
Limitations
- May overfit on reasoning style and hallucinate
<think>tokens in simple tasks - Still limited in knowledge scope (135M parameters)
- Trained only on English datasets
π Training Data
This model was trained on the dataset:
π Shekswess/trlm-sft-stage-2-final-2
Dataset summary:
- Entries: 78,000
- Sources: 6 HuggingFaceTB/smoltalk2 subsets
- Focus: Reasoning tasks with
<think>annotations
| Source Dataset | Entries | Percentage % |
|---|---|---|
| Llama_Nemotron_Post_Training_Dataset_reasoning_r1 | 40,200 | 51.5% |
| OpenThoughts3_1.2M | 20,000 | 25.6% |
| multi_turn_reasoning_if_think | 10,000 | 12.8% |
| aya_dataset_Qwen3_32B_think | 5,000 | 6.4% |
| smoltalk_everyday_convs_reasoning_Qwen3_32B_think | 2,000 | 2.6% |
| s1k_1.1_think | 800 | 1.0% |
βοΈ Training Procedure
Training Hyperparameters
- Learning rate: 3e-4
- Train batch size: 32
- Eval batch size: 8
- Gradient accumulation steps: 4
- Total effective batch size: 128
- Optimizer: AdamW (betas=(0.9, 0.99), eps=1e-08)
- LR Scheduler: Cosine with warmup ratio 0.1
- Epochs: 1
- Seed: 42
Framework Versions
- Transformers: 4.56.2
- PyTorch: 2.7.1+rocm7.0.0.git698b58a9
- Datasets: 4.0.0
- Tokenizers: 0.22.1
π Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "Shekswess/trlm-stage-2-sft-final-2"
# Load tokenizer & model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Example inference with reasoning
messages = [
{"role": "user", "content": "If a train travels 60 km in 1 hour and another 90 km in 1.5 hours, what is the average speed?"}
]
# Apply chat template
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
π Next Steps
- Stage 3: DPO / preference optimization for reasoning stability
Part of the Tiny Reasoning Language Model (trlm) post-training pipeline.
- Downloads last month
- 4
Model tree for Shekswess/trlm-stage-2-sft-final-2
Base model
HuggingFaceTB/SmolLM2-135M