Instructions to use nandangowda/supermart-slm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nandangowda/supermart-slm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nandangowda/supermart-slm")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nandangowda/supermart-slm", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use nandangowda/supermart-slm 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 nandangowda/supermart-slm:Q8_0 # Run inference directly in the terminal: llama cli -hf nandangowda/supermart-slm:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf nandangowda/supermart-slm:Q8_0 # Run inference directly in the terminal: llama cli -hf nandangowda/supermart-slm:Q8_0
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf nandangowda/supermart-slm:Q8_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf nandangowda/supermart-slm:Q8_0
Use Docker
docker model run hf.co/nandangowda/supermart-slm:Q8_0
- Llama new
- LM Studio
- Jan
- vLLM
How to use nandangowda/supermart-slm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nandangowda/supermart-slm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nandangowda/supermart-slm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nandangowda/supermart-slm:Q8_0
- SGLang
How to use nandangowda/supermart-slm 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 "nandangowda/supermart-slm" \ --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": "nandangowda/supermart-slm", "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 "nandangowda/supermart-slm" \ --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": "nandangowda/supermart-slm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use nandangowda/supermart-slm with Ollama:
ollama run hf.co/nandangowda/supermart-slm:Q8_0
- Unsloth Desktop
- Docker Model Runner
How to use nandangowda/supermart-slm with Docker Model Runner:
docker model run hf.co/nandangowda/supermart-slm:Q8_0
- Lemonade
How to use nandangowda/supermart-slm with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull nandangowda/supermart-slm:Q8_0
Run and chat with the model
lemonade run user.supermart-slm-Q8_0
List all available models
lemonade list
- Atomic Chat
SuperMart SLM
A 340M-parameter Qwen3-architecture language model trained from scratch (no pretrained weights) on supermarket transaction data and retail research papers. It answers retail-analytics questions about a 2.6M-line supermarket transaction dataset. Built for the AIML-C Design Thinking project.
Repository layout
The repository has two folders:
| Folder | Contents |
|---|---|
model/ |
everything needed to use the model |
notebook/ |
the Jupyter notebooks that build the model |
README.md (this card), LICENSE and .gitattributes stay at the top level because Hugging Face requires them there.
model/
| File | Use |
|---|---|
model.safetensors, config.json, generation_config.json |
π€ transformers (Qwen3ForCausalLM, float32) |
tokenizer.json, tokenizer_config.json, chat_template.jinja |
Qwen3 BPE tokenizer + ChatML chat template |
supermart-slm-q8_0.gguf |
Ollama / llama.cpp (Q8_0, 367 MB) |
Modelfile |
Ollama import: ChatML template, system prompt, stop tokens |
notebook/
| File | What it is |
|---|---|
6_supermart_slm_end_to_end.ipynb |
main notebook β the complete pipeline with all code inline: data cleaning, dataset build, statistics, train/val/test files, tokenizer, model, 3-stage training, evaluation, export, GGUF, Ollama, question test, browser chat |
6_supermart_slm_end_to_end_training_run_2026-11-18.ipynb |
the executed training run (18 Nov 2026, RTX 4050 Laptop, ~7 h) with every live training log line |
5_slm_from_scratch_qwen.ipynb |
first experiment: Qwen3 SLM on TinyStories |
requirements.txt |
Python packages needed to run the notebooks |
Architecture
| Type | decoder-only transformer, Qwen3 layout |
| Layers / hidden / FFN | 12 / 768 / 3072 (SwiGLU) |
| Attention | grouped-query, 12 query heads / 6 KV heads, head dim 64, QK-RMSNorm, RoPE ΞΈ = 10,000 |
| Vocabulary | Qwen3 BPE, 151,936 |
| Context | 512 tokens |
| Parameters | 339.6M (untied embedding and LM head) |
Training (only our own data, single RTX 4050 Laptop GPU, 6 GB)
| Stage | Data | Steps | Final train loss | Final val loss |
|---|---|---|---|---|
| A β pre-training from scratch | 262,659 supermarket baskets written as text (90M-token corpus; 4,000 steps β 33M tokens seen) | 4,000 | 0.455 | 0.529 |
| B β domain pre-training | 11 cleaned retail research papers + glossary + data insights | 800 | 1.317 | 6.635 (best 5.766) |
| C β chat fine-tuning (ChatML, loss on answers only) | 452 Q&A conversations, 223 facts computed from the data | 800 | 0.011 | 2.871 (best 1.927) |
AdamW 8-bit (Ξ² 0.9/0.95, wd 0.1), linear warm-up + cosine decay, bf16 autocast with fp32 master weights, gradient checkpointing. About 7 hours in total. The final checkpoint of stage C is published.
Evaluation
| Metric | Value |
|---|---|
| Stage A validation perplexity (13,825 held-out baskets) | 1.7 |
| Numeric fact recall, questions seen in training (sample of 50) | 95.3 % |
| Numeric fact recall, never-seen questions (67 held-out conversations) | 4.8 % |
Numeric fact recall = share of the numbers in the reference answer that the model reproduces (greedy decoding). The model memorises its training facts almost perfectly but does not generalise to new facts.
Use with Ollama
hf download nandangowda/supermart-slm model/supermart-slm-q8_0.gguf model/Modelfile --local-dir supermart-slm
cd supermart-slm/model
ollama create supermart-slm -f Modelfile
ollama run supermart-slm "Which departments generate the most sales?"
Use with transformers
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("nandangowda/supermart-slm", subfolder="model")
model = AutoModelForCausalLM.from_pretrained("nandangowda/supermart-slm", subfolder="model")
system = "You are SuperMart SLM, a small language model trained from scratch to answer questions about supermarket retail analytics: sales, products, departments, discounts, baskets, customer demographics, gross margin, pricing, payment methods and tax. Answer concisely and use the numbers from the SuperMart transaction dataset when relevant."
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))
Example
Q: What time of day do customers shop the most? A: Sales peak at 17:00-18:00 (10.3% of daily sales). The morning (6-12) brings 16.1%, afternoon (12-17) brings 40.7%, evening (17-22) brings 38.1% of sales.
Limitations
A small model trained from scratch on a narrow domain. It reproduces the facts it was fine-tuned on exactly, but invents confident wrong answers for questions outside them (held-out validation facts are not recalled). Not for real business or financial decisions.
- Downloads last month
- 431
8-bit