Recipe-Tagger

Used in and made for the Recipe Hog app.

Selects zero to five tags from supplied candidates using recipe text. Returns a JSON array of exact candidate names, or [] for insufficient input. Supports a standard vocabulary plus user-supplied tag names. English recipe tagging is the evaluated use case.

Model and training

Derived from LiquidAI/LFM2-700M, revision 86f49fc9a3800c3a325b7320bde179c318062583: 742,489,344 parameters, 16 hybrid layers (10 short-convolution and 6 grouped-query attention), hidden size 1,536.

Supervised recipe/tag fine-tuning used LoRA (rank 16, alpha 32, dropout 0.05, all linear modules; 8,945,664 trainable parameters). The final continuation ran one epoch / 787 updates over 6,290 examples derived from 2,995 training recipes, including candidate-list variations and insufficient-input examples, with a learning rate of 2e-5. The internal collection has curated recipe/tag labels; the underlying recipe dataset is not included in this release.

The adapter was merged, converted with llama.cpp commit 48d22e295e2b86b47366c16390794f3e05ba970a (b10360), then importance-calibrated using 128 training recipes excluding the held-out evaluation recipes. Calibration changes quantization, without additional fine-tuning. Q4_K_M uses mixed tensor precision rather than exactly four bits for every weight.

Property Value
File Recipe-Tagger-Q4_K_M.gguf
Size 468,627,168 bytes (446.9 MiB)
SHA-256 4ef248574038499cab279b25c1bb50240b0a8b2f6f29efa7f93e2cb2398216c2
Runtime tested llama.cpp b10360, greedy decoding, candidate-constrained grammar
Serving configuration tested 8,192-token context, two CPU threads, one request at a time

A small 2 GB Linux server smoke test measured about 849 MiB peak memory for the inference service and roughly 10โ€“14 seconds per request. Memory and latency depend on input, context, runtime, hardware and other services; this is not a load-test guarantee.

Evaluation

52 cases: 50 saved held-out recipe labels, an empty-input check and a custom carrot-cake check. These are comparisons with saved reference labels, not an independent human assessment.

Metric Merged full-precision reference This calibrated Q4_K_M
Exact reference tag sets 20/52 20/52
Tag precision (micro) 80.2% 79.3%
Tag recall (micro) 77.1% 73.3%
Tag F1 (micro) 78.6% 76.2%
Mean recipe F1 81.8% 77.5%
Mean Jaccard 72.9% 69.0%
Valid raw outputs 52/52 51/52

Results use raw outputs before duplicate removal. Invalid outputs receive no predicted tags and zero per-recipe scores; valid empty/empty cases score one. Saved labels can omit reasonable tags, and extra tags reduce these scores. See evaluation.json.

Use

Install llama.cpp b10360 for your platform, then run with Python 3.10+:

python3 predict.py sample-request.json --llama-server /path/to/llama-server

The helper starts a loopback worker, uses the embedded chat template and supplied prompt/vocabulary, validates and deduplicates its output, and stops the worker afterward. No Python ML dependencies are needed. The GGUF includes the tokenizer and chat-template metadata; no separate adapter or Transformers weights are required for this inference package.

Limitations and license

Suggestions can omit defining ingredients or methods, add weakly supported tags, or misinterpret cultural and personal tag names. Quality depends on the candidate list and recipe completeness. Review suggestions before saving. Dietary tags must not be used to establish allergy or food safety. General chat, other languages and adversarial inputs have not been comprehensively evaluated.

Model weights remain subject to the LFM Open License v1.0, including its commercial-use conditions. Our original helper code, configuration and documentation are MIT licensed. See LICENSE for scope and NOTICE for model modifications.

Downloads last month
10
GGUF
Model size
0.7B params
Architecture
lfm2
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 Gobsmacked/Recipe-Tagger

Finetuned
(24)
this model