Turhan123/astra-meal-parser-gguf
🥗 Astra Meal Parser — GGUF
Quantized GGUF builds of a meal-parsing model that reads a free-text meal description in Turkish or English and returns a structured list of food items and their amounts. The model only parses; calories and macros are computed downstream from a nutrition table + calculator (see the full model card for the design).
Available files
The 1.5B build is the recommended one: it is roughly twice as fast on CPU and matches or exceeds the 3B build in accuracy while covering a larger food set.
Evaluation (1.5B)
Held-out set of 149 meal descriptions (TR / EN / mixed), zero overlap with training. Parsing scores the model output; nutrition metrics reflect the full pipeline (parser + 144-food nutrition table + calculator).
Calorie MAPE by language: Turkish 2.2%, English 1.6%, Mixed 1.1%.
Output format
{"items": [{"name": "string", "amount": "string"}]}No prose, no markdown, no macros.
System prompt
You are a meal parser. Extract every food item and its amount from the user's meal
description (Turkish or English). Return ONLY a strict JSON object of the form
{"items": [{"name": string, "amount": string}]}. No macros, no calories, no
conversational text, no markdown, only valid JSON.Usage
Ollama
FROM ./astra-meal-parser-1.5b-q4_k_m.gguf
TEMPLATE """{{ if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}{{ if .Prompt }}<|im_start|>user
{{ .Prompt }}<|im_end|>
{{ end }}<|im_start|>assistant
{{ .Response }}<|im_end|>
"""
SYSTEM """You are a meal parser. Extract every food item and its amount from the user's meal description (Turkish or English). Return ONLY a strict JSON object of the form {"items": [{"name": string, "amount": string}]}. No macros, no calories, no conversational text, no markdown, only valid JSON."""
PARAMETER temperature 0
PARAMETER stop "<|im_end|>"ollama create astra-parser -f Modelfile
ollama run astra-parser "2 yumurta, 100g tavuk göğsü ve 1 muz"llama.cpp
huggingface-cli download Turhan123/astra-meal-parser-gguf \
astra-meal-parser-1.5b-q4_k_m.gguf --local-dir .
llama-server -m astra-meal-parser-1.5b-q4_k_m.gguf -c 2048llama-cpp-python
from llama_cpp import Llama
llm = Llama(model_path="astra-meal-parser-1.5b-q4_k_m.gguf", n_ctx=2048, chat_format="chatml")
SYSTEM = (
"You are a meal parser. Extract every food item and its amount from the user's "
"meal description (Turkish or English). Return ONLY a strict JSON object of the form "
'{"items": [{"name": string, "amount": string}]}. '
"No macros, no calories, no conversational text, no markdown, only valid JSON."
)
out = llm.create_chat_completion(
messages=[{"role": "system", "content": SYSTEM},
{"role": "user", "content": "2 yumurta, 100g tavuk göğsü ve 1 muz"}],
temperature=0, max_tokens=256, stop=["<|im_end|>"],
)
print(out["choices"][0]["message"]["content"])Limitations
Parsing only — calorie/macro accuracy depends on the accompanying nutrition table and calculator. Vague portions are resolved with default serving sizes. See the full model card for the complete list.
License
- 1.5B build (recommended): derived from Qwen2.5-1.5B-Instruct, Apache 2.0.
- 3B build (legacy): derived from Qwen2.5-3B-Instruct, subject to the Qwen Research License.
