Text Generation
Transformers
Safetensors
Swahili
swahili
mathematics
education
lora
qlora
conversational
Instructions to use Japhari/sdt-gm4-hesabu-flare-v0.01 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Japhari/sdt-gm4-hesabu-flare-v0.01 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Japhari/sdt-gm4-hesabu-flare-v0.01") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Japhari/sdt-gm4-hesabu-flare-v0.01", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Japhari/sdt-gm4-hesabu-flare-v0.01 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Japhari/sdt-gm4-hesabu-flare-v0.01" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Japhari/sdt-gm4-hesabu-flare-v0.01", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Japhari/sdt-gm4-hesabu-flare-v0.01
- SGLang
How to use Japhari/sdt-gm4-hesabu-flare-v0.01 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 "Japhari/sdt-gm4-hesabu-flare-v0.01" \ --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": "Japhari/sdt-gm4-hesabu-flare-v0.01", "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 "Japhari/sdt-gm4-hesabu-flare-v0.01" \ --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": "Japhari/sdt-gm4-hesabu-flare-v0.01", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Japhari/sdt-gm4-hesabu-flare-v0.01 with Docker Model Runner:
docker model run hf.co/Japhari/sdt-gm4-hesabu-flare-v0.01
sdt-gm4-hesabu-flare-v0.01
Swahili math-assistant LoRA adapter focused on primary-school arithmetic and word problems.
Model details
- Model name:
sdt-gm4-hesabu-flare-v0.01 - Base model:
unsloth/gemma-3-4b-it-unsloth-bnb-4bit - Fine-tuning approach: QLoRA / LoRA adapter fine-tuning
- Primary language: Swahili
- Target domain: School-level mathematics tutoring
Training data
This model was trained with supervised chat-style examples from:
- SFT train/validation splits (
train.jsonl,val.jsonl) - Arithmetic booster set (
math_booster.jsonl)
Associated dataset repo:
Japhari/sdt-gm4-hesabu-flare-v0.01-dataset
Intended use
- Swahili math Q&A assistance
- Educational demos and experimentation
- Baseline model for further instruction tuning
Limitations
- May still hallucinate on complex multi-step reasoning
- Performance degrades on prompts missing key quantities
- Not suitable as sole source for high-stakes grading/financial decisions
Safety notes
For production or assessment workflows, use deterministic validation/guardrails for arithmetic final answers.
Inference example (Transformers + PEFT)
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = "unsloth/gemma-3-4b-it-unsloth-bnb-4bit"
adapter_repo = "Japhari/sdt-gm4-hesabu-flare-v0.01"
tokenizer = AutoTokenizer.from_pretrained(adapter_repo)
model = AutoModelForCausalLM.from_pretrained(base_model, device_map="auto")
model = PeftModel.from_pretrained(model, adapter_repo)
prompt = "Mara 8 kwa 7 ni ngapi?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=64)
print(tokenizer.decode(out[0], skip_special_tokens=True))
Version
v0.01– initial release
Model tree for Japhari/sdt-gm4-hesabu-flare-v0.01
Base model
google/gemma-3-4b-pt Finetuned
google/gemma-3-4b-it Quantized
unsloth/gemma-3-4b-it-unsloth-bnb-4bit