Text Generation
Transformers
English
gpt_oss
text-generation-inference
unsloth
mathematics
olympiad-math
reasoning
chain-of-thought
conversational
Instructions to use Azmainadeeb/MathGPT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Azmainadeeb/MathGPT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Azmainadeeb/MathGPT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Azmainadeeb/MathGPT") model = AutoModelForCausalLM.from_pretrained("Azmainadeeb/MathGPT") 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 Azmainadeeb/MathGPT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Azmainadeeb/MathGPT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Azmainadeeb/MathGPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Azmainadeeb/MathGPT
- SGLang
How to use Azmainadeeb/MathGPT 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 "Azmainadeeb/MathGPT" \ --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": "Azmainadeeb/MathGPT", "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 "Azmainadeeb/MathGPT" \ --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": "Azmainadeeb/MathGPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Azmainadeeb/MathGPT with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Azmainadeeb/MathGPT to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Azmainadeeb/MathGPT to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Azmainadeeb/MathGPT to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Azmainadeeb/MathGPT", max_seq_length=2048, ) - Docker Model Runner
How to use Azmainadeeb/MathGPT with Docker Model Runner:
docker model run hf.co/Azmainadeeb/MathGPT
File size: 2,907 Bytes
db2a9b9 a52da4d db2a9b9 d539efa db2a9b9 d539efa a52da4d db2a9b9 a52da4d db2a9b9 a52da4d db2a9b9 d539efa a52da4d d539efa a52da4d db2a9b9 d539efa a52da4d d539efa a52da4d d539efa a52da4d d539efa a52da4d d539efa a52da4d d539efa a52da4d d539efa a52da4d d539efa a52da4d d539efa a52da4d d539efa | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | ---
base_model: unsloth/gpt-oss-120b-unsloth-bnb-4bit
repo_name: Azmainadeeb/MathGPT
tags:
- text-generation-inference
- transformers
- unsloth
- gpt_oss
- mathematics
- olympiad-math
- reasoning
- chain-of-thought
license: apache-2.0
language:
- en
datasets:
- HuggingFaceH4/Multilingual-Thinking
- Goedel-LM/MathOlympiadBench
- hf-imo-colab/olympiads-ref-base-math-word
- alejopaullier/aimo-external-dataset
- imbishal7/math-olympiad-problems-and-solutions-aops
- baidalinadilzhan/problems-and-solutions-interantional-phos
- kishanvavdara/aimo-olympiadbench-math-dataset
---
# MathGPT (GPT-OSS-120B-Olympiad)
**MathGPT** is a high-performance reasoning model fine-tuned from **GPT-OSS 120B**. It is engineered specifically for solving complex mathematical theorems, competition-level problems (AIME/IMO), and advanced scientific reasoning.
- **Developed by:** Azmainadeeb
- **Model Type:** Causal Language Model (Fine-tuned for Mathematical Reasoning)
- **Base Model:** unsloth/gpt-oss-120b-unsloth-bnb-4bit
- **Training Framework:** Unsloth + TRL
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
## 🧩 Model Architecture
MathGPT leverages the **Mixture-of-Experts (MoE)** architecture of the GPT-OSS family, utilizing 117B total parameters with 5.1B active parameters per token. This allows the model to maintain state-of-the-art reasoning depth while remaining computationally efficient during inference.
## 📚 Training Data
The model was trained on a massive synthesis of reasoning-dense datasets to ensure "Chain of Thought" consistency:
### Primary Thinking Dataset
* **[Multilingual-Thinking](https://huggingface.co/datasets/HuggingFaceH4/Multilingual-Thinking):** Instills the core "Thinking" trace and multi-step internal monologue.
### Olympiad & Competition Sets
* **OlympiadBench & MathOlympiadBench:** High-difficulty benchmark problems.
* **IMO Math Boxed:** Problems curated from the International Mathematical Olympiad.
* **AoPS (Art of Problem Solving):** Diverse competition-style math problems.
* **AIMO External Data:** Specific sets designed for the AI Mathematical Olympiad.
## 🚀 Quickstart Usage
```python
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "Azmainadeeb/MathGPT",
max_seq_length = 4096,
load_in_4bit = True,
)
messages = [
{"role": "user", "content": "Find all real numbers x such that 8^x + 2^x = 130."}
]
# Apply the template with reasoning_effort to trigger the "Thinking" mode
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt = True,
reasoning_effort = "medium", # Options: low, medium, high
return_tensors = "pt"
).to("cuda")
outputs = model.generate(inputs, max_new_tokens = 1024)
print(tokenizer.decode(outputs[0])) |