Instructions to use ShahriarFerdoush/llama-3.2-1b-math-solver with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ShahriarFerdoush/llama-3.2-1b-math-solver with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ShahriarFerdoush/llama-3.2-1b-math-solver")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ShahriarFerdoush/llama-3.2-1b-math-solver") model = AutoModelForCausalLM.from_pretrained("ShahriarFerdoush/llama-3.2-1b-math-solver") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ShahriarFerdoush/llama-3.2-1b-math-solver with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ShahriarFerdoush/llama-3.2-1b-math-solver" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ShahriarFerdoush/llama-3.2-1b-math-solver", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ShahriarFerdoush/llama-3.2-1b-math-solver
- SGLang
How to use ShahriarFerdoush/llama-3.2-1b-math-solver 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 "ShahriarFerdoush/llama-3.2-1b-math-solver" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ShahriarFerdoush/llama-3.2-1b-math-solver", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "ShahriarFerdoush/llama-3.2-1b-math-solver" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ShahriarFerdoush/llama-3.2-1b-math-solver", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ShahriarFerdoush/llama-3.2-1b-math-solver with Docker Model Runner:
docker model run hf.co/ShahriarFerdoush/llama-3.2-1b-math-solver
LLaMA-3.2-1B-Math (QLoRA)
Model Summary
LLaMA-3.2-1B-Math is a compact math-reasoning model fine-tuned from LLaMA 3.2-1B using 4-bit QLoRA. It is designed to study domain-specialized adaptation under strict compute limits.
Model Details
- Base model: LLaMA 3.2-1B
- Architecture: Decoder-only Transformer
- Fine-tuning: QLoRA (4-bit NF4)
- Training environment: Kaggle (single-GPU)
Datasets
| Dataset | Purpose |
|---|---|
| GSM8K | Grade-school arithmetic reasoning |
| MATH | Competition-level mathematical problems |
Datasets were processed into a plain-text format (no chat template) to match the base model.
Training Procedure
- LoRA adapters inserted into attention and MLP projections
- Mixed math datasets concatenated and split into train/eval
- Optimized for stability on small batch sizes
Intended Use
- Math reasoning benchmarks
- Research on small-model specialization
- Educational demonstrations of QLoRA fine-tuning
Out-of-Scope Uses
- General chat or instruction following
- Safety-critical or production systems
Known Limitations
- Struggles with long proofs and symbolic manipulation
- Sensitive to prompt phrasing
- No RLHF or instruction tuning applied
Ethical Considerations
This model inherits biases and limitations from its base model and training data.
Acknowledgements
- LLaMA (Meta)
- GSM8K (OpenAI)
- MATH (fdyrd/MATH)
- Downloads last month
- 3