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/POLICY.json
Browse files- provenance/POLICY.json +169 -0
provenance/POLICY.json
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"arms": [
|
| 3 |
+
{
|
| 4 |
+
"arm_id": "Q4B-THINK-MIX",
|
| 5 |
+
"data": {
|
| 6 |
+
"assistant_target_tokens": 64848450,
|
| 7 |
+
"manifest_file_sha256": "fc22e609554e898f2ae570f75bce208ae3428aada9931dc43bc7da3735f95885",
|
| 8 |
+
"manifest_path": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/arms/Q4B-THINK-MIX/data/mix_l0.2_s0.8_tail151643_2EP_READY.json",
|
| 9 |
+
"manifest_sha256": "fc22e609554e898f2ae570f75bce208ae3428aada9931dc43bc7da3735f95885",
|
| 10 |
+
"max_assistant_target_tokens_per_example": 16384,
|
| 11 |
+
"payload_rows": 8310,
|
| 12 |
+
"payload_sha256": "6097d7bf8bc18621ed4fbc2c7f4e6a68b65186eb1d25964fd632580f97dabdfd",
|
| 13 |
+
"source_revision": "3a7a0a0636ec96e3c1ec42ebe79ade467caa040d"
|
| 14 |
+
},
|
| 15 |
+
"gpu": 2,
|
| 16 |
+
"model": {
|
| 17 |
+
"config_sha256": "304b2545a258d35620f1d4bf46940c0471d9baa00715ff8e77f84c2fca5057c1",
|
| 18 |
+
"hf_id": "Qwen/Qwen3-4B-Base",
|
| 19 |
+
"local_path": "/workspace/code-sft-infra/models/qwen3-4b-base",
|
| 20 |
+
"revision": "906bfd4b4dc7f14ee4320094d8b41684abff8539",
|
| 21 |
+
"tie_word_embeddings": true,
|
| 22 |
+
"tokenizer_sha256": "c0382117ea329cdf097041132f6d735924b697924d6f6fc3945713e96ce87539"
|
| 23 |
+
},
|
| 24 |
+
"model_id": "qwen3-4b-base",
|
| 25 |
+
"renderer": {
|
| 26 |
+
"assistant_termination": {
|
| 27 |
+
"final_text_suffix": "<|endoftext|>",
|
| 28 |
+
"final_token_suffix": [
|
| 29 |
+
151643
|
| 30 |
+
],
|
| 31 |
+
"turn_end_token_id": 151645
|
| 32 |
+
},
|
| 33 |
+
"chat_template_kwargs": {
|
| 34 |
+
"enable_thinking": true
|
| 35 |
+
},
|
| 36 |
+
"chat_template_sha256": "b608d01889daca5f325cc44d1cbabf73ec74d4d53c9950725cc46068a7006a68",
|
| 37 |
+
"encoding_policy": {
|
| 38 |
+
"add_special_tokens": false,
|
| 39 |
+
"assistant_termination_in_loss": true,
|
| 40 |
+
"assistant_termination_in_target_census": true,
|
| 41 |
+
"incomplete_target": "reject",
|
| 42 |
+
"padding_label_mask": "attention_or_pad_positions_never_token_id"
|
| 43 |
+
},
|
| 44 |
+
"eos_token": "<|endoftext|>",
|
| 45 |
+
"eos_token_id": 151643,
|
| 46 |
+
"mode": "think",
|
| 47 |
+
"runtime_tokenizer_manifest_sha256": "66615d472270d50fca0a4b4b299ab2663a9944102f0afd4626fcee46214fe248",
|
| 48 |
+
"runtime_tokenizer_path": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/tokenizers/qwen3-v4-tail151643",
|
| 49 |
+
"stop_token_ids": [
|
| 50 |
+
151643,
|
| 51 |
+
151645
|
| 52 |
+
],
|
| 53 |
+
"system_prompt": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.",
|
| 54 |
+
"system_prompt_policy": "exact_evalscope_live_code_bench_system_message",
|
| 55 |
+
"system_prompt_policy_sha256": "209896b91040ef82e511aa0c7c95a2f9f5dadc9d3c4879f7c66da4ddca34295b",
|
| 56 |
+
"system_prompt_sha256": "41b9af0ebedb936e74e0996175f76f0116c334375ec3a7c914166f126c02f489",
|
| 57 |
+
"tokenizer_hf_id": "Qwen/Qwen3-4B-Base",
|
| 58 |
+
"tokenizer_revision": "906bfd4b4dc7f14ee4320094d8b41684abff8539",
|
| 59 |
+
"tokenizer_sha256": "c0382117ea329cdf097041132f6d735924b697924d6f6fc3945713e96ce87539"
|
| 60 |
+
},
|
| 61 |
+
"renderer_authority": {
|
| 62 |
+
"path": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/tokenizers/qwen3-v4-tail151643.authority.json",
|
| 63 |
+
"sha256": "6b1461404d033b79f05a8cbb373f05a495d506a567b35b18cbf89930f345422a"
|
| 64 |
+
},
|
| 65 |
+
"renderer_id": "qwen3-8b-think-lcb-system-v2",
|
| 66 |
+
"source_id": "rstar-coder"
|
| 67 |
+
}
|
| 68 |
+
],
|
| 69 |
+
"generation_behavior_gate": null,
|
| 70 |
+
"owner_authorization": "PI 2026-09-09 Q4B-THINK-MIX Mix Distillation 0.2:0.8",
|
| 71 |
+
"recipe": {
|
| 72 |
+
"adapter": {
|
| 73 |
+
"alpha": 128,
|
| 74 |
+
"dropout": 0.0,
|
| 75 |
+
"method": "lora",
|
| 76 |
+
"modules_to_save": null,
|
| 77 |
+
"rank": 64,
|
| 78 |
+
"target_modules": [
|
| 79 |
+
"q_proj",
|
| 80 |
+
"k_proj",
|
| 81 |
+
"v_proj",
|
| 82 |
+
"o_proj",
|
| 83 |
+
"gate_proj",
|
| 84 |
+
"up_proj",
|
| 85 |
+
"down_proj"
|
| 86 |
+
]
|
| 87 |
+
},
|
| 88 |
+
"boundary": {
|
| 89 |
+
"fp32_master": true,
|
| 90 |
+
"mode": "trainable_token_rows_both_sides",
|
| 91 |
+
"row_lr": 0.0001,
|
| 92 |
+
"row_weight_decay": 0.0,
|
| 93 |
+
"token_ids": [
|
| 94 |
+
151643,
|
| 95 |
+
151667,
|
| 96 |
+
151668
|
| 97 |
+
],
|
| 98 |
+
"untie_tied_embeddings": true
|
| 99 |
+
},
|
| 100 |
+
"checkpoint_target_tokens": [
|
| 101 |
+
32445505,
|
| 102 |
+
48759220,
|
| 103 |
+
64848450
|
| 104 |
+
],
|
| 105 |
+
"epochs": 2,
|
| 106 |
+
"gradient_checkpointing": true,
|
| 107 |
+
"max_sequence_length": 32768,
|
| 108 |
+
"model_runtime": {
|
| 109 |
+
"bf16": true,
|
| 110 |
+
"finetuning_type": "lora",
|
| 111 |
+
"gradient_checkpointing": true,
|
| 112 |
+
"lora_alpha": 128,
|
| 113 |
+
"lora_dropout": 0.0,
|
| 114 |
+
"lora_rank": 64,
|
| 115 |
+
"lora_targets": [
|
| 116 |
+
"q_proj",
|
| 117 |
+
"k_proj",
|
| 118 |
+
"v_proj",
|
| 119 |
+
"o_proj",
|
| 120 |
+
"gate_proj",
|
| 121 |
+
"up_proj",
|
| 122 |
+
"down_proj"
|
| 123 |
+
],
|
| 124 |
+
"modules_to_save": null,
|
| 125 |
+
"trainable_dtype": "float32",
|
| 126 |
+
"trainable_token_indices": {
|
| 127 |
+
"embed_tokens": [
|
| 128 |
+
151643,
|
| 129 |
+
151667,
|
| 130 |
+
151668
|
| 131 |
+
],
|
| 132 |
+
"lm_head": [
|
| 133 |
+
151643,
|
| 134 |
+
151667,
|
| 135 |
+
151668
|
| 136 |
+
]
|
| 137 |
+
}
|
| 138 |
+
},
|
| 139 |
+
"optimizer": {
|
| 140 |
+
"betas": [
|
| 141 |
+
0.9,
|
| 142 |
+
0.95
|
| 143 |
+
],
|
| 144 |
+
"eps": 1e-08,
|
| 145 |
+
"gradient_clip_norm": 1.0,
|
| 146 |
+
"learning_rate": 0.0001,
|
| 147 |
+
"name": "adamw",
|
| 148 |
+
"weight_decay": 0.1
|
| 149 |
+
},
|
| 150 |
+
"packing": {
|
| 151 |
+
"enabled": false
|
| 152 |
+
},
|
| 153 |
+
"precision": "bfloat16",
|
| 154 |
+
"repeat_examples": false,
|
| 155 |
+
"scheduler": "cosine_by_assistant_target_token_dose",
|
| 156 |
+
"seed": 42,
|
| 157 |
+
"target_assistant_tokens": 64848450,
|
| 158 |
+
"tokens_per_optimizer_update": 65536,
|
| 159 |
+
"trainable_dtype": "float32",
|
| 160 |
+
"truncation": false,
|
| 161 |
+
"warmup_target_tokens": 3890907
|
| 162 |
+
},
|
| 163 |
+
"runtime": {
|
| 164 |
+
"checkpoint_root": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/arms/Q4B-THINK-MIX/out",
|
| 165 |
+
"state_root": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/arms/Q4B-THINK-MIX"
|
| 166 |
+
},
|
| 167 |
+
"schema": "CODE_SFT_RSTAR_DUAL_TRAINING_POLICY_V1",
|
| 168 |
+
"status": "SEALED"
|
| 169 |
+
}
|