Text Generation
Transformers
Safetensors
qwen3
Merge
taskvector
code
think
conversational
text-generation-inference
Instructions to use Montalte/qwen4b-code-think-taskvector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Montalte/qwen4b-code-think-taskvector with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Montalte/qwen4b-code-think-taskvector") 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("Montalte/qwen4b-code-think-taskvector") model = AutoModelForCausalLM.from_pretrained("Montalte/qwen4b-code-think-taskvector", 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 Montalte/qwen4b-code-think-taskvector with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Montalte/qwen4b-code-think-taskvector" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Montalte/qwen4b-code-think-taskvector", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Montalte/qwen4b-code-think-taskvector
- SGLang
How to use Montalte/qwen4b-code-think-taskvector 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 "Montalte/qwen4b-code-think-taskvector" \ --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": "Montalte/qwen4b-code-think-taskvector", "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 "Montalte/qwen4b-code-think-taskvector" \ --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": "Montalte/qwen4b-code-think-taskvector", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Montalte/qwen4b-code-think-taskvector with Docker Model Runner:
docker model run hf.co/Montalte/qwen4b-code-think-taskvector
Download provenance/RUN_IDENTITY.json from Montalte/qwen4b-code-think-taskvector: direct link, hf CLI and curl.
- Browser
- Download file 4.73 kB
-
https://huggingface.co/Montalte/qwen4b-code-think-taskvector/resolve/main/provenance/RUN_IDENTITY.json
- Command line
-
hf download hf://Montalte/qwen4b-code-think-taskvector/provenance/RUN_IDENTITY.json
-
curl -L -o RUN_IDENTITY.json https://huggingface.co/Montalte/qwen4b-code-think-taskvector/resolve/main/provenance/RUN_IDENTITY.json
4.73 kB
| { | |
| "schema": "RUN_IDENTITY_V1", | |
| "run_id": "t30b2507-q4b-think-mix-l0.2-s0.8-v4-tail151643", | |
| "corrects": "Q4B-THINK Mix Distillation 0.2:0.8 (30B-A3B-Thinking : 4B-Thinking by rows)", | |
| "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.", | |
| "model": { | |
| "hf_id": "Qwen/Qwen3-4B-Base", | |
| "revision": "906bfd4b4dc7f14ee4320094d8b41684abff8539", | |
| "local_path": "/workspace/code-sft-infra/models/qwen3-4b-base", | |
| "tied_embeddings": true | |
| }, | |
| "data": { | |
| "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", | |
| "rows": 8310, | |
| "sha256": "6097d7bf8bc18621ed4fbc2c7f4e6a68b65186eb1d25964fd632580f97dabdfd", | |
| "census": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/arms/Q4B-THINK-MIX/data/TOKEN_CENSUS_MIX.json", | |
| "physical_2ep": "concat(mix, mix) same order; teacher_source 30b/4b; tail 151643", | |
| "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", | |
| "source_1ep_sha256": "3c5ae286e7e5242df3c011123edaf0727405d3b535e85d77ce6b99afe7c27e77", | |
| "source_1ep_rows": 4155, | |
| "teacher_30b_path": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/data/THINK_PAIRED_V4_2EP.parquet", | |
| "teacher_30b_sha256": "c160713fea76eae124dbbc3b5c619d3164862da83f61d91d3970ede990a12540", | |
| "teacher_4b_path": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/arms/Q4B-THINK-T4BDATA/data/joint-full-t4b_tail151643.parquet", | |
| "teacher_4b_sha256": "d09c4d6272de7e50c9b2df0e401878864f09bda33db05a5833c43575969fa524", | |
| "mix_ratio_rows": "0.2:0.8", | |
| "n30": 831, | |
| "n4": 3324, | |
| "active_tokens_1ep": 32424225 | |
| }, | |
| "seeds": { | |
| "train": 42, | |
| "eval": 3407, | |
| "mix": 42 | |
| }, | |
| "parameters": { | |
| "epochs": 2, | |
| "target_assistant_tokens": 64848450, | |
| "active_tokens_1ep": 32424225, | |
| "checkpoint_target_tokens": [ | |
| 32445505, | |
| 48759220, | |
| 64848450 | |
| ], | |
| "milestone_updates": [ | |
| 495, | |
| 744, | |
| 990 | |
| ], | |
| "warmup_target_tokens": 3890907, | |
| "learning_rate": 0.0001, | |
| "row_lr": 0.0001, | |
| "optimizer": "adamw", | |
| "optimizer_betas": [ | |
| 0.9, | |
| 0.95 | |
| ], | |
| "optimizer_eps": 1e-08, | |
| "lora_rank": 64, | |
| "lora_alpha": 128, | |
| "lora_dropout": 0.0, | |
| "lora_target_modules": [ | |
| "q_proj", | |
| "k_proj", | |
| "v_proj", | |
| "o_proj", | |
| "gate_proj", | |
| "up_proj", | |
| "down_proj" | |
| ], | |
| "lora_weight_decay": 0.1, | |
| "row_weight_decay": 0.0, | |
| "max_grad_norm": 1.0, | |
| "tokens_per_optimizer_update": 65536, | |
| "packing": false, | |
| "truncation": false, | |
| "repeat_examples": false, | |
| "precision": "bfloat16", | |
| "trainable_dtype": "float32", | |
| "gradient_checkpointing": true, | |
| "eos_weight": 1.0, | |
| "scheduler": "cosine_by_assistant_target_token_dose", | |
| "worker_lr_scale": "rstar_dual_worker_v4._lr_scale", | |
| "supervised_tail": [ | |
| 151643 | |
| ], | |
| "trainable_token_indices": { | |
| "embed_tokens": [ | |
| 151643, | |
| 151667, | |
| 151668 | |
| ], | |
| "lm_head": [ | |
| 151643, | |
| 151667, | |
| 151668 | |
| ] | |
| }, | |
| "untie_tied_embeddings": true, | |
| "context": 32768, | |
| "eval": { | |
| "suite": "DEV256", | |
| "seed": 3407, | |
| "temperature": 0.6, | |
| "top_p": 0.95, | |
| "top_k": 20, | |
| "ctx": 32768, | |
| "stop_ids": [ | |
| 151643, | |
| 151645 | |
| ], | |
| "base_reeval_same_mode": true | |
| } | |
| }, | |
| "code": { | |
| "path": "/workspace/tools/rstar_dual_worker_v4.py", | |
| "commit_or_sha256": "5cbdaca65556cbe0cf9e1374cf122c22511b02781eda6fab4ca780a869562cb7", | |
| "prep": "/workspace/code-sft-runs/t30b2507-q4b-tn-v2-lr1e4-e1-20260907/arms/Q4B-THINK-MIX/scripts/build_mix_distill_payload.py", | |
| "prep_sha256": "2ff0f61e200d18dd55b1301f9573e923abd6fe87608220f7126cf709d4cb7288" | |
| }, | |
| "started_at": "2026-09-09T06:13:03Z", | |
| "endpoint": "2EP_ONLY @64848450 assistant tokens; no checkpoint picking", | |
| "status": "RUNNING" | |
| } | |