Instructions to use modrill/Qwen3-4B-Base-ThinkCode-A-U025 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use modrill/Qwen3-4B-Base-ThinkCode-A-U025 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Base") model = PeftModel.from_pretrained(base_model, "modrill/Qwen3-4B-Base-ThinkCode-A-U025") - Transformers
How to use modrill/Qwen3-4B-Base-ThinkCode-A-U025 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="modrill/Qwen3-4B-Base-ThinkCode-A-U025")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("modrill/Qwen3-4B-Base-ThinkCode-A-U025", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use modrill/Qwen3-4B-Base-ThinkCode-A-U025 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "modrill/Qwen3-4B-Base-ThinkCode-A-U025" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modrill/Qwen3-4B-Base-ThinkCode-A-U025", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/modrill/Qwen3-4B-Base-ThinkCode-A-U025
- SGLang
How to use modrill/Qwen3-4B-Base-ThinkCode-A-U025 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/Qwen3-4B-Base-ThinkCode-A-U025" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modrill/Qwen3-4B-Base-ThinkCode-A-U025", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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/Qwen3-4B-Base-ThinkCode-A-U025" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modrill/Qwen3-4B-Base-ThinkCode-A-U025", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use modrill/Qwen3-4B-Base-ThinkCode-A-U025 with Docker Model Runner:
docker model run hf.co/modrill/Qwen3-4B-Base-ThinkCode-A-U025
| {"arm_id":"A-U025","base_model":"Qwen/Qwen3-4B-Base","base_revision":"906bfd4b4dc7f14ee4320094d8b41684abff8539","fixed_prompt_fp32_quantization_isolated_logits":[{"max_abs":0.13026046752929688,"mean_abs":0.01463189348578453,"p99_abs":0.04955993592739105,"prompt_index":0,"top10_overlap":10,"top1_equal":true},{"max_abs":0.11943221092224121,"mean_abs":0.030642252415418625,"p99_abs":0.07536689192056656,"prompt_index":1,"top10_overlap":9,"top1_equal":true},{"max_abs":0.09069585800170898,"mean_abs":0.02466517873108387,"p99_abs":0.057938352227211,"prompt_index":2,"top10_overlap":10,"top1_equal":true}],"logit_gate":{"max_abs_le":0.25,"mean_abs_le":0.05,"top10_overlap_min":9,"top1_all_equal":true},"phase_a_canary_status":"PASS","representative_bf16_weight_parity":[{"bf16_exact_samples":6,"logical_module":"model.layers.0.self_attn.q_proj","max_abs":0.0,"physical_weight":"model.layers.0.self_attn.q_proj.weight","sample_count":6},{"bf16_exact_samples":6,"logical_module":"model.layers.23.mlp.down_proj","max_abs":0.0,"physical_weight":"model.layers.23.mlp.down_proj.weight","sample_count":6},{"bf16_exact_samples":6,"logical_module":"model.layers.24.mlp.up_proj","max_abs":0.0,"physical_weight":"model.layers.24.mlp.up_proj.weight","sample_count":6},{"bf16_exact_samples":6,"logical_module":"model.layers.35.self_attn.o_proj","max_abs":0.0,"physical_weight":"model.layers.35.self_attn.o_proj.weight","sample_count":6},{"bf16_exact_samples":6,"logical_module":"lm_head","max_abs":0.0,"physical_weight":"model.embed_tokens.weight","sample_count":6}],"schema":"HF_PEFT_ADAPTER_VALIDATION_V1","status":"PASS","tensor_contract":{"base_layer_tensor_absent":true,"body_scale":0.25,"lm_head_scale":0.25,"peft_tied_adapter_storage_verified":true,"source_scaling_all_exact":true},"validated_at_utc":"2026-08-22T18:05:45Z"} | |