Instructions to use hunarbatra/4dreasoner_v1_cot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use hunarbatra/4dreasoner_v1_cot with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-VL-8B-Instruct") model = PeftModel.from_pretrained(base_model, "hunarbatra/4dreasoner_v1_cot") - Transformers
How to use hunarbatra/4dreasoner_v1_cot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hunarbatra/4dreasoner_v1_cot") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("hunarbatra/4dreasoner_v1_cot", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hunarbatra/4dreasoner_v1_cot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hunarbatra/4dreasoner_v1_cot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hunarbatra/4dreasoner_v1_cot", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/hunarbatra/4dreasoner_v1_cot
- SGLang
How to use hunarbatra/4dreasoner_v1_cot 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 "hunarbatra/4dreasoner_v1_cot" \ --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": "hunarbatra/4dreasoner_v1_cot", "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 "hunarbatra/4dreasoner_v1_cot" \ --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": "hunarbatra/4dreasoner_v1_cot", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use hunarbatra/4dreasoner_v1_cot with Docker Model Runner:
docker model run hf.co/hunarbatra/4dreasoner_v1_cot
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 3.0, | |
| "eval_steps": 100, | |
| "global_step": 576, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.05215123859191656, | |
| "grad_norm": 0.8625667095184326, | |
| "learning_rate": 1.5517241379310346e-05, | |
| "loss": 1.0726, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.10430247718383312, | |
| "grad_norm": 0.5288952589035034, | |
| "learning_rate": 3.275862068965517e-05, | |
| "loss": 0.7118, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.15645371577574968, | |
| "grad_norm": 0.33996039628982544, | |
| "learning_rate": 5e-05, | |
| "loss": 0.5481, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.20860495436766624, | |
| "grad_norm": 0.3226863443851471, | |
| "learning_rate": 6.724137931034483e-05, | |
| "loss": 0.4628, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.2607561929595828, | |
| "grad_norm": 0.2945227324962616, | |
| "learning_rate": 8.448275862068966e-05, | |
| "loss": 0.4178, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.31290743155149936, | |
| "grad_norm": 0.29200270771980286, | |
| "learning_rate": 9.999908044247358e-05, | |
| "loss": 0.398, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.3650586701434159, | |
| "grad_norm": 0.28538617491722107, | |
| "learning_rate": 9.98887744597968e-05, | |
| "loss": 0.3707, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 0.4172099087353325, | |
| "grad_norm": 0.2749938666820526, | |
| "learning_rate": 9.959502176294383e-05, | |
| "loss": 0.3726, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.46936114732724904, | |
| "grad_norm": 0.3119683861732483, | |
| "learning_rate": 9.911890251408751e-05, | |
| "loss": 0.3612, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 0.5215123859191656, | |
| "grad_norm": 0.28559353947639465, | |
| "learning_rate": 9.846216745801365e-05, | |
| "loss": 0.3491, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.5215123859191656, | |
| "eval_loss": 0.34256601333618164, | |
| "eval_runtime": 176.5162, | |
| "eval_samples_per_second": 3.864, | |
| "eval_steps_per_second": 0.969, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.5736636245110821, | |
| "grad_norm": 0.28374797105789185, | |
| "learning_rate": 9.762723148443296e-05, | |
| "loss": 0.3511, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 0.6258148631029987, | |
| "grad_norm": 0.2709859013557434, | |
| "learning_rate": 9.661716474815597e-05, | |
| "loss": 0.3381, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 0.6779661016949152, | |
| "grad_norm": 0.2764575183391571, | |
| "learning_rate": 9.543568137978372e-05, | |
| "loss": 0.3416, | |
| "step": 130 | |
| }, | |
| { | |
| "epoch": 0.7301173402868318, | |
| "grad_norm": 0.2733752727508545, | |
| "learning_rate": 9.408712582842583e-05, | |
| "loss": 0.3346, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 0.7822685788787483, | |
| "grad_norm": 0.263992041349411, | |
| "learning_rate": 9.257645688666556e-05, | |
| "loss": 0.3294, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 0.834419817470665, | |
| "grad_norm": 0.26761433482170105, | |
| "learning_rate": 9.090922945651399e-05, | |
| "loss": 0.3244, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 0.8865710560625815, | |
| "grad_norm": 0.28852951526641846, | |
| "learning_rate": 8.90915741234015e-05, | |
| "loss": 0.3245, | |
| "step": 170 | |
| }, | |
| { | |
| "epoch": 0.9387222946544981, | |
| "grad_norm": 0.2724473178386688, | |
| "learning_rate": 8.713017461331608e-05, | |
| "loss": 0.323, | |
| "step": 180 | |
| }, | |
| { | |
| "epoch": 0.9908735332464146, | |
| "grad_norm": 0.2559918463230133, | |
| "learning_rate": 8.503224321598035e-05, | |
| "loss": 0.3142, | |
| "step": 190 | |
| }, | |
| { | |
| "epoch": 1.0417209908735332, | |
| "grad_norm": 0.25570759177207947, | |
| "learning_rate": 8.28054942644397e-05, | |
| "loss": 0.277, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 1.0417209908735332, | |
| "eval_loss": 0.3157625198364258, | |
| "eval_runtime": 200.113, | |
| "eval_samples_per_second": 3.408, | |
| "eval_steps_per_second": 0.855, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 1.0938722294654497, | |
| "grad_norm": 0.25102606415748596, | |
| "learning_rate": 8.04581157685797e-05, | |
| "loss": 0.2566, | |
| "step": 210 | |
| }, | |
| { | |
| "epoch": 1.1460234680573664, | |
| "grad_norm": 0.2610400915145874, | |
| "learning_rate": 7.799873930687978e-05, | |
| "loss": 0.2514, | |
| "step": 220 | |
| }, | |
| { | |
| "epoch": 1.198174706649283, | |
| "grad_norm": 0.26567086577415466, | |
| "learning_rate": 7.543640828711466e-05, | |
| "loss": 0.2559, | |
| "step": 230 | |
| }, | |
| { | |
| "epoch": 1.2503259452411994, | |
| "grad_norm": 0.2972986400127411, | |
| "learning_rate": 7.278054469271245e-05, | |
| "loss": 0.2606, | |
| "step": 240 | |
| }, | |
| { | |
| "epoch": 1.302477183833116, | |
| "grad_norm": 0.2643340229988098, | |
| "learning_rate": 7.004091443704681e-05, | |
| "loss": 0.2535, | |
| "step": 250 | |
| }, | |
| { | |
| "epoch": 1.3546284224250327, | |
| "grad_norm": 0.2536676228046417, | |
| "learning_rate": 6.72275914530596e-05, | |
| "loss": 0.2584, | |
| "step": 260 | |
| }, | |
| { | |
| "epoch": 1.4067796610169492, | |
| "grad_norm": 0.26991742849349976, | |
| "learning_rate": 6.435092065026035e-05, | |
| "loss": 0.2515, | |
| "step": 270 | |
| }, | |
| { | |
| "epoch": 1.4589308996088657, | |
| "grad_norm": 0.2521091401576996, | |
| "learning_rate": 6.142147987531407e-05, | |
| "loss": 0.2516, | |
| "step": 280 | |
| }, | |
| { | |
| "epoch": 1.5110821382007824, | |
| "grad_norm": 0.2592126727104187, | |
| "learning_rate": 5.8450041016092464e-05, | |
| "loss": 0.2496, | |
| "step": 290 | |
| }, | |
| { | |
| "epoch": 1.5632333767926987, | |
| "grad_norm": 0.28268447518348694, | |
| "learning_rate": 5.544753039221354e-05, | |
| "loss": 0.246, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 1.5632333767926987, | |
| "eval_loss": 0.29918840527534485, | |
| "eval_runtime": 175.5784, | |
| "eval_samples_per_second": 3.884, | |
| "eval_steps_per_second": 0.974, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 1.6153846153846154, | |
| "grad_norm": 0.24876336753368378, | |
| "learning_rate": 5.242498857771816e-05, | |
| "loss": 0.2531, | |
| "step": 310 | |
| }, | |
| { | |
| "epoch": 1.667535853976532, | |
| "grad_norm": 0.27175015211105347, | |
| "learning_rate": 4.939352980361985e-05, | |
| "loss": 0.2471, | |
| "step": 320 | |
| }, | |
| { | |
| "epoch": 1.7196870925684484, | |
| "grad_norm": 0.2706572115421295, | |
| "learning_rate": 4.636430108960975e-05, | |
| "loss": 0.2484, | |
| "step": 330 | |
| }, | |
| { | |
| "epoch": 1.7718383311603652, | |
| "grad_norm": 0.25022950768470764, | |
| "learning_rate": 4.3348441255193624e-05, | |
| "loss": 0.2455, | |
| "step": 340 | |
| }, | |
| { | |
| "epoch": 1.8239895697522817, | |
| "grad_norm": 0.28196290135383606, | |
| "learning_rate": 4.035703996098214e-05, | |
| "loss": 0.2399, | |
| "step": 350 | |
| }, | |
| { | |
| "epoch": 1.8761408083441982, | |
| "grad_norm": 0.24447277188301086, | |
| "learning_rate": 3.740109693074375e-05, | |
| "loss": 0.2447, | |
| "step": 360 | |
| }, | |
| { | |
| "epoch": 1.928292046936115, | |
| "grad_norm": 0.26620620489120483, | |
| "learning_rate": 3.44914815041658e-05, | |
| "loss": 0.2382, | |
| "step": 370 | |
| }, | |
| { | |
| "epoch": 1.9804432855280312, | |
| "grad_norm": 0.27352651953697205, | |
| "learning_rate": 3.163889266905272e-05, | |
| "loss": 0.2346, | |
| "step": 380 | |
| }, | |
| { | |
| "epoch": 2.03129074315515, | |
| "grad_norm": 0.22145593166351318, | |
| "learning_rate": 2.8853819719927434e-05, | |
| "loss": 0.2004, | |
| "step": 390 | |
| }, | |
| { | |
| "epoch": 2.0834419817470664, | |
| "grad_norm": 0.2577626407146454, | |
| "learning_rate": 2.6146503687699002e-05, | |
| "loss": 0.1794, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 2.0834419817470664, | |
| "eval_loss": 0.3007373809814453, | |
| "eval_runtime": 175.4648, | |
| "eval_samples_per_second": 3.887, | |
| "eval_steps_per_second": 0.975, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 2.135593220338983, | |
| "grad_norm": 0.2457975298166275, | |
| "learning_rate": 2.3526899682223813e-05, | |
| "loss": 0.1763, | |
| "step": 410 | |
| }, | |
| { | |
| "epoch": 2.1877444589308994, | |
| "grad_norm": 0.22658194601535797, | |
| "learning_rate": 2.1004640286231198e-05, | |
| "loss": 0.1775, | |
| "step": 420 | |
| }, | |
| { | |
| "epoch": 2.239895697522816, | |
| "grad_norm": 0.25427886843681335, | |
| "learning_rate": 1.858900013521788e-05, | |
| "loss": 0.1755, | |
| "step": 430 | |
| }, | |
| { | |
| "epoch": 2.292046936114733, | |
| "grad_norm": 0.2568660378456116, | |
| "learning_rate": 1.628886181355551e-05, | |
| "loss": 0.1734, | |
| "step": 440 | |
| }, | |
| { | |
| "epoch": 2.344198174706649, | |
| "grad_norm": 0.2692377269268036, | |
| "learning_rate": 1.4112683192214598e-05, | |
| "loss": 0.175, | |
| "step": 450 | |
| }, | |
| { | |
| "epoch": 2.396349413298566, | |
| "grad_norm": 0.24048754572868347, | |
| "learning_rate": 1.2068466328208367e-05, | |
| "loss": 0.1764, | |
| "step": 460 | |
| }, | |
| { | |
| "epoch": 2.448500651890482, | |
| "grad_norm": 0.26973435282707214, | |
| "learning_rate": 1.016372804011625e-05, | |
| "loss": 0.1742, | |
| "step": 470 | |
| }, | |
| { | |
| "epoch": 2.500651890482399, | |
| "grad_norm": 0.25898903608322144, | |
| "learning_rate": 8.40547226788464e-06, | |
| "loss": 0.1769, | |
| "step": 480 | |
| }, | |
| { | |
| "epoch": 2.5528031290743156, | |
| "grad_norm": 0.2492300420999527, | |
| "learning_rate": 6.800164318540836e-06, | |
| "loss": 0.1758, | |
| "step": 490 | |
| }, | |
| { | |
| "epoch": 2.604954367666232, | |
| "grad_norm": 0.2548163831233978, | |
| "learning_rate": 5.353707092521582e-06, | |
| "loss": 0.1734, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 2.604954367666232, | |
| "eval_loss": 0.2975265383720398, | |
| "eval_runtime": 174.2803, | |
| "eval_samples_per_second": 3.913, | |
| "eval_steps_per_second": 0.981, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 2.6571056062581486, | |
| "grad_norm": 0.27377912402153015, | |
| "learning_rate": 4.071419378034896e-06, | |
| "loss": 0.1723, | |
| "step": 510 | |
| }, | |
| { | |
| "epoch": 2.7092568448500653, | |
| "grad_norm": 0.24549677968025208, | |
| "learning_rate": 2.9580162932691723e-06, | |
| "loss": 0.1701, | |
| "step": 520 | |
| }, | |
| { | |
| "epoch": 2.7614080834419816, | |
| "grad_norm": 0.2616007328033447, | |
| "learning_rate": 2.0175919483657213e-06, | |
| "loss": 0.1685, | |
| "step": 530 | |
| }, | |
| { | |
| "epoch": 2.8135593220338984, | |
| "grad_norm": 0.2631126344203949, | |
| "learning_rate": 1.2536043909088191e-06, | |
| "loss": 0.1757, | |
| "step": 540 | |
| }, | |
| { | |
| "epoch": 2.865710560625815, | |
| "grad_norm": 0.25270023941993713, | |
| "learning_rate": 6.688628902903393e-07, | |
| "loss": 0.1758, | |
| "step": 550 | |
| }, | |
| { | |
| "epoch": 2.9178617992177314, | |
| "grad_norm": 0.2603110373020172, | |
| "learning_rate": 2.6551760770569535e-07, | |
| "loss": 0.1712, | |
| "step": 560 | |
| }, | |
| { | |
| "epoch": 2.970013037809648, | |
| "grad_norm": 0.252510666847229, | |
| "learning_rate": 4.5051689765929214e-08, | |
| "loss": 0.1763, | |
| "step": 570 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "step": 576, | |
| "total_flos": 6.181870607374746e+17, | |
| "train_loss": 0.282241683660282, | |
| "train_runtime": 6736.3042, | |
| "train_samples_per_second": 2.732, | |
| "train_steps_per_second": 0.086 | |
| } | |
| ], | |
| "logging_steps": 10, | |
| "max_steps": 576, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 3, | |
| "save_steps": 100, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 6.181870607374746e+17, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |