Token Classification
MLX
Safetensors
English
Hindi
food
nutrition
on-device
information-extraction
entity-linking
Instructions to use sanil08/food-llm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use sanil08/food-llm with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir food-llm sanil08/food-llm
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
food-llm β on-device food-logging models
Companion model weights for jainsanil18/food-llm β a small, local pipeline that turns a free-form food log ("had 2 eggs, a bowl of dahi, paneer and some aloo") into structured nutrition.
text β [0.5B extractor] β constrained decoding β [alias DB β embedder β reranker] β nutrition
What's here
| Artifact | What it is | Base |
|---|---|---|
adapters/adapters.safetensors |
LoRA adapter β extracts {food, qty, unit} from messy text |
Qwen2.5-0.5B-Instruct-4bit (MLX) |
food-static/ |
Fine-tuned static token embeddings (bi-encoder retriever) | Model2Vec potion-base-8M |
food-reranker/ |
Fine-tuned cross-encoder reranker | cross-encoder/ms-marco-MiniLM-L6-v2 |
foods_canonical.json |
The curated food DB β 3,190 foods, ~3,600 aliases, defaults | INDB + FNDDS + USDA SR |
Usage
Clone the code repo and place these weights in adapters/ and models/:
git clone https://github.com/jainsanil18/food-llm && cd food-llm
python3 -m venv .venv && ./.venv/bin/pip install -r requirements.txt
# download these weights into adapters/ and models/
./.venv/bin/python -m scripts.predict "2 eggs and a cup of rice"
Footprint
- 0.5B extractor inference: ~0.5 GB RAM (MLX, transient)
- Reranker / embedder: ~25β90 MB (fallbacks; not always loaded)
- The alias DB resolves most common foods with no model at all
Honest status
Research/prototype. Extraction ~72% exact (in-distribution); constrained decoding keeps emitted food names valid; resolution is a dictionary lookup for aliased common foods, with the embedder + reranker as a tail fallback. The bottleneck is data quality, not the models. See the GitHub repo for the full architecture, training, and eval.
License
MIT (code + weights). Nutrition data: USDA (public domain), INDB/Western via jainsanil18/workout-planner.
Hardware compatibility
Log In to add your hardware
Quantized