Instructions to use BidyutSaha/bn-math-teacher with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use BidyutSaha/bn-math-teacher 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 BidyutSaha/bn-math-teacher:Q4_K_M # Run inference directly in the terminal: llama cli -hf BidyutSaha/bn-math-teacher:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf BidyutSaha/bn-math-teacher:Q4_K_M # Run inference directly in the terminal: llama cli -hf BidyutSaha/bn-math-teacher: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 BidyutSaha/bn-math-teacher:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf BidyutSaha/bn-math-teacher: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 BidyutSaha/bn-math-teacher:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf BidyutSaha/bn-math-teacher:Q4_K_M
Use Docker
docker model run hf.co/BidyutSaha/bn-math-teacher:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use BidyutSaha/bn-math-teacher with Ollama:
ollama run hf.co/BidyutSaha/bn-math-teacher:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use BidyutSaha/bn-math-teacher with Docker Model Runner:
docker model run hf.co/BidyutSaha/bn-math-teacher:Q4_K_M
- Lemonade
How to use BidyutSaha/bn-math-teacher with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull BidyutSaha/bn-math-teacher:Q4_K_M
Run and chat with the model
lemonade run user.bn-math-teacher-Q4_K_M
List all available models
lemonade list
- Atomic Chat
bn-math-teacher — Bengali Class-7 Math Teacher (GGUF)
Small language models fine-tuned to act as a patient, step-by-step Bengali math teacher for Class-7 (সপ্তম শ্রেণি) students. Built with machine-verified training data (every number computed in Python), intended for local, offline deployment — phones (PocketPal), Ollama, llama.cpp, or LM Studio. This repo contains ready-to-use GGUF files.
| File | Size | Status |
|---|---|---|
qwen2.5-1.5b-instruct-bn-math-v2.Q4_K_M.gguf |
941 MB | ⭐ Recommended |
llama-3.2-1b-bn-math-v2.Q4_K_M.gguf |
~750 MB | smallest reliable (1B) |
gemma-3-1b-bn-math-v2.Q4_K_M.gguf |
769 MB | experimental (see note) |
All files are fully self-contained: tokenizer, chat template, and metadata are embedded. Only the system prompt must be set by you (below).
Performance (measured, out-of-distribution questions)
| Model | Fresh questions (single sample) | 16-question regression (3-sample majority vote) | In-distribution reproduction (300 records) |
|---|---|---|---|
| Qwen 2.5 1.5B + v2 | 5/6 | 15/16 | 94.3% (bf16) / 84% (q4) |
| Llama 3.2 1B + v2 | 5/6 | 14/16 | best validation loss in the project |
| Gemma 3 1B + v2 | 4/6 | 13/16 | — |
Untrained base models score 0–4/20 on the same questions.
Required system prompt
Copy this exact text into your app's system-prompt field (PocketPal:
model settings; Ollama: Modelfile SYSTEM; LM Studio: system prompt box):
তুমি একজন ধৈর্যশীল ও নির্ভরযোগ্য গণিত শিক্ষক। শিক্ষার্থীর প্রশ্ন ও বোঝার স্তর অনুযায়ী সহজ বাংলায় শেখাও। প্রয়োজনমতো ধারণা, উদাহরণ ও সমাধানের ধাপ ব্যাখ্যা করো। সন্দেহ বা ভুলের কারণ বুঝিয়ে দাও; না বুঝলে অন্যভাবে বোঝাও। প্রশ্ন পরিষ্কার হলে সরাসরি উত্তর দাও। প্রয়োজনীয় তথ্য না থাকলে জানতে চাও। প্রতিটি উত্তরের শেষে প্রশ্ন করা বাধ্যতামূলক নয়।
The model answers in Bengali, using Bengali numerals (১২, ৩০০ …).
Quick start
PocketPal (Android / iOS): Models → "+" → Add from URL → paste this repo's page URL → pick the Qwen file → set the system prompt above → temperature 0.4. Runs fully offline; a modern phone gives ~5–15 tok/s.
Ollama:
FROM ./qwen2.5-1.5b-instruct-bn-math-v2.Q4_K_M.gguf
SYSTEM """তুমি একজন ধৈর্যশীল ও নির্ভরযোগ্য গণিত শিক্ষক। শিক্ষার্থীর প্রশ্ন ও বোঝার স্তর অনুযায়ী সহজ বাংলায় শেখাও। প্রয়োজনমতো ধারণা, উদাহরণ ও সমাধানের ধাপ ব্যাখ্যা করো। সন্দেহ বা ভুলের কারণ বুঝিয়ে দাও; না বুঝলে অন্যভাবে বোঝাও। প্রশ্ন পরিষ্কার হলে সরাসরি উত্তর দাও। প্রয়োজনীয় তথ্য না থাকলে জানতে চাও। প্রতিটি উত্তরের শেষে প্রশ্ন করা বাধ্যতামূলক নয়।"""
PARAMETER temperature 0.4
ollama create bn-math-teacher -f Modelfile
ollama run bn-math-teacher
llama.cpp: any llama.cpp client; pass the system prompt with --system.
Example questions: "১২টি খাতার দাম ৯৬ টাকা হলে ২০টি খাতার দাম কত?"
Chat templates
The correct template is embedded in each GGUF (tokenizer.chat_template) and
detected automatically by llama.cpp / Ollama / PocketPal — you normally don't
configure anything. For reference:
| Model | Template | System role |
|---|---|---|
| Qwen | ChatML — <|im_start|>system/user/assistant + <|im_end|> |
native system turn |
| Llama 3.2 | Llama — <|begin_of_text|> + <|start_header_id|>system…<|end_header_id|> + <|eot_id|> |
native system turn |
| Gemma 3 | Gemma — <start_of_turn>user/model<end_of_turn> |
no system turn — the template prepends the system text to the first user message |
Consequence for Gemma: if your app's system-prompt handling doesn't trigger the template's system branch, paste the teacher instruction at the start of your first question instead.
Recommended settings
| Parameter | Value |
|---|---|
| Temperature | 0.4 |
| Top-p | 0.9 |
| Context | 4096 (file supports 32768) |
| Max new tokens | ~500 |
| System prompt | the text above — always set it |
Question scope
Trained on 21 template families across 12 topic groups of the Class-7 Bengali syllabus: ratio & proportion, percentage, profit & loss, unit price, distance–speed–time, mixture, average, and more. Within these families the model is reliable (especially with 3-sample majority voting); outside them it is an honest prototype, not an open-domain tutor. Arithmetic answers are deterministic only for the calculator-augmented tool variant (not in this repo).
Notes & limitations
- Qwen GGUF: tested and solid on llama.cpp.
- Llama GGUF: converted with llama.cpp tooling from the merged model; runtime-tested on llama.cpp — correct step-by-step Bengali answers at ~35 tok/s on CPU.
- Gemma GGUF: exported for mobile testing. Our desktop llama.cpp build produced degenerate Gemma output; PocketPal's build differs and is untested. If the Gemma file misbehaves, use the Qwen file.
- 1B–1.5B models keep small arithmetic slips — use temp 0.4 + majority voting in production.
- Board alignment (WB/CISCE/CBSE) is unverified; evaluation is 16–20 hand-authored questions plus 300 held-out records, not a benchmark.
Training
Fine-tuned with Unsloth (LoRA, rank 16) on ~51k machine-verified Bengali
exercises (combined_v2) — every answer computed programmatically so numbers
in the training data are correct by construction. Base models:
Qwen/Qwen2.5-1.5B-Instruct (Apache-2.0) and google/gemma-3-1b-it
(Gemma license terms apply to the Gemma file). Best checkpoints picked by
validation loss; epochs 1–2 (more epochs degrade on this data).
- Downloads last month
- -
4-bit