Instructions to use udgamlabs/Lilavati-GGUF 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 udgamlabs/Lilavati-GGUF 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 udgamlabs/Lilavati-GGUF:Q8_0 # Run inference directly in the terminal: llama cli -hf udgamlabs/Lilavati-GGUF:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf udgamlabs/Lilavati-GGUF:Q8_0 # Run inference directly in the terminal: llama cli -hf udgamlabs/Lilavati-GGUF: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 udgamlabs/Lilavati-GGUF:Q8_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf udgamlabs/Lilavati-GGUF:Q8_0
Use Docker
docker model run hf.co/udgamlabs/Lilavati-GGUF:Q8_0
- Llama new
- LM Studio
- Jan
- vLLM
How to use udgamlabs/Lilavati-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "udgamlabs/Lilavati-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "udgamlabs/Lilavati-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/udgamlabs/Lilavati-GGUF:Q8_0
- Ollama
How to use udgamlabs/Lilavati-GGUF with Ollama:
ollama run hf.co/udgamlabs/Lilavati-GGUF:Q8_0
- Unsloth Desktop
- Docker Model Runner
How to use udgamlabs/Lilavati-GGUF with Docker Model Runner:
docker model run hf.co/udgamlabs/Lilavati-GGUF:Q8_0
- Lemonade
How to use udgamlabs/Lilavati-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull udgamlabs/Lilavati-GGUF:Q8_0
Run and chat with the model
lemonade run user.Lilavati-GGUF-Q8_0
List all available models
lemonade list
- Atomic Chat
UDGAM LABS · Maths model · 95M parameters, with a 95M checker · GGUF
Lilavati-GGUF
Lilavati solves maths word problems by writing a short Python program and running it. Lilavati-Checker rates each program, so that several tries can vote. Both are 95M-parameter models trained from scratch. This repository holds both as GGUF files, for llama.cpp and for running in a web browser. Results, data and limits are on the Lilavati model card.
| File | Size | Use |
|---|---|---|
Lilavati-Q8_0.gguf |
102 MB | writes the programs |
Lilavati-Checker-Q8_0.gguf |
102 MB | gives each program a probability of being correct |
Quick start
Try it in your browser: udgamlabs.com/models/lilavati. Everything runs on your device.
llama.cpp: Lilavati continues this prompt with a Python function and closes it with three backticks.
llama-completion --hf-repo udgamlabs/Lilavati-GGUF --hf-file Lilavati-Q8_0.gguf -no-cnv --temp 0 -n 320 -r '```' \
-p $'Question: A shop sells pencils at 8 rupees each. Riya buys 6 pencils and pays with a 100 rupee note. How much change does she get?\nAnswer (Python):\n```python\n'
Run the program only inside a sandbox. The lilavati package checks and runs
every program for you (lilavati/safe_exec.py).
The checker reads the question, the program and its result, and answers yes or no:
Question: {question}
Answer (Python):
```python
{program}
```
Result: {value, or "error"}
Correct:
Its probability of " yes" divided by the sum of " yes" and " no" is the program's score. Several tries vote with these scores, which is how the model card's 8-try and 48-try numbers are made.
In your own web page: use wllama, which is llama.cpp compiled to WebAssembly.
- Load both files. wllama adds the
<bos>token itself, so send the prompts above as they are. - Run each program in Pyodide inside a Web Worker, after the structure check from
safe_exec.py, with a time limit. - wllama reports probabilities only for the top
n_probstokens. Ask for about 300 so that both " yes" and " no" are included. - The udgamlabs.com page does all of this. Its code is public:
/models/lilavati/lilavati-solve.js.
How these files were made and checked
- Converted from the released safetensors with llama.cpp's
convert_hf_to_gguf.py(commitd7a695e),--outtype q8_0. The weights are only rounded to 8 bits; nothing else changed. - Checked against the released Python package (transformers, float32, CPU) on 28 October 2026, on the first 100
GSM8K test questions [measured by us]:
- One greedy program per question:
- all 100 programs written in the browser (wllama 3.6.1, Chrome) are identical to native llama.cpp on these files;
- 86 of 100 are identical to the float32 model's, and 95 of 100 give the same answer (59 vs 60 correct). The rest come from 8-bit rounding.
- The checker: on 96 programs sampled by the float32 model (12 questions × 8), its probabilities are within 0.036 of the float32 checker's (median difference 0.0005). The checker-weighted vote picks the same answer on 12 of 12.
- One greedy program per question:
- Ollama and LM Studio were not tested.
SHA-256:
3d069ab0c3cd44c3df02dfa07a160c04468ab0c332b188753a3f5402104c4323 Lilavati-Q8_0.gguf
598b5c68de07e8438d6f746aea830a043755af2b3792158fd6ab86b0230eae2b Lilavati-Checker-Q8_0.gguf
Where it falls short
These files are 8-bit versions of the released models, with the same strengths and weaknesses; see the model card. In short: it is good at grade-school word problems. It is weak at:
- numbers that should be ignored;
- working backwards;
- unit conversions;
- questions that have no answer (it always returns a number).
It is not a chatbot.
Licence
Apache-2.0, like the original models.
Citation
@misc{lilavati2026,
title = {Lilavati: a 95M pocket mathematician that solves word problems by writing Python},
author = {Udgam Labs},
year = {2026},
url = {https://huggingface.co/udgamlabs/Lilavati}
}
About Udgam Labs. Udgam Labs is an independent AI research lab. We work from first principles: before we build, we understand why things work, whether we are training a model, fine-tuning one or applying AI to a new problem. Udgam (उद्गम) is Sanskrit for origin. udgamlabs.com
- Downloads last month
- 118
8-bit
Model tree for udgamlabs/Lilavati-GGUF
Base model
udgamlabs/Lilavati