Text Generation
Transformers
Safetensors
qwen3
code
reasoning
lora-merged
livecodebench
conversational
text-generation-inference
Instructions to use modrill/code-think-q4b-20260908 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use modrill/code-think-q4b-20260908 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="modrill/code-think-q4b-20260908") 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("modrill/code-think-q4b-20260908") model = AutoModelForCausalLM.from_pretrained("modrill/code-think-q4b-20260908", 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 modrill/code-think-q4b-20260908 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "modrill/code-think-q4b-20260908" # 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/code-think-q4b-20260908", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/modrill/code-think-q4b-20260908
- SGLang
How to use modrill/code-think-q4b-20260908 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/code-think-q4b-20260908" \ --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/code-think-q4b-20260908", "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/code-think-q4b-20260908" \ --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/code-think-q4b-20260908", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use modrill/code-think-q4b-20260908 with Docker Model Runner:
docker model run hf.co/modrill/code-think-q4b-20260908
Add provenance/RUN_IDENTITY.json
Browse files- provenance/RUN_IDENTITY.json +123 -0
provenance/RUN_IDENTITY.json
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"schema": "RUN_IDENTITY_V1",
|
| 3 |
+
"run_id": "t30b2507-q4b-think-mix-l0.2-s0.8-v4-tail151643",
|
| 4 |
+
"corrects": "Q4B-THINK Mix Distillation 0.2:0.8 (30B-A3B-Thinking : 4B-Thinking by rows)",
|
| 5 |
+
"notes": "Mix Distillation Mix-Large (Li et al. 2025 arXiv 2502.12143): 30B-A3B-Thinking : 4B-Thinking = 0.2 : 0.8 by row/problem; one teacher trace per problem; dose target 32436894/ep ±1%, actual 1ep 32424225, 2ep 64848450. 30B source=/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/data/THINK_PAIRED_V4_2EP.parquet sha=c160713fea76eae124dbbc3b5c619d3164862da83f61d91d3970ede990a12540 (2EP first half 4715 rows). 4B source=/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/arms/Q4B-THINK-T4BDATA/data/joint-full-t4b_tail151643.parquet sha=d09c4d6272de7e50c9b2df0e401878864f09bda33db05a5833c43575969fa524. V4 recipe unchanged (LoRA r64/α128, lr 1e-4, both-sides B-row [151643,151667,151668], physical 2ep concat, seed 42). PI approved 2026-09-09.",
|
| 6 |
+
"model": {
|
| 7 |
+
"hf_id": "Qwen/Qwen3-4B-Base",
|
| 8 |
+
"revision": "906bfd4b4dc7f14ee4320094d8b41684abff8539",
|
| 9 |
+
"local_path": "/workspace/code-sft-infra/models/qwen3-4b-base",
|
| 10 |
+
"tied_embeddings": true
|
| 11 |
+
},
|
| 12 |
+
"data": {
|
| 13 |
+
"path": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/arms/Q4B-THINK-MIX/data/mix_l0.2_s0.8_tail151643_2EP.parquet",
|
| 14 |
+
"rows": 8310,
|
| 15 |
+
"sha256": "6097d7bf8bc18621ed4fbc2c7f4e6a68b65186eb1d25964fd632580f97dabdfd",
|
| 16 |
+
"census": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/arms/Q4B-THINK-MIX/data/TOKEN_CENSUS_MIX.json",
|
| 17 |
+
"physical_2ep": "concat(mix, mix) same order; teacher_source 30b/4b; tail 151643",
|
| 18 |
+
"source_1ep_path": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/arms/Q4B-THINK-MIX/data/mix_l0.2_s0.8_tail151643.parquet",
|
| 19 |
+
"source_1ep_sha256": "3c5ae286e7e5242df3c011123edaf0727405d3b535e85d77ce6b99afe7c27e77",
|
| 20 |
+
"source_1ep_rows": 4155,
|
| 21 |
+
"teacher_30b_path": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/data/THINK_PAIRED_V4_2EP.parquet",
|
| 22 |
+
"teacher_30b_sha256": "c160713fea76eae124dbbc3b5c619d3164862da83f61d91d3970ede990a12540",
|
| 23 |
+
"teacher_4b_path": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/arms/Q4B-THINK-T4BDATA/data/joint-full-t4b_tail151643.parquet",
|
| 24 |
+
"teacher_4b_sha256": "d09c4d6272de7e50c9b2df0e401878864f09bda33db05a5833c43575969fa524",
|
| 25 |
+
"mix_ratio_rows": "0.2:0.8",
|
| 26 |
+
"n30": 831,
|
| 27 |
+
"n4": 3324,
|
| 28 |
+
"active_tokens_1ep": 32424225
|
| 29 |
+
},
|
| 30 |
+
"seeds": {
|
| 31 |
+
"train": 42,
|
| 32 |
+
"eval": 3407,
|
| 33 |
+
"mix": 42
|
| 34 |
+
},
|
| 35 |
+
"parameters": {
|
| 36 |
+
"epochs": 2,
|
| 37 |
+
"target_assistant_tokens": 64848450,
|
| 38 |
+
"active_tokens_1ep": 32424225,
|
| 39 |
+
"checkpoint_target_tokens": [
|
| 40 |
+
32445505,
|
| 41 |
+
48759220,
|
| 42 |
+
64848450
|
| 43 |
+
],
|
| 44 |
+
"milestone_updates": [
|
| 45 |
+
495,
|
| 46 |
+
744,
|
| 47 |
+
990
|
| 48 |
+
],
|
| 49 |
+
"warmup_target_tokens": 3890907,
|
| 50 |
+
"learning_rate": 0.0001,
|
| 51 |
+
"row_lr": 0.0001,
|
| 52 |
+
"optimizer": "adamw",
|
| 53 |
+
"optimizer_betas": [
|
| 54 |
+
0.9,
|
| 55 |
+
0.95
|
| 56 |
+
],
|
| 57 |
+
"optimizer_eps": 1e-08,
|
| 58 |
+
"lora_rank": 64,
|
| 59 |
+
"lora_alpha": 128,
|
| 60 |
+
"lora_dropout": 0.0,
|
| 61 |
+
"lora_target_modules": [
|
| 62 |
+
"q_proj",
|
| 63 |
+
"k_proj",
|
| 64 |
+
"v_proj",
|
| 65 |
+
"o_proj",
|
| 66 |
+
"gate_proj",
|
| 67 |
+
"up_proj",
|
| 68 |
+
"down_proj"
|
| 69 |
+
],
|
| 70 |
+
"lora_weight_decay": 0.1,
|
| 71 |
+
"row_weight_decay": 0.0,
|
| 72 |
+
"max_grad_norm": 1.0,
|
| 73 |
+
"tokens_per_optimizer_update": 65536,
|
| 74 |
+
"packing": false,
|
| 75 |
+
"truncation": false,
|
| 76 |
+
"repeat_examples": false,
|
| 77 |
+
"precision": "bfloat16",
|
| 78 |
+
"trainable_dtype": "float32",
|
| 79 |
+
"gradient_checkpointing": true,
|
| 80 |
+
"eos_weight": 1.0,
|
| 81 |
+
"scheduler": "cosine_by_assistant_target_token_dose",
|
| 82 |
+
"worker_lr_scale": "rstar_dual_worker_v4._lr_scale",
|
| 83 |
+
"supervised_tail": [
|
| 84 |
+
151643
|
| 85 |
+
],
|
| 86 |
+
"trainable_token_indices": {
|
| 87 |
+
"embed_tokens": [
|
| 88 |
+
151643,
|
| 89 |
+
151667,
|
| 90 |
+
151668
|
| 91 |
+
],
|
| 92 |
+
"lm_head": [
|
| 93 |
+
151643,
|
| 94 |
+
151667,
|
| 95 |
+
151668
|
| 96 |
+
]
|
| 97 |
+
},
|
| 98 |
+
"untie_tied_embeddings": true,
|
| 99 |
+
"context": 32768,
|
| 100 |
+
"eval": {
|
| 101 |
+
"suite": "DEV256",
|
| 102 |
+
"seed": 3407,
|
| 103 |
+
"temperature": 0.6,
|
| 104 |
+
"top_p": 0.95,
|
| 105 |
+
"top_k": 20,
|
| 106 |
+
"ctx": 32768,
|
| 107 |
+
"stop_ids": [
|
| 108 |
+
151643,
|
| 109 |
+
151645
|
| 110 |
+
],
|
| 111 |
+
"base_reeval_same_mode": true
|
| 112 |
+
}
|
| 113 |
+
},
|
| 114 |
+
"code": {
|
| 115 |
+
"path": "/workspace/tools/rstar_dual_worker_v4.py",
|
| 116 |
+
"commit_or_sha256": "5cbdaca65556cbe0cf9e1374cf122c22511b02781eda6fab4ca780a869562cb7",
|
| 117 |
+
"prep": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/arms/Q4B-THINK-MIX/scripts/build_mix_distill_payload.py",
|
| 118 |
+
"prep_sha256": "2ff0f61e200d18dd55b1301f9573e923abd6fe87608220f7126cf709d4cb7288"
|
| 119 |
+
},
|
| 120 |
+
"started_at": "2026-09-09T06:13:03Z",
|
| 121 |
+
"endpoint": "2EP_ONLY @64848450 assistant tokens; no checkpoint picking",
|
| 122 |
+
"status": "RUNNING"
|
| 123 |
+
}
|