Instructions to use Sabbir505/Ling-3.0-tiny-math-sft-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Sabbir505/Ling-3.0-tiny-math-sft-v1 with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Sabbir505/Ling-3.0-tiny-math-sft-v1 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M # Run inference directly in the terminal: llama cli -hf Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M # Run inference directly in the terminal: llama cli -hf Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M
Use Docker
docker model run hf.co/Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Sabbir505/Ling-3.0-tiny-math-sft-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sabbir505/Ling-3.0-tiny-math-sft-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sabbir505/Ling-3.0-tiny-math-sft-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M
- Ollama
How to use Sabbir505/Ling-3.0-tiny-math-sft-v1 with Ollama:
ollama run hf.co/Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M
- Unsloth Desktop
- Pi
How to use Sabbir505/Ling-3.0-tiny-math-sft-v1 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Sabbir505/Ling-3.0-tiny-math-sft-v1 with Docker Model Runner:
docker model run hf.co/Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M
- Lemonade
How to use Sabbir505/Ling-3.0-tiny-math-sft-v1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M
Run and chat with the model
lemonade run user.Ling-3.0-tiny-math-sft-v1-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Sabbir505/Ling-3.0-tiny-math-sft-v1 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Sabbir505/Ling-3.0-tiny-math-sft-v1 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Sabbir505/Ling-3.0-tiny-math-sft-v1:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Ling-3.0-tiny · Math-SFT (QLoRA fine-tune)
A QLoRA fine-tune of inclusionAI/Ling-3.0-tiny (7.9B-parameter MoE, ~1.3B active per token, hybrid KDA linear-attention + MLA architecture), trained to improve math reasoning and instruction-following on consumer-scale hardware.
This is work in progress. We plan to fine-tune it further — a larger and more math-heavy mixture, longer training, and additional post-training (preference/RL) stages — to achieve better results. Expect this repo to be updated.
Benchmark results
All probes use identical data, seeds, and extraction before and after training (100-question MMLU and GSM8K subsets, 50-prompt IFEval-lite with verifiable constraints). Numbers are not leaderboard-comparable; they are controlled A/B measurements of this fine-tune.
| Probe | Base | Fine-tuned | Δ |
|---|---|---|---|
| MMLU-100 (knowledge, loglikelihood) | 58.0% | 59.0% | +1.0 |
| GSM8K-100 (math, no-think) | 5.0% | 27.0% | +22.0 |
| IFEval-lite-50 (instruction following) | 44.0% | 44.0% | 0.0 |
| GSM8K-30 (think-mode, supplementary) | — | 23.3% | new capability |
- The GSM8K gain (+22 points, >5×) is the headline result: the model learned to actually solve grade-school math instead of failing almost uniformly.
- MMLU unchanged confirms no catastrophic forgetting of general knowledge.
- The think-mode supplementary eval (GSM8K-30,
enable_thinking=True, answer extracted from\boxed{}/####) shows the model adopted the chain-of-thought format it was trained on; 23.3% on a 30-question subset is consistent with the no-think 27% given the small sample. - IFEval-lite unchanged: instruction-following was already the model's strongest area and 475 IF examples in the mix were not enough to move it. A future run uses a heavier IF share.
Training details
| Method | QLoRA (4-bit NF4 base, bf16 compute) |
| LoRA | r=16, alpha=32, dropout 0.05, all attention + MLP projections (MoE experts included, router frozen) |
| Trainable params | 296,091,648 (3.62% of 8.19B) |
| Data | 2,000 verified examples: 1,210 everyday conversations (smoltalk2/smollm3), 475 instruction-following (Tulu-3 SFT personas), 475 math reasoning with chain-of-thought (OpenThoughts-114k) |
| Sequence length | 384 tokens, no packing |
| Optimization | lr 5e-5 cosine, 60 warmup steps, effective batch 8, 1 epoch (246 steps), paged AdamW 8-bit |
| Hardware / time | 1× RTX 4090 D, ~4.7 hours |
The data was rendered through Ling-3.0's native chat template, preserving its
hybrid thinking-mode design: everyday/IF examples use detailed thinking off,
math examples use detailed thinking on with real chain-of-thought targets.
Files
| File | Size | Use |
|---|---|---|
ling30tiny-ft-Q4_K_M.gguf |
~4.7 GB | recommended for local inference |
ling30tiny-ft-Q8_0.gguf |
~8.4 GB | near-lossless |
ling30tiny-ft-Q2_K.gguf |
~3.1 GB | ultra-compact |
merged-ft-f16.gguf |
~15.8 GB | full-precision merged model |
adapter/ |
~600 MB | raw LoRA adapter (apply to the base model) |
benchmarks/ |
— | raw before/after benchmark JSONs |
Usage
llama.cpp (GGUF)
llama-server -m ling30tiny-ft-Q4_K_M.gguf --port 8080
# or
llama-cli -m ling30tiny-ft-Q4_K_M.gguf -p "Solve: Natalia sold clips to 48 friends in April and half as many in May. How many altogether?"
For math, wrap the prompt with the model's thinking-mode system prompt
(detailed thinking on) or rely on the chat template's enable_thinking flag —
the model was trained to reason in <think>...</think> blocks on math problems.
transformers + PEFT (adapter)
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
tok = AutoTokenizer.from_pretrained("inclusionAI/Ling-3.0-tiny", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
"inclusionAI/Ling-3.0-tiny", torch_dtype=torch.bfloat16,
device_map="auto", trust_remote_code=True)
model = PeftModel.from_pretrained(model, "Sabbir505/Ling-3.0-tiny-math-sft-v1", subfolder="adapter")
Honest limitations
- Trained on a deliberately small (2,000-example), single-epoch run on free/consumer hardware; the gains are real but the model is far from its ceiling.
- The IFEval-lite checker is a simplified subset of the official harness; absolute numbers are not comparable to published IFEval scores, only the before/after delta.
- GSM8K answers were extracted via
#### N/ last-number fallback; the think-mode supplementary eval used\boxed{}/####on a 30-question subset. - In no-think mode the model can be verbose on math prompts (it defaults to think-style reasoning it learned); thinking-mode prompting produces cleaner outputs.
Roadmap
- Larger, more math-heavy mixture (5–10k reasoning examples)
- 2–3 epoch training with evaluation-gated checkpoints
- Longer sequence length (1024+) for full chain-of-thought targets
- Instruction-following heavy rebalance to lift IFEval
- Preference optimization (DPO) on top of this SFT stage
Acknowledgments
Base model by inclusionAI (Apache-2.0). Data from HuggingFaceTB smoltalk2 (Apache-2.0), AI2 Tulu-3 SFT personas (ODC-BY), and OpenThoughts (Apache-2.0). Trained with transformers 4.57.6 + TRL 1.13.0 + PEFT + bitsandbytes + flash-linear-attention.
- Downloads last month
- 143
2-bit
4-bit
8-bit
Model tree for Sabbir505/Ling-3.0-tiny-math-sft-v1
Base model
inclusionAI/Ling-3.0-tiny