A LoRA adapter for
Ministral-8B-Instruct-2410 fine-tuned on synthetic dietary recipe adaptations.
Given a recipe and a dietary restriction (vegan, gluten-free, dairy-free, etc.), Robuchan produces a structured adaptation with ingredient substitutions, updated steps, flavor preservation notes, and a compliance self-check.
1from peft import PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4base_model = AutoModelForCausalLM.from_pretrained(
5 "mistralai/Ministral-8B-Instruct-2410",
6 device_map="auto",
7 load_in_4bit=True,
8)
9model = PeftModel.from_pretrained(base_model, "mistral-hackaton-2026/robuchan")
10tokenizer = AutoTokenizer.from_pretrained("mistral-hackaton-2026/robuchan")
11
12messages = [
13 {
14 "role": "system",
15 "content": (
16 "You are a culinary adaptation assistant. "
17 "Priority: (1) strict dietary compliance, (2) preserve dish identity and flavor profile, "
18 "(3) keep instructions practical and cookable. "
19 "Never include forbidden ingredients or their derivatives (stocks, sauces, pastes, broths). "
20 "If no exact compliant substitute exists, acknowledge the gap, choose the closest viable option, "
21 "and state the trade-off. "
22 "Output sections exactly: Substitution Plan, Adapted Ingredients, Adapted Steps, "
23 "Flavor Preservation Notes, Constraint Check."
24 ),
25 },
26 {
27 "role": "user",
28 "content": (
29 "Recipe: Mapo Tofu\n"
30 "Cuisine: Sichuan Chinese\n"
31 "Ingredients: 400g firm tofu, 200g ground pork, 2 tbsp doubanjiang, "
32 "1 tbsp oyster sauce, 3 cloves garlic, 1 inch ginger, 2 scallions, "
33 "1 tbsp cornstarch, 2 tbsp neutral oil\n"
34 "Steps: 1) Brown pork in oil until crispy. 2) Add minced garlic, ginger, "
35 "and doubanjiang; stir-fry 30 seconds. 3) Add tofu cubes and 1 cup water; "
36 "simmer 8 minutes. 4) Mix cornstarch slurry and stir in to thicken. "
37 "5) Garnish with sliced scallions.\n"
38 "Restrictions: vegetarian, shellfish-free\n"
39 "Must Keep Flavor Notes: mala heat, savory umami, silky sauce"
40 ),
41 },
42]
43
44inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
45inputs = inputs.to(model.device)
46outputs = model.generate(inputs, max_new_tokens=1024, temperature=0.7, do_sample=True)
47print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
Training data was synthetically generated from
Food.com's 530K recipe corpus:
The dataset covers 10 dietary categories: vegan, vegetarian, dairy-free, gluten-free, nut-free, egg-free, shellfish-free, low-sodium, low-sugar, low-fat.
Three prompt templates (labeled-block, natural-request, goal-oriented) at a 50/30/20 split prevent format overfitting.
Three-layer evaluation: format compliance (deterministic header parsing), dietary constraint compliance (regex against banned-ingredient lists), and LLM-as-judge via mistral-large-latest.
1@misc{robuchan2026,
2 title = {Robuchan: Recipe Dietary Adaptation via Fine-Tuned Ministral-8B},
3 author = {sumitdotml and Hiware, Kaustubh},
4 year = {2026},
5 url = {https://huggingface.co/mistral-hackaton-2026/robuchan}
6}