Text Generation
Transformers
Safetensors
English
phi3
Rust
code
text-generation-inference
lora
reasoning
quantization
conversational
4-bit precision
bitsandbytes
Instructions to use SkyAsl/Rust-Master-thinking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SkyAsl/Rust-Master-thinking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SkyAsl/Rust-Master-thinking") 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("SkyAsl/Rust-Master-thinking") model = AutoModelForCausalLM.from_pretrained("SkyAsl/Rust-Master-thinking", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SkyAsl/Rust-Master-thinking with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SkyAsl/Rust-Master-thinking" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SkyAsl/Rust-Master-thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SkyAsl/Rust-Master-thinking
- SGLang
How to use SkyAsl/Rust-Master-thinking 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 "SkyAsl/Rust-Master-thinking" \ --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": "SkyAsl/Rust-Master-thinking", "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 "SkyAsl/Rust-Master-thinking" \ --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": "SkyAsl/Rust-Master-thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SkyAsl/Rust-Master-thinking with Docker Model Runner:
docker model run hf.co/SkyAsl/Rust-Master-thinking
Update README.md
Browse files
README.md
CHANGED
|
@@ -21,7 +21,7 @@ tags:
|
|
| 21 |
|
| 22 |
This repository contains a fine-tuned version of
|
| 23 |
**unsloth/phi-4-reasoning**, trained with **LoRA** on the
|
| 24 |
-
**Tesslate/Rust_Dataset**.
|
| 25 |
The goal of this project is to enhance the model's reasoning,
|
| 26 |
explanation, and step-by-step thinking abilities specifically for
|
| 27 |
**Rust-related tasks**.
|
|
@@ -30,10 +30,10 @@ explanation, and step-by-step thinking abilities specifically for
|
|
| 30 |
|
| 31 |
This model was fine-tuned to:
|
| 32 |
|
| 33 |
-
- Improve **Rust coding explanations**
|
| 34 |
-
- Generate **high-quality reasoning traces**
|
| 35 |
-
- Provide **step-by-step problem solving**
|
| 36 |
-
- Give **detailed and structured answers**
|
| 37 |
- Handle **`<think>`{=html}...`</think>`{=html} hidden reasoning
|
| 38 |
tags**
|
| 39 |
|
|
@@ -88,26 +88,26 @@ print(tokenizer.decode(output[0], skip_special_tokens=False))
|
|
| 88 |
|
| 89 |
**unsloth/phi-4-reasoning**
|
| 90 |
|
| 91 |
-
- 14B parameter reasoning-optimized model
|
| 92 |
-
- Uses internal `<think>` reasoning
|
| 93 |
- Strong on step-by-step chain-of-thought tasks
|
| 94 |
|
| 95 |
## 🛠 Fine-Tuning Details
|
| 96 |
|
| 97 |
-
|
| 98 |
-
----------------
|
| 99 |
-
Method
|
| 100 |
-
Rank (r)
|
| 101 |
-
Alpha
|
| 102 |
-
Dropout
|
| 103 |
-
Target Modules
|
| 104 |
-
Max Length
|
| 105 |
-
Precision
|
| 106 |
-
Batch Size
|
| 107 |
-
Grad Accum
|
| 108 |
-
LR
|
| 109 |
-
Scheduler
|
| 110 |
-
Epochs
|
| 111 |
|
| 112 |
## Evaluation
|
| 113 |
| Epoch | Training Loss | Validation Loss |
|
|
@@ -120,8 +120,8 @@ print(tokenizer.decode(output[0], skip_special_tokens=False))
|
|
| 120 |
|
| 121 |
Includes:
|
| 122 |
|
| 123 |
-
- Rust prompts
|
| 124 |
-
- Step-by-step reasoning
|
| 125 |
- Final answers
|
| 126 |
|
| 127 |
This dataset improves the model's ability to produce structured and
|
|
@@ -131,7 +131,7 @@ accurate explanations for Rust programming tasks.
|
|
| 131 |
|
| 132 |
This model preserves **hidden reasoning structure**:
|
| 133 |
|
| 134 |
-
- `<think>` content is **internal chain-of-thought**
|
| 135 |
- The final output is **placed after the reasoning block**
|
| 136 |
|
| 137 |
⚠️ Users should NOT expect the `<think>` content to be revealed; the
|
|
@@ -139,6 +139,6 @@ model is aligned to hide reasoning by default.
|
|
| 139 |
|
| 140 |
## ✨ Acknowledgements
|
| 141 |
|
| 142 |
-
- **Unsloth** for optimized model training
|
| 143 |
-
- **HuggingFace Transformers & PEFT** team
|
| 144 |
- **Tesslate** for providing the Rust dataset
|
|
|
|
| 21 |
|
| 22 |
This repository contains a fine-tuned version of
|
| 23 |
**unsloth/phi-4-reasoning**, trained with **LoRA** on the
|
| 24 |
+
**Tesslate/Rust_Dataset**.
|
| 25 |
The goal of this project is to enhance the model's reasoning,
|
| 26 |
explanation, and step-by-step thinking abilities specifically for
|
| 27 |
**Rust-related tasks**.
|
|
|
|
| 30 |
|
| 31 |
This model was fine-tuned to:
|
| 32 |
|
| 33 |
+
- Improve **Rust coding explanations**
|
| 34 |
+
- Generate **high-quality reasoning traces**
|
| 35 |
+
- Provide **step-by-step problem solving**
|
| 36 |
+
- Give **detailed and structured answers**
|
| 37 |
- Handle **`<think>`{=html}...`</think>`{=html} hidden reasoning
|
| 38 |
tags**
|
| 39 |
|
|
|
|
| 88 |
|
| 89 |
**unsloth/phi-4-reasoning**
|
| 90 |
|
| 91 |
+
- 14B parameter reasoning-optimized model
|
| 92 |
+
- Uses internal `<think>` reasoning
|
| 93 |
- Strong on step-by-step chain-of-thought tasks
|
| 94 |
|
| 95 |
## 🛠 Fine-Tuning Details
|
| 96 |
|
| 97 |
+
| Setting | Value |
|
| 98 |
+
|----------------|-----------------------------------------|
|
| 99 |
+
| Method | LoRA (PEFT) |
|
| 100 |
+
| Rank (r) | 16 |
|
| 101 |
+
| Alpha | 32 |
|
| 102 |
+
| Dropout | 0.05 |
|
| 103 |
+
| Target Modules | q/k/v/o proj, mlp (up/down/gate) |
|
| 104 |
+
| Max Length | 512 |
|
| 105 |
+
| Precision | 4-bit QLoRA |
|
| 106 |
+
| Batch Size | 16 |
|
| 107 |
+
| Grad Accum | 8 |
|
| 108 |
+
| LR | 2e-4 |
|
| 109 |
+
| Scheduler | cosine |
|
| 110 |
+
| Epochs | 1 |
|
| 111 |
|
| 112 |
## Evaluation
|
| 113 |
| Epoch | Training Loss | Validation Loss |
|
|
|
|
| 120 |
|
| 121 |
Includes:
|
| 122 |
|
| 123 |
+
- Rust prompts
|
| 124 |
+
- Step-by-step reasoning
|
| 125 |
- Final answers
|
| 126 |
|
| 127 |
This dataset improves the model's ability to produce structured and
|
|
|
|
| 131 |
|
| 132 |
This model preserves **hidden reasoning structure**:
|
| 133 |
|
| 134 |
+
- `<think>` content is **internal chain-of-thought**
|
| 135 |
- The final output is **placed after the reasoning block**
|
| 136 |
|
| 137 |
⚠️ Users should NOT expect the `<think>` content to be revealed; the
|
|
|
|
| 139 |
|
| 140 |
## ✨ Acknowledgements
|
| 141 |
|
| 142 |
+
- **Unsloth** for optimized model training
|
| 143 |
+
- **HuggingFace Transformers & PEFT** team
|
| 144 |
- **Tesslate** for providing the Rust dataset
|