Instructions to use modrill/kodcode_3_qwen3_4b_sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use modrill/kodcode_3_qwen3_4b_sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="modrill/kodcode_3_qwen3_4b_sft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("modrill/kodcode_3_qwen3_4b_sft") model = AutoModelForCausalLM.from_pretrained("modrill/kodcode_3_qwen3_4b_sft") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use modrill/kodcode_3_qwen3_4b_sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "modrill/kodcode_3_qwen3_4b_sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modrill/kodcode_3_qwen3_4b_sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/modrill/kodcode_3_qwen3_4b_sft
- SGLang
How to use modrill/kodcode_3_qwen3_4b_sft 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 "modrill/kodcode_3_qwen3_4b_sft" \ --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": "modrill/kodcode_3_qwen3_4b_sft", "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 "modrill/kodcode_3_qwen3_4b_sft" \ --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": "modrill/kodcode_3_qwen3_4b_sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use modrill/kodcode_3_qwen3_4b_sft with Docker Model Runner:
docker model run hf.co/modrill/kodcode_3_qwen3_4b_sft
Add model card
Browse files
README.md
CHANGED
|
@@ -1,58 +1,16 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
library_name: transformers
|
| 4 |
-
model_name: qwen3-4b-sft-kodcode-3
|
| 5 |
tags:
|
| 6 |
-
-
|
| 7 |
-
-
|
| 8 |
-
-
|
| 9 |
-
|
| 10 |
---
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
| 14 |
-
This model is a fine-tuned version of [Qwen/Qwen3-4B-Base](https://huggingface.co/Qwen/Qwen3-4B-Base).
|
| 15 |
-
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 16 |
-
|
| 17 |
-
## Quick start
|
| 18 |
-
|
| 19 |
-
```python
|
| 20 |
-
from transformers import pipeline
|
| 21 |
-
|
| 22 |
-
question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
|
| 23 |
-
generator = pipeline("text-generation", model="None", device="cuda")
|
| 24 |
-
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 25 |
-
print(output["generated_text"])
|
| 26 |
-
```
|
| 27 |
-
|
| 28 |
-
## Training procedure
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
This model was trained with SFT.
|
| 35 |
-
|
| 36 |
-
### Framework versions
|
| 37 |
-
|
| 38 |
-
- TRL: 1.5.0.dev0
|
| 39 |
-
- Transformers: 5.8.0
|
| 40 |
-
- Pytorch: 2.11.0
|
| 41 |
-
- Datasets: 4.8.5
|
| 42 |
-
- Tokenizers: 0.22.2
|
| 43 |
-
|
| 44 |
-
## Citations
|
| 45 |
-
|
| 46 |
|
|
|
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
``
|
| 51 |
-
@software{vonwerra2020trl,
|
| 52 |
-
title = {{TRL: Transformers Reinforcement Learning}},
|
| 53 |
-
author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
|
| 54 |
-
license = {Apache-2.0},
|
| 55 |
-
url = {https://github.com/huggingface/trl},
|
| 56 |
-
year = {2020}
|
| 57 |
-
}
|
| 58 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
+
license: cc-by-nc-4.0
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
+
- qwen3
|
| 5 |
+
- mhm
|
| 6 |
+
- text-generation
|
| 7 |
+
library_name: transformers
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# kodcode_3_qwen3_4b_sft
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
Auto-uploaded from local training output.
|
| 13 |
|
| 14 |
+
- Source path: `trl/qwen3-4b-sft-kodcode-3`
|
| 15 |
+
- Uploaded at: `2026-05-20T05:55:31.724909`
|
| 16 |
+
- Visibility: `public`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|