Instructions to use cs-552-2026-4neurons/math_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cs-552-2026-4neurons/math_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cs-552-2026-4neurons/math_model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cs-552-2026-4neurons/math_model") model = AutoModelForCausalLM.from_pretrained("cs-552-2026-4neurons/math_model", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cs-552-2026-4neurons/math_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cs-552-2026-4neurons/math_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cs-552-2026-4neurons/math_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cs-552-2026-4neurons/math_model
- SGLang
How to use cs-552-2026-4neurons/math_model 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 "cs-552-2026-4neurons/math_model" \ --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": "cs-552-2026-4neurons/math_model", "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 "cs-552-2026-4neurons/math_model" \ --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": "cs-552-2026-4neurons/math_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cs-552-2026-4neurons/math_model with Docker Model Runner:
docker model run hf.co/cs-552-2026-4neurons/math_model
| { | |
| "attn_implementation": null, | |
| "bf16": null, | |
| "cache_dir": "/scratch/hf_cache", | |
| "data_file": "/scratch/hf_cache/competition_math_train_sft", | |
| "dataset_config": null, | |
| "dataset_name": null, | |
| "dry_run": false, | |
| "filter_overlong": true, | |
| "fp16": null, | |
| "gradient_accumulation_steps": 8, | |
| "gradient_checkpointing": true, | |
| "learning_rate": 0.0002, | |
| "logging_steps": 25, | |
| "lora_alpha": 32, | |
| "lora_dropout": 0.05, | |
| "lora_r": 16, | |
| "lora_target_modules": "q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj", | |
| "lr_scheduler_type": "cosine", | |
| "max_grad_norm": 1.0, | |
| "max_seq_length": 4096, | |
| "max_train_samples": null, | |
| "model_name_or_path": "/scratch/hf_cache/hub/models--Qwen--Qwen3-1.7B/snapshots/70d244cc86ccca08cf5af4e1e306ecf908b1ad5e", | |
| "num_train_epochs": 1.0, | |
| "optim": "adamw_torch", | |
| "output_dir": "/scratch/checkpoints/qwen3-1.7b-competition-simple-sft-lora", | |
| "per_device_train_batch_size": 1, | |
| "preprocessing_num_workers": null, | |
| "problem_column": "problem", | |
| "report_to": "wandb", | |
| "require_boxed": true, | |
| "resume_from_checkpoint": null, | |
| "save_steps": 500, | |
| "save_total_limit": 2, | |
| "seed": 42, | |
| "shuffle": true, | |
| "solution_column": "solution", | |
| "split": "train", | |
| "system_prompt": "You are a helpful math assistant. Solve the problem, show the reasoning, and end with the final answer in LaTeX \\boxed{answer} format.", | |
| "tf32": true, | |
| "thinking_mode": null, | |
| "torch_dtype": "bfloat16", | |
| "trust_remote_code": true, | |
| "user_prompt_template": "{problem}", | |
| "wandb_api_key": null, | |
| "wandb_api_key_file": null, | |
| "wandb_dir": "/scratch/wandb", | |
| "wandb_entity": null, | |
| "wandb_group": null, | |
| "wandb_job_type": "train", | |
| "wandb_log_model": null, | |
| "wandb_mode": null, | |
| "wandb_name": "simple-sft-run1", | |
| "wandb_notes": null, | |
| "wandb_project": "4neurons-math", | |
| "wandb_tags": null, | |
| "warmup_ratio": 0.03, | |
| "weight_decay": 0.0 | |
| } |