Views
No views yet
| Base model | Subfolder | Params | Best on-device pick |
|---|---|---|---|
unsloth/gemma-3-270m-it | gemma-3-270m/ | 270M | Q5_K_M (260 MB, 99.7% schema) |
HuggingFaceTB/SmolLM2-360M-Instruct | smollm2-360m/ | 360M | Q4_K_M (271 MB, 100% schema) |
Qwen/Qwen3-0.6B | qwen3-0.6b/ | 600M | Q4_K_M (397 MB, 100% schema, best exact match) |
<short>/
├── adapters/ # PEFT LoRA adapter (load on top of base)
│ ├── adapter_config.json
│ └── adapter_model.safetensors
├── gguf/ # 5 merged quantizations, ship-ready
│ ├── txn-parser-<short>-F16.gguf
│ ├── txn-parser-<short>-Q8_0.gguf
│ ├── txn-parser-<short>-Q6_K.gguf
│ ├── txn-parser-<short>-Q5_K_M.gguf
│ └── txn-parser-<short>-Q4_K_M.gguf
└── README.md # model card with the exact SYSTEM_PROMPT| Model | Quant | Size | JSON valid | Schema valid | Exact match | Amount exact | Mean ms |
|---|---|---|---|---|---|---|---|
| gemma-3-270m | Q5_K_M | 260 MB | 99.7% | 99.7% | 51.0% | 84.7% | 1788 |
| gemma-3-270m | Q4_K_M | 253 MB | 93.3% | 93.3% | 48.3% | 80.7% | 2660 |
| smollm2-360m | Q5_K_M | 290 MB | 100.0% | 100.0% | 52.7% | 89.0% | 996 |
| smollm2-360m | Q4_K_M | 271 MB | 100.0% | 100.0% | 53.3% | 87.3% | 978 |
| qwen3-0.6b | Q5_K_M | 444 MB | 100.0% | 100.0% | 60.0% | 91.3% | 857 |
| qwen3-0.6b | Q4_K_M | 397 MB | 100.0% | 100.0% | 60.0% | 90.7% | 885 |
eval_results/REPORT.md.)qwen3-0.6b-Q4_K_M (397 MB, 60% exact, ~885 ms)smollm2-360m-Q4_K_M (271 MB, 53% exact, ~978 ms)qwen3-0.6b-Q8_0 (639 MB, 59% exact, ~851 ms)gemma-3-270m-Q4_K_M — quality cliff vs Q5_K_M (93% → 99.7% schema)1# Just one quant of one model (small)
2huggingface-cli download kartikey31/txn-parser \
3 smollm2-360m/gguf/txn-parser-smollm2-360m-Q4_K_M.gguf --local-dir .
4
5# Everything (3 models × 5 quants, ~5 GB)
6huggingface-cli download kartikey31/txn-parser --local-dir ./txn-parser1from huggingface_hub import hf_hub_download
2
3gguf = hf_hub_download(
4 "kartikey31/txn-parser",
5 "qwen3-0.6b/gguf/txn-parser-qwen3-0.6b-Q4_K_M.gguf",
6)1from llama_cpp import Llama
2
3# Same SYSTEM_PROMPT for ALL three models — they were trained with it.
4SYSTEM_PROMPT = """You convert voice-transcribed transaction descriptions into structured JSON.
5
6Output ONLY a JSON object with this schema, no other text:
7{"transactions":[{"amount":<number>,"currency":"INR"|"USD","item":"<lowercase singular noun phrase>","category":"<enum>","type":"expense"|"income"}]}
8
9Categories: Food, Drinks, Groceries, Transport, Shopping, Entertainment, Bills, Health, Education, Personal, Gifts, Income, Other.
10
11Rules:
12- Currency defaults to INR. Use USD only when the input explicitly says "dollars" or contains "$".
13- Amounts: "k" = ×1000, "hazaar" = ×1000, "sau" = ×100, "lakh" = ×100000. Convert number-words ("five hundred") to digits.
14- type is "expense" by default; "income" only for explicit salary, cashback, refund, gift received, payment received.
15- For disfluencies and corrections ("500 wait no 600"), output the CORRECTED amount only.
16- For ambiguous items ("that thing", "stuff"), use item "unspecified" and category "Other".
17- Item field: lowercase singular noun phrase ("uber ride", "beer", "chai" — not "Beers" or "Uber").
18- Multi-transaction inputs become multiple array entries in spoken order.
19- Category heuristics: uber/ola/auto/petrol/bus/metro → Transport; beer/wine/chai/coffee/juice → Drinks; rent/electricity/wifi/recharge/gas → Bills; movie/netflix/concert → Entertainment; doctor/medicine/hospital → Health."""
20
21llm = Llama(
22 model_path="txn-parser-qwen3-0.6b-Q4_K_M.gguf",
23 n_gpu_layers=-1, n_ctx=1024,
24)
25out = llm.create_chat_completion(messages=[
26 {"role": "system", "content": SYSTEM_PROMPT},
27 {"role": "user", "content": "200 ka samosa and 50 chai"},
28], temperature=0.0)
29print(out["choices"][0]["message"]["content"])
30# {"transactions":[{"amount":200,"currency":"INR","item":"samosa",...}, ...]}github.com/kartikeychoudhary/txn-parser.1git clone https://github.com/kartikeychoudhary/txn-parser
2cd txn-parser
3bash setup.sh
4python scripts/05_generate_distillation_data.py --phase eval --force-eval-copy
5python scripts/train_and_publish.py # trains gemma, smollm, qwen; publishes here
6python scripts/eval_all_quants.py # regenerates the eval table