RecipeSense answers one question: what can I cook with what is in my kitchen? You type ingredients the way you would say them, or describe what you feel like eating, and it ranks 238,157 recipes in about 20 milliseconds. There are no ratings or accounts behind it, so it works from the first query.
What comes out
Four ingredients go in, some of them by their Hindi names. The page shows the ranked recipes and the server's measured time for the ranking.

"haldi", "turmeric powders" and "Turmeric powder (Haldi)" are one ingredient. Typed names are resolved to canonical ones through an alias table, singular folding, then a closest-spelling match and a character n-gram match for misspellings, so "tomatoe", "chiken" and "green chilly" still land.
Free text takes a different path. "something creamy and spicy with spinach" is embedded with MiniLM and compared against every recipe's text. On a recipe page, More like this finds neighbours in a joint space of ingredient vectors and text vectors.
How it works
Three cheap rankers each nominate 50 recipes: TF-IDF on the text as typed,
IDF-weighted ingredient overlap on the cleaned names, and skip-gram ingredient
embeddings. A LightGBM lambdarank model scores the union on 18 features.
Cuisine, course, vegetarian and likes are applied last.

The strongest feature is each candidate's gap to the best overlap score for that query. The ranker's main job is on long pantry lists, where it learns to ignore ingredients a recipe does not use.
How good is it
The detailed comparison is on the first dataset, 6,521 Indian recipes, where every ranker can be run on every query. The full catalogue comes after it.
There are no ratings or click logs, so the evaluation is known-item search. A query is built from a held-out recipe's own ingredients, and a ranker scores well if that recipe comes back near the top. Recipes are split by id: half for tuning and training, half for reporting, with 3,120 test queries per style.
Share of queries where the source recipe is in the top 6, the app's first page:
| Ranker | Typed | Exact | Pantry |
|---|---|---|---|
| Substring count | Typed52.4% | Exact88.9% | Pantry67.5% |
| TF-IDF | Typed71.9% | Exact86.6% | Pantry83.8% |
| Ingredient overlap on cleaned names | Typed93.1% | Exact97.5% | Pantry95.7% |
| Ingredient embeddings alone | Typed77.0% | Exact83.5% | Pantry37.5% |
| Learned ranker | Typed95.3% | Exact97.4% | Pantry99.0% |
Typed queries use the Hindi alias half the time and flip singular and plural. Exact queries spell ingredients as the dataset does. Pantry queries are three quarters of the recipe plus ten unrelated common ingredients.
Most of the gain is data cleaning: resolving aliases and plurals takes typed queries from 72% to 93% before any model is trained. The learned ranker adds the rest, mostly on pantry queries.
Growing it to 238,157 recipes
The first version had 6,521 recipes. Adding the 231,636 recipes of the Food.com dataset made the catalogue 36 times larger, and the serverless function failed twice on the way: the bundle was 539 MB against a 500 MB limit, and then it was killed for memory at 1.1 GB.
The fix was to stop doing work at start-up. Everything is packed once, offline: arrays for search, recipe text in compressed blocks that are read only when a recipe page asks for one, and text vectors cut from 384 to 192 dimensions and stored as int8. pandas is gone from serving, and the ingredient and text vectors are no longer copied into one joined matrix. The function now loads the catalogue in about two seconds and peaks at 587 MB.
The models were retrained on the full set and measured the same way, on 1,367 queries per style from held-out recipes:
| Ranker | Typed | Exact | Pantry |
|---|---|---|---|
| TF-IDF | Typed53.8% | Exact80.4% | Pantry86.0% |
| Ingredient overlap on cleaned names | Typed96.9% | Exact97.4% | Pantry95.1% |
| Ingredient embeddings alone | Typed75.9% | Exact76.7% | Pantry31.2% |
| Learned ranker | Typed96.9% | Exact97.4% | Pantry98.5% |
With 36 times more recipes to confuse the right one with, TF-IDF drops on typed queries and the learned ranker holds its place. The search vectors lost little in the cut: they return 92% of the full model's top 24 results.
One thing the bigger vocabulary broke was typo matching. It now holds other people's typos, so "tomatoe" matched a rare "dried tomatoe" instead of tomato. Misspellings are now matched against common ingredients first.
Free-text search
On the first dataset, same split, about 3,100 queries per style. MiniLM finds a dish from its name better than TF-IDF, and is much worse on a list of ingredients. So ingredient search goes to the ranker and free text goes to MiniLM.
| Ranker | Recipe title | Ingredient sentence |
|---|---|---|
| TF-IDF over text | Recipe title91.6% | Ingredient sentence81.5% |
| MiniLM | Recipe title95.6% | Ingredient sentence31.6% |
What did not work
Ingredient embeddings do not improve ranking. On their own they collapse on pantry queries (37.5%), because averaging in ten extra ingredients drags the query vector towards generic recipes. An ablation that removed their features from the learned ranker left its held-out score unchanged. They are kept for "more like this", which is what co-occurrence vectors are good at.
Known-item search also has a limit: it checks whether the right recipe can be found, not whether people like the list. There are no human queries or judgements behind these numbers.
Serving it
The whole thing runs on one Vercel project: a static React build and a single Python function. There is no PyTorch, no LightGBM and no pandas at serving time. MiniLM runs as an 8-bit ONNX model, and the ranker's trees are parsed from the LightGBM model file and scored in NumPy, with output identical to LightGBM's.
Recipe photos could not be embedded, so each recipe gets a cover drawn in the browser from its own ingredients: the vessel comes from the course and cuisine, the shapes and colours from the main ingredients.

Use it
The packed catalogue and the trained models are committed, so there is nothing to download.
from recsys.service import Recommender
rec = Recommender()
# Ingredients, typed the way people type them
for r in rec.recommend(["haldi", "paneer", "palak", "green chilly"], veg=True, limit=3):
print(f"{r['score']:.2f} {r['total_time']:>3} min {r['title']}")
# Free text
for r in rec.search("something creamy and spicy with spinach", limit=3):
print(f"{r['score']:.2f} {r['title']}")Registered with the Copyright Office, Government of India, as "Recipesense" (SW-2025020495).
