🥦 WIC Recipe Parser

The Inspiration

Every week, 4.7 million families walk into grocery stores with WIC benefits and walk out confused. WIC (Women, Infants, and Children) provides crucial nutrition assistance, but here's the gap no one talks about: WIC helps you shop, not cook.

Existing tools like WICShopper tell you what's eligible at checkout. But what happens when a mom finds a pancake recipe online that calls for butter, all-purpose flour, and whole milk? She has no easy way to know which ingredients are covered, what to swap, or how to rewrite the entire recipe. That friction means wasted benefits, missed meals, and stress.

I built WIC Recipe Parser to close the gap between the grocery store and the kitchen table.


What It Does

WIC Recipe Parser is an AI-powered tool that transforms any recipe into a WIC-friendly version in seconds:

  1. Paste any recipe (or load one of our 4 family favorites)
  2. AI parses ingredients using structured NLP extraction
  3. Instant eligibility check against a hardcoded WIC food ontology
  4. Smart substitutions suggest WIC-approved alternatives with explanations
  5. Full recipe rewrite generates step-by-step cooking instructions
  6. Auto-generated shopping list grouped by category (Produce, Dairy, Grains, Proteins, Other)
  7. Servings scaler adjusts quantities for any family size
  8. Spanish toggle translates the entire output for accessibility
  9. Export downloads a clean recipe card

How I Built It

Architecture

Our system uses a hybrid local + cloud AI architecture:

$$ \text{Recipe Input} \xrightarrow{\text{Featherless Qwen2.5-14B}} \text{Structured JSON} \xrightarrow{\text{Local Fuzzy Match}} \text{WIC Check} \xrightarrow{\text{Featherless AI}} \text{Substitutions + Rewrite} $$

  • Local layer: Python fuzzy-matching against a hardcoded WIC food database (150+ items) for speed and zero API cost on eligibility checks
  • AI layer: Featherless.ai's OpenAI-compatible API with Qwen/Qwen2.5-14B-Instruct handles parsing, substitution reasoning, and recipe rewriting via constrained JSON generation

The Code

I wrote the entire app in under 18 hours using Cursor's and Codex AI-assisted editor. The core logic lives in three files:

  • app.py — Streamlit UI, API orchestration, and session state caching
  • wic_database.py — WIC food ontology + 50+ fallback substitutions for offline resilience
  • requirements.txt — Minimal dependencies (streamlit, openai)

Challenges I Faced

1. The "Original Ingredient" JSON Bug

Our first API prompt asked the model to return substitutions as JSON. The model kept returning literal keys like "original_ingredient" instead of the actual food name (e.g., "butter"). This broke the parser entirely.

Fix: I rewrote the prompt to explicitly say "The KEYS must be the exact original ingredient names" and added a clean_json() helper to strip markdown code blocks from LLM output.

2. Duplicate Streamlit Keys

When displaying the shopping list, repeated items across categories caused StreamlitDuplicateElementKey crashes.

Fix: I switched from using item names as keys to using enumerated indices:

for idx, item in enumerate(items):
    st.checkbox(item, key=f"shop_{category}_{idx}")

3. API Latency During Demo

The 14B model occasionally took 15+ seconds per call, which would kill a live demo.

Fix: I implemented st.session_state caching so that parsed ingredients and substitutions are stored in memory. If a user only changes the servings slider, the app rescales locally without re-calling the API.

4. No Central WIC API

There is no public federal API for real-time WIC eligibility by state.

Fix: I hardcoded a comprehensive list based on USDA federal guidelines and added a clear disclaimer that state rules may vary.


What I Learned

  1. Constrained generation is harder than chat. Asking an LLM to return valid JSON with specific keys is a different skill than casual prompting. Temperature tuning (0.1 for parsing, 0.3 for substitutions, 0.4 for rewriting) made a huge difference in reliability.

  2. Hybrid architectures win hackathons. Keeping eligibility checks local saved API costs and latency, while reserving the LLM for creative tasks (substitutions, rewrites) where it shines.

  3. Session state is essential. Streamlit reruns the entire script on every interaction. Without st.session_state, we would have burned through API credits and made users wait 20 seconds per click.

  4. Accessibility matters. Adding a Spanish toggle took 10 minutes of prompt engineering but dramatically expanded the tool's impact for WIC families.


What's Next

  • State-specific databases: Expand beyond federal guidelines to California, Texas, New York, Florida, and Illinois WIC lists
  • Image/PDF OCR: Let users snap a cookbook page and auto-extract ingredients
  • Nutrition API integration: Show side-by-side nutrition facts (original vs. adapted)
  • Voice input: For families with low literacy or visual impairments
  • WIC allotment tracker: Input monthly benefits and flag if the shopping list exceeds budget

Impact

WIC Recipe Parser serves 4.7 million WIC families in the US. By turning any recipe into a benefits-friendly meal plan, I reduce food waste, stretch family budgets, and make healthy cooking accessible. This is computational linguistics for social good. Built with | Layer | Tool | | ---------- | ------------------------------------------- | | Frontend | Streamlit | | AI Models | Featherless.ai (Qwen2.5-14B-Instruct) | | NLP | Structured JSON extraction + entity linking | | Database | Hardcoded WIC ontology (federal guidelines) | | Editor | Cursor (AI-assisted coding) | | Deployment | Streamlit Community Cloud |

Built for LingHacks VII | June 2026

Built With

Share this project:

Updates

posted an update

I built WIC Recipe Parser for LingHacks VII. So after it I will be turning it into a free, permanent tool for the 4.7 million families who rely on WIC benefits.

What's coming next:

Phase 1 — Stabilize & Launch (This Week)

  • Adding a clear state-specific disclaimer
  • Testing on mobile devices
  • Securing a custom domain
  • Reaching out to local WIC clinics

Phase 2 — Recipe Expansion (Weeks 2–4)

  • 50+ culturally diverse pre-loaded recipes (breakfast, lunch, dinner, snacks)
  • Family-size scaler with smart quantity rounding
  • Recipes from the community — submit your own!

Phase 3 — Taste & Nutrition Science (Weeks 4–8)

  • Flavor bridge technique: every substitution comes with a "why this tastes right" note
  • Nutrition preservation score so families know they're not losing nutrients
  • Better AI prompts focused on taste, not just eligibility

Phase 4 — User Feedback Loop (Weeks 6–12)

  • In-app thumbs up/down on every recipe
  • Community recipe submissions
  • State-by-state WIC list verification with user help

The app will always be free at the point of use. If you know a WIC family, a food bank, or a clinic that could use this, send them the link.

Built for LingHacks VII. Growing for the 4.7 million.

Log in or sign up for Devpost to join the conversation.