SuperMart SLM
a language model for retail analytics
2 min readupdated
SuperMart SLM is a compact 340M-parameter language model trained from scratch on supermarket transaction data and retail research papers. Built on the Qwen3 architecture, it is designed to answer analytical questions about a specific shopping dataset. While the model handles facts from its training set well, it is not meant for real-world financial decisions. It is a solid fit for exploring what tiny, locally run models can do.
Key features
- Qwen3 architecture with 12 layers and a 768 hidden size
- Trained from scratch in three stages on local data using a single RTX 4050
- Specializes in answering questions about sales, products, receipts, and discounts
- Available in Hugging Face transformers format and as a GGUF file for Ollama
What you can do
- Run the model locally via Ollama using the ready-made Modelfile configuration
- Integrate the model into Python scripts with the transformers library to answer retail questions
- Study how small models behave when trained on narrow, domain-specific datasets
Example
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("nandangowda/supermart-slm")
model = AutoModelForCausalLM.from_pretrained("nandangowda/supermart-slm")
system = "You are SuperMart SLM, a small language model trained from scratch to answer questions about supermarket retail analytics..."
msgs = [{"role": "system", "content": system},
{"role": "user", "content": "What is the average basket size?"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True)["input_ids"]
out = model.generate(ids, max_new_tokens=128, do_sample=False)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
Read more
DetailsParameters: 339.6M
Context length: 512 tokens
Training: pretraining from scratch, text fine-tuning, and chat fine-tuning took about 7 hours on an RTX 4050 Laptop GPU (6 GB VRAM)
Limitations: memorizes training facts well, but generalizes poorly to new data










Comments