Instructions to use hunarbatra/4dreasoner_v2_cot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use hunarbatra/4dreasoner_v2_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_v2_cot") - Transformers
How to use hunarbatra/4dreasoner_v2_cot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hunarbatra/4dreasoner_v2_cot") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("hunarbatra/4dreasoner_v2_cot", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use hunarbatra/4dreasoner_v2_cot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hunarbatra/4dreasoner_v2_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_v2_cot", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/hunarbatra/4dreasoner_v2_cot
- SGLang
How to use hunarbatra/4dreasoner_v2_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_v2_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_v2_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_v2_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_v2_cot", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use hunarbatra/4dreasoner_v2_cot with Docker Model Runner:
docker model run hf.co/hunarbatra/4dreasoner_v2_cot
| {"current_steps": 10, "total_steps": 330, "loss": 0.9616, "lr": 2.7272727272727273e-05, "epoch": 0.09111617312072894, "percentage": 3.03, "elapsed_time": "0:01:41", "remaining_time": "0:54:22"} | |
| {"current_steps": 20, "total_steps": 330, "loss": 0.6243, "lr": 5.757575757575758e-05, "epoch": 0.18223234624145787, "percentage": 6.06, "elapsed_time": "0:03:30", "remaining_time": "0:54:16"} | |
| {"current_steps": 30, "total_steps": 330, "loss": 0.4652, "lr": 8.787878787878789e-05, "epoch": 0.2733485193621868, "percentage": 9.09, "elapsed_time": "0:06:02", "remaining_time": "1:00:27"} | |
| {"current_steps": 40, "total_steps": 330, "loss": 0.417, "lr": 9.989933382359422e-05, "epoch": 0.36446469248291574, "percentage": 12.12, "elapsed_time": "0:08:33", "remaining_time": "1:01:59"} | |
| {"current_steps": 50, "total_steps": 330, "loss": 0.3717, "lr": 9.928561894527353e-05, "epoch": 0.45558086560364464, "percentage": 15.15, "elapsed_time": "0:11:14", "remaining_time": "1:02:54"} | |
| {"current_steps": 60, "total_steps": 330, "loss": 0.3537, "lr": 9.812096688325354e-05, "epoch": 0.5466970387243736, "percentage": 18.18, "elapsed_time": "0:13:52", "remaining_time": "1:02:24"} | |
| {"current_steps": 70, "total_steps": 330, "loss": 0.3549, "lr": 9.641839665080363e-05, "epoch": 0.6378132118451025, "percentage": 21.21, "elapsed_time": "0:16:38", "remaining_time": "1:01:47"} | |
| {"current_steps": 80, "total_steps": 330, "loss": 0.3487, "lr": 9.419694035645751e-05, "epoch": 0.7289293849658315, "percentage": 24.24, "elapsed_time": "0:19:19", "remaining_time": "1:00:24"} | |
| {"current_steps": 90, "total_steps": 330, "loss": 0.3373, "lr": 9.14814304544018e-05, "epoch": 0.8200455580865603, "percentage": 27.27, "elapsed_time": "0:22:14", "remaining_time": "0:59:17"} | |
| {"current_steps": 100, "total_steps": 330, "loss": 0.3258, "lr": 8.83022221559489e-05, "epoch": 0.9111617312072893, "percentage": 30.3, "elapsed_time": "0:25:02", "remaining_time": "0:57:35"} | |
| {"current_steps": 100, "total_steps": 330, "eval_loss": 0.3247193992137909, "epoch": 0.9111617312072893, "percentage": 30.3, "elapsed_time": "0:28:42", "remaining_time": "1:06:02"} | |
| {"current_steps": 110, "total_steps": 330, "loss": 0.3189, "lr": 8.469485410510545e-05, "epoch": 1.0, "percentage": 33.33, "elapsed_time": "0:31:44", "remaining_time": "1:03:29"} | |
| {"current_steps": 120, "total_steps": 330, "loss": 0.2635, "lr": 8.06996511113601e-05, "epoch": 1.0911161731207288, "percentage": 36.36, "elapsed_time": "0:33:30", "remaining_time": "0:58:38"} | |
| {"current_steps": 130, "total_steps": 330, "loss": 0.2591, "lr": 7.636127338052512e-05, "epoch": 1.182232346241458, "percentage": 39.39, "elapsed_time": "0:35:19", "remaining_time": "0:54:21"} | |
| {"current_steps": 140, "total_steps": 330, "loss": 0.2522, "lr": 7.172821728253562e-05, "epoch": 1.2733485193621867, "percentage": 42.42, "elapsed_time": "0:37:10", "remaining_time": "0:50:27"} | |
| {"current_steps": 150, "total_steps": 330, "loss": 0.255, "lr": 6.685227323685209e-05, "epoch": 1.3644646924829158, "percentage": 45.45, "elapsed_time": "0:38:53", "remaining_time": "0:46:40"} | |
| {"current_steps": 160, "total_steps": 330, "loss": 0.2609, "lr": 6.178794677547137e-05, "epoch": 1.4555808656036446, "percentage": 48.48, "elapsed_time": "0:40:48", "remaining_time": "0:43:21"} | |
| {"current_steps": 170, "total_steps": 330, "loss": 0.2486, "lr": 5.6591849255168015e-05, "epoch": 1.5466970387243735, "percentage": 51.52, "elapsed_time": "0:42:39", "remaining_time": "0:40:08"} | |
| {"current_steps": 180, "total_steps": 330, "loss": 0.2414, "lr": 5.132206502986368e-05, "epoch": 1.6378132118451025, "percentage": 54.55, "elapsed_time": "0:44:18", "remaining_time": "0:36:55"} | |
| {"current_steps": 190, "total_steps": 330, "loss": 0.2416, "lr": 4.603750215716057e-05, "epoch": 1.7289293849658316, "percentage": 57.58, "elapsed_time": "0:46:13", "remaining_time": "0:34:03"} | |
| {"current_steps": 200, "total_steps": 330, "loss": 0.2463, "lr": 4.0797233897138985e-05, "epoch": 1.8200455580865604, "percentage": 60.61, "elapsed_time": "0:48:00", "remaining_time": "0:31:12"} | |
| {"current_steps": 200, "total_steps": 330, "eval_loss": 0.30126097798347473, "epoch": 1.8200455580865604, "percentage": 60.61, "elapsed_time": "0:49:37", "remaining_time": "0:32:15"} | |
| {"current_steps": 210, "total_steps": 330, "loss": 0.2402, "lr": 3.5659838364445505e-05, "epoch": 1.9111617312072893, "percentage": 63.64, "elapsed_time": "0:51:26", "remaining_time": "0:29:23"} | |
| {"current_steps": 220, "total_steps": 330, "loss": 0.2455, "lr": 3.0682743715343564e-05, "epoch": 2.0, "percentage": 66.67, "elapsed_time": "0:52:55", "remaining_time": "0:26:27"} | |
| {"current_steps": 230, "total_steps": 330, "loss": 0.1869, "lr": 2.5921586189524694e-05, "epoch": 2.091116173120729, "percentage": 69.7, "elapsed_time": "0:54:52", "remaining_time": "0:23:51"} | |
| {"current_steps": 240, "total_steps": 330, "loss": 0.182, "lr": 2.1429588182782144e-05, "epoch": 2.1822323462414577, "percentage": 72.73, "elapsed_time": "0:56:30", "remaining_time": "0:21:11"} | |
| {"current_steps": 250, "total_steps": 330, "loss": 0.1812, "lr": 1.725696330273575e-05, "epoch": 2.273348519362187, "percentage": 75.76, "elapsed_time": "0:58:29", "remaining_time": "0:18:43"} | |
| {"current_steps": 260, "total_steps": 330, "loss": 0.186, "lr": 1.345035505816642e-05, "epoch": 2.364464692482916, "percentage": 78.79, "elapsed_time": "1:00:05", "remaining_time": "0:16:10"} | |
| {"current_steps": 270, "total_steps": 330, "loss": 0.1816, "lr": 1.0052315456547934e-05, "epoch": 2.4555808656036446, "percentage": 81.82, "elapsed_time": "1:01:53", "remaining_time": "0:13:45"} | |
| {"current_steps": 280, "total_steps": 330, "loss": 0.165, "lr": 7.100829338251147e-06, "epoch": 2.5466970387243735, "percentage": 84.85, "elapsed_time": "1:03:31", "remaining_time": "0:11:20"} | |
| {"current_steps": 290, "total_steps": 330, "loss": 0.1747, "lr": 4.6288897646302785e-06, "epoch": 2.6378132118451028, "percentage": 87.88, "elapsed_time": "1:05:19", "remaining_time": "0:09:00"} | |
| {"current_steps": 300, "total_steps": 330, "loss": 0.1706, "lr": 2.664129206497479e-06, "epoch": 2.7289293849658316, "percentage": 90.91, "elapsed_time": "1:06:58", "remaining_time": "0:06:41"} | |
| {"current_steps": 300, "total_steps": 330, "eval_loss": 0.3079453408718109, "epoch": 2.7289293849658316, "percentage": 90.91, "elapsed_time": "1:08:35", "remaining_time": "0:06:51"} | |
| {"current_steps": 310, "total_steps": 330, "loss": 0.1731, "lr": 1.2285106557296477e-06, "epoch": 2.8200455580865604, "percentage": 93.94, "elapsed_time": "1:10:39", "remaining_time": "0:04:33"} | |
| {"current_steps": 320, "total_steps": 330, "loss": 0.1722, "lr": 3.380821129028489e-07, "epoch": 2.9111617312072893, "percentage": 96.97, "elapsed_time": "1:12:22", "remaining_time": "0:02:15"} | |
| {"current_steps": 330, "total_steps": 330, "loss": 0.1705, "lr": 2.797195404247166e-09, "epoch": 3.0, "percentage": 100.0, "elapsed_time": "1:13:59", "remaining_time": "0:00:00"} | |
| {"current_steps": 330, "total_steps": 330, "epoch": 3.0, "percentage": 100.0, "elapsed_time": "1:14:10", "remaining_time": "0:00:00"} | |