How to use from the
Use from the
llama-cpp-python library
# !pip install llama-cpp-python

from llama_cpp import Llama

llm = Llama.from_pretrained(
	repo_id="Turhan123/astra-meal-parser-gguf",
	filename="",
)
llm.create_chat_completion(
	messages = [
		{
			"role": "user",
			"content": "What is the capital of France?"
		}
	]
)

🥗 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

File Base Size License Notes
astra-meal-parser-1.5b-q4_k_m.gguf Qwen2.5-1.5B ~1.0 GB Apache 2.0 Recommended / deployed — faster on CPU, trained on the expanded dataset
astra-meal-parser-q4_k_m.gguf Qwen2.5-3B ~1.9 GB Qwen Research Legacy / archive

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).

Metric Value
Item Precision / Recall / F1 100% / 99% / 99%
Parse failures 0 / 149
Calorie MAPE 1.9%
Protein / Carbs / Fat MAE 0.3 g / 1.0 g / 0.3 g

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 2048

llama-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

Downloads last month
195
GGUF
Model size
2B params
Architecture
qwen2
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Turhan123/astra-meal-parser-gguf

Quantized
(223)
this model