Run this model with HF Jobs
Run prithivMLmods/Deepmath-Competitive-1.5B-Preview on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/prithivMLmods/Deepmath-Competitive-1.5B-Preview. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/prithivMLmods/Deepmath-Competitive-1.5B-Preview on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/prithivMLmods/Deepmath-Competitive-1.5B-Preview. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/prithivMLmods/Deepmath-Competitive-1.5B-Preview. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use prithivMLmods/Deepmath-Competitive-1.5B-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Deepmath-Competitive-1.5B-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/Deepmath-Competitive-1.5B-Preview") 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("prithivMLmods/Deepmath-Competitive-1.5B-Preview") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/Deepmath-Competitive-1.5B-Preview", 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 prithivMLmods/Deepmath-Competitive-1.5B-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/Deepmath-Competitive-1.5B-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Deepmath-Competitive-1.5B-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/Deepmath-Competitive-1.5B-Preview
- SGLang
How to use prithivMLmods/Deepmath-Competitive-1.5B-Preview 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 "prithivMLmods/Deepmath-Competitive-1.5B-Preview" \ --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": "prithivMLmods/Deepmath-Competitive-1.5B-Preview", "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 "prithivMLmods/Deepmath-Competitive-1.5B-Preview" \ --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": "prithivMLmods/Deepmath-Competitive-1.5B-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/Deepmath-Competitive-1.5B-Preview with Docker Model Runner:
docker model run hf.co/prithivMLmods/Deepmath-Competitive-1.5B-Preview
Improve language tag
Browse filesHi! As the model is multilingual, this is a PR to add other languages than English to the language tag to improve the referencing. Note that 29 languages are announced in the README, but only 13 are explicitly listed. I was therefore only able to add these 13 languages.
1234567891011121234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108---
library_name: transformers
tags:
- math
- cot
- text-generation-inference
- preview
- experimental
license: apache-2.0
language:
- zho
- eng
---library_name: transformerstags:- math- cot- text-generation-inference- preview- experimentallicense: apache-2.0language:- enbase_model:- Qwen/Qwen2.5-1.5B-Instructpipeline_tag: text-generation---

# **Deepmath-Competitive-1.5B-Preview**
> **Deepmath-Competitive-1.5B-Preview** is a **chain-of-thought reasoning model** fine-tuned from **Qwen-1.5B**, purpose-built for solving **mathematical problems** in both **English** and **Chinese** with a focus on **long-context understanding**. It enables advanced reasoning and detailed step-by-step problem solving in a compact form — ideal for competitive exam preparation, tutoring systems, and math-focused AI assistants.
## **Key Features**
1. **Chain-of-Thought Math Reasoning** Specifically trained to output detailed intermediate steps for math problems, Deepmath-Competitive-1.5B-Preview ensures interpretability and logical clarity — vital for learning and validation.
2. **Bilingual Proficiency (English + Chinese)** Proficient in understanding and solving math problems in **both English and Simplified Chinese**, supporting diverse educational needs.
3. **Long-Context Reasoning** Optimized for **long-form math problems** and word problem comprehension, enabling reasoning over extended contexts and compound queries.
4. **Compact yet Powerful** With just 1.5B parameters, it delivers robust performance on arithmetic, algebra, geometry, logic, and competitive exam-style word problems with minimal computational cost.
5. **Structured Step-by-Step Computation** Produces clean, stepwise outputs that mimic expert human problem-solving, helping learners follow the process and logic intuitively.
## **Quickstart with Transformers**
```pythonfrom transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "prithivMLmods/Deepmath-Competitive-1.5B-Preview"
model = AutoModelForCausalLM.from_pretrained( model_name, torch_dtype="auto", device_map="auto")tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "Solve: A train travels 180 km in 3 hours. What is its average speed?"messages = [ {"role": "system", "content": "You are a helpful tutor skilled in solving math problems with step-by-step explanations."}, {"role": "user", "content": prompt}]text = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True)model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate( **model_inputs, max_new_tokens=512)generated_ids = [ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]```
## **Intended Use**
- **Math Tutoring Bots**: Delivers in-depth, multi-step solutions for students preparing for competitive and school-level math.- **Bilingual Educational Apps**: Effective in English and Chinese teaching environments.- **STEM Reasoning Tools**: Supports structured reasoning across science and engineering questions.- **Compact LLM Deployments**: Suitable for low-latency environments like mobile apps, edge devices, or web integrations.
## **Limitations**
1. **Domain Focus**: Primarily tuned for mathematics; performance may drop outside STEM or logical domains.
2. **Model Scale**: While efficient, it may underperform on abstract or research-level problems compared to larger models.
3. **Inherited Biases**: As a fine-tune of Qwen-1.5B, some pretraining biases may persist. Review is advised in critical applications.
4. **Prompt Sensitivity**: - fra
- spa
- por
- deu
- ita
- rus
- jpn
- kor
- vie
- tha
- ara
base_model:
- Qwen/Qwen2.5-1.5B-Instruct
pipeline_tag: text-generation
---

# **Deepmath-Competitive-1.5B-Preview**
> **Deepmath-Competitive-1.5B-Preview** is a **chain-of-thought reasoning model** fine-tuned from **Qwen-1.5B**, purpose-built for solving **mathematical problems** in both **English** and **Chinese** with a focus on **long-context understanding**. It enables advanced reasoning and detailed step-by-step problem solving in a compact form — ideal for competitive exam preparation, tutoring systems, and math-focused AI assistants.
## **Key Features**
1. **Chain-of-Thought Math Reasoning**
Specifically trained to output detailed intermediate steps for math problems, Deepmath-Competitive-1.5B-Preview ensures interpretability and logical clarity — vital for learning and validation.
2. **Bilingual Proficiency (English + Chinese)**
Proficient in understanding and solving math problems in **both English and Simplified Chinese**, supporting diverse educational needs.
3. **Long-Context Reasoning**
Optimized for **long-form math problems** and word problem comprehension, enabling reasoning over extended contexts and compound queries.
4. **Compact yet Powerful**
With just 1.5B parameters, it delivers robust performance on arithmetic, algebra, geometry, logic, and competitive exam-style word problems with minimal computational cost.
5. **Structured Step-by-Step Computation**
Produces clean, stepwise outputs that mimic expert human problem-solving, helping learners follow the process and logic intuitively.
## **Quickstart with Transformers**
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "prithivMLmods/Deepmath-Competitive-1.5B-Preview"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "Solve: A train travels 180 km in 3 hours. What is its average speed?"
messages = [
{"role": "system", "content": "You are a helpful tutor skilled in solving math problems with step-by-step explanations."},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=512
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
```
## **Intended Use**
- **Math Tutoring Bots**: Delivers in-depth, multi-step solutions for students preparing for competitive and school-level math.
- **Bilingual Educational Apps**: Effective in English and Chinese teaching environments.
- **STEM Reasoning Tools**: Supports structured reasoning across science and engineering questions.
- **Compact LLM Deployments**: Suitable for low-latency environments like mobile apps, edge devices, or web integrations.
## **Limitations**
1. **Domain Focus**:
Primarily tuned for mathematics; performance may drop outside STEM or logical domains.
2. **Model Scale**:
While efficient, it may underperform on abstract or research-level problems compared to larger models.
3. **Inherited Biases**:
As a fine-tune of Qwen-1.5B, some pretraining biases may persist. Review is advised in critical applications.
4. **Prompt Sensitivity**:
Performs best with clearly structured prompts and formal question phrasing.