Instructions to use Seanie-lee/ThinkSafe-R1-Distill-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Seanie-lee/ThinkSafe-R1-Distill-7B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-R1-Distill-Qwen-7B") model = PeftModel.from_pretrained(base_model, "Seanie-lee/ThinkSafe-R1-Distill-7B") - Transformers
How to use Seanie-lee/ThinkSafe-R1-Distill-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Seanie-lee/ThinkSafe-R1-Distill-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Seanie-lee/ThinkSafe-R1-Distill-7B", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Seanie-lee/ThinkSafe-R1-Distill-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Seanie-lee/ThinkSafe-R1-Distill-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Seanie-lee/ThinkSafe-R1-Distill-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Seanie-lee/ThinkSafe-R1-Distill-7B
- SGLang
How to use Seanie-lee/ThinkSafe-R1-Distill-7B 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 "Seanie-lee/ThinkSafe-R1-Distill-7B" \ --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": "Seanie-lee/ThinkSafe-R1-Distill-7B", "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 "Seanie-lee/ThinkSafe-R1-Distill-7B" \ --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": "Seanie-lee/ThinkSafe-R1-Distill-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Seanie-lee/ThinkSafe-R1-Distill-7B with Docker Model Runner:
docker model run hf.co/Seanie-lee/ThinkSafe-R1-Distill-7B
Update README.md
Browse files
README.md
CHANGED
|
@@ -84,118 +84,53 @@ Use the code below to get started with the model.
|
|
| 84 |
|
| 85 |
### Training Data
|
| 86 |
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
[More Information Needed]
|
| 90 |
|
| 91 |
### Training Procedure
|
| 92 |
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
#### Preprocessing [optional]
|
| 96 |
-
|
| 97 |
-
[More Information Needed]
|
| 98 |
-
|
| 99 |
|
| 100 |
#### Training Hyperparameters
|
| 101 |
|
| 102 |
-
- **Training regime:**
|
| 103 |
-
|
| 104 |
-
#### Speeds, Sizes, Times [optional]
|
| 105 |
-
|
| 106 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 107 |
-
|
| 108 |
-
[More Information Needed]
|
| 109 |
|
| 110 |
## Evaluation
|
| 111 |
|
| 112 |
-
|
| 113 |
|
| 114 |
### Testing Data, Factors & Metrics
|
| 115 |
|
| 116 |
#### Testing Data
|
| 117 |
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
[More Information Needed]
|
| 121 |
-
|
| 122 |
-
#### Factors
|
| 123 |
-
|
| 124 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 125 |
-
|
| 126 |
-
[More Information Needed]
|
| 127 |
|
| 128 |
#### Metrics
|
| 129 |
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
[More Information Needed]
|
| 133 |
-
|
| 134 |
-
### Results
|
| 135 |
-
|
| 136 |
-
[More Information Needed]
|
| 137 |
-
|
| 138 |
-
#### Summary
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
## Model Examination [optional]
|
| 143 |
-
|
| 144 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 145 |
-
|
| 146 |
-
[More Information Needed]
|
| 147 |
|
| 148 |
## Environmental Impact
|
| 149 |
|
| 150 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 151 |
-
|
| 152 |
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 153 |
|
| 154 |
-
|
| 155 |
-
- **Hours used:** [More Information Needed]
|
| 156 |
-
- **Cloud Provider:** [More Information Needed]
|
| 157 |
-
- **Compute Region:** [More Information Needed]
|
| 158 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 159 |
-
|
| 160 |
-
## Technical Specifications [optional]
|
| 161 |
-
|
| 162 |
-
### Model Architecture and Objective
|
| 163 |
-
|
| 164 |
-
[More Information Needed]
|
| 165 |
-
|
| 166 |
-
### Compute Infrastructure
|
| 167 |
-
|
| 168 |
-
[More Information Needed]
|
| 169 |
-
|
| 170 |
-
#### Hardware
|
| 171 |
-
|
| 172 |
-
[More Information Needed]
|
| 173 |
-
|
| 174 |
-
#### Software
|
| 175 |
-
|
| 176 |
-
[More Information Needed]
|
| 177 |
-
|
| 178 |
-
## Citation [optional]
|
| 179 |
-
|
| 180 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 181 |
|
| 182 |
**BibTeX:**
|
| 183 |
|
| 184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
|
| 186 |
-
|
| 187 |
|
| 188 |
-
|
|
|
|
|
|
|
| 189 |
|
| 190 |
-
## Glossary [optional]
|
| 191 |
-
|
| 192 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 193 |
-
|
| 194 |
-
[More Information Needed]
|
| 195 |
-
|
| 196 |
-
## More Information [optional]
|
| 197 |
-
|
| 198 |
-
[More Information Needed]
|
| 199 |
|
| 200 |
## Model Card Authors [optional]
|
| 201 |
|
|
|
|
| 84 |
|
| 85 |
### Training Data
|
| 86 |
|
| 87 |
+
The model was trained using the ThinkSafe self-generated safety alignment methodology. See the paper for details on the training data generation process.
|
|
|
|
|
|
|
| 88 |
|
| 89 |
### Training Procedure
|
| 90 |
|
| 91 |
+
This model uses LoRA (Low-Rank Adaptation) for efficient fine-tuning on top of the Qwen3-0.6B base model. The training follows the ThinkSafe framework for safety alignment in reasoning models.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
#### Training Hyperparameters
|
| 94 |
|
| 95 |
+
- **Training regime:** Mixed precision training with PEFT/LoRA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
## Evaluation
|
| 98 |
|
| 99 |
+
Please refer to the [ThinkSafe paper](https://huggingface.co/papers/2601.23143) for detailed evaluation results and methodology.
|
| 100 |
|
| 101 |
### Testing Data, Factors & Metrics
|
| 102 |
|
| 103 |
#### Testing Data
|
| 104 |
|
| 105 |
+
See the paper for details on evaluation datasets and benchmarks used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
#### Metrics
|
| 108 |
|
| 109 |
+
The model was evaluated on safety benchmarks and reasoning tasks. Refer to the paper for specific metrics and results.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
## Environmental Impact
|
| 112 |
|
|
|
|
|
|
|
| 113 |
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 114 |
|
| 115 |
+
## Citation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
**BibTeX:**
|
| 118 |
|
| 119 |
+
```bibtex
|
| 120 |
+
@article{lee2025thinksafe,
|
| 121 |
+
title={THINKSAFE: Self-Generated Safety Alignment for Reasoning Models},
|
| 122 |
+
author={Lee, Seanie and others},
|
| 123 |
+
journal={arXiv preprint arXiv:2601.23143},
|
| 124 |
+
year={2025}
|
| 125 |
+
}
|
| 126 |
+
```
|
| 127 |
|
| 128 |
+
## More Information
|
| 129 |
|
| 130 |
+
For more details, please refer to:
|
| 131 |
+
- Paper: https://huggingface.co/papers/2601.23143
|
| 132 |
+
- GitHub Repository: https://github.com/seanie12/ThinkSafe.git
|
| 133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
## Model Card Authors [optional]
|
| 136 |
|