<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Divyansh Tiwari</title>
    <description>The latest articles on DEV Community by Divyansh Tiwari (@divyansh_tiwari_862b70f9e).</description>
    <link>https://dev.to/divyansh_tiwari_862b70f9e</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4153121%2F83dd19a6-ff8f-4a85-870b-4724d83ade3f.gif</url>
      <title>DEV Community: Divyansh Tiwari</title>
      <link>https://dev.to/divyansh_tiwari_862b70f9e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/divyansh_tiwari_862b70f9e"/>
    <language>en</language>
    <item>
      <title>SafePlate</title>
      <dc:creator>Divyansh Tiwari</dc:creator>
      <pubDate>Sun, 04 Oct 2026 18:03:57 +0000</pubDate>
      <link>https://dev.to/divyansh_tiwari_862b70f9e/safeplate-2i1l</link>
      <guid>https://dev.to/divyansh_tiwari_862b70f9e/safeplate-2i1l</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-weekend-2026-10-01"&gt;Hacktoberfest Weekend Challenge: Build for a Friend&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;My friend &lt;strong&gt;Aarav&lt;/strong&gt; is allergic to peanuts, tree nuts and dairy. Every time we eat out or grab a snack, the same thing happens. He flips the packet over, squints at the tiny print, and asks: &lt;em&gt;"Is **lecithin&lt;/em&gt;* a soy thing? Is &lt;strong&gt;khoya&lt;/strong&gt; dairy? Does 'may contain' count?"* Restaurants are worse. "Paneer butter masala" sounds harmless until you remember the gravy is usually thickened with &lt;strong&gt;cashew paste&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;SafePlate&lt;/strong&gt;. You paste an ingredient label, a menu item or a recipe, and it tells you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VERDICT: SAFE / CAUTION / AVOID&lt;/strong&gt; for &lt;em&gt;your&lt;/em&gt; allergy profile&lt;/li&gt;
&lt;li&gt;which ingredients are a problem, including hidden and regional names (&lt;em&gt;kaju&lt;/em&gt;, &lt;em&gt;ghee&lt;/em&gt;, &lt;em&gt;maida&lt;/em&gt;, &lt;em&gt;til&lt;/em&gt;, &lt;em&gt;mawa&lt;/em&gt;…)&lt;/li&gt;
&lt;li&gt;any "may contain" or shared-facility warnings&lt;/li&gt;
&lt;li&gt;practical swaps, or what to ask the waiter&lt;/li&gt;
&lt;li&gt;answers to follow-up questions ("what can I use instead of cream here?")&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything runs &lt;strong&gt;on his phone or laptop&lt;/strong&gt;. There's no account, no API key and no server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;🔗 &lt;strong&gt;Live:&lt;/strong&gt; &lt;a href="https://divyansh2102t-dev.github.io/safeplate/" rel="noopener noreferrer"&gt;https://divyansh2102t-dev.github.io/safeplate/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open it in Chrome or Edge (it needs WebGPU). Click &lt;strong&gt;Load model&lt;/strong&gt; once. After that it works offline.&lt;/p&gt;

&lt;p&gt;Try the &lt;strong&gt;sample&lt;/strong&gt; button. It loads a biscuit label with &lt;em&gt;"milk solids, soya lecithin, may contain traces of cashew and peanut"&lt;/em&gt;. The instant scanner flags those ingredients right away, and the local LLM then explains each one and suggests alternatives.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/divyansh2102t-dev" rel="noopener noreferrer"&gt;
        divyansh2102t-dev
      &lt;/a&gt; / &lt;a href="https://github.com/divyansh2102t-dev/safeplate" rel="noopener noreferrer"&gt;
        safeplate
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Allergy checker for a friend, powered by an open-weight LLM running 100% in the browser (WebLLM)
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🍽️ SafePlate&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;An allergy buddy that runs entirely in your browser.&lt;/strong&gt; Paste an ingredient label, a restaurant menu item or a recipe, and SafePlate tells you whether it's safe for &lt;em&gt;your&lt;/em&gt; allergies, what the hidden ingredients are, and what to swap.&lt;/p&gt;
&lt;p&gt;Built for my friend Aarav (peanut, tree-nut and dairy allergies) for the &lt;a href="https://dev.to/challenges/hacktoberfest-weekend-2026-10-01" rel="nofollow"&gt;Hacktoberfest Weekend Challenge: Build for a Friend&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;👉 &lt;strong&gt;Live demo:&lt;/strong&gt; &lt;a href="https://divyansh2102t-dev.github.io/safeplate/" rel="nofollow noopener noreferrer"&gt;https://divyansh2102t-dev.github.io/safeplate/&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Why it's different&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Open-weight LLM, running locally.&lt;/strong&gt; Uses &lt;a href="https://github.com/mlc-ai/web-llm" rel="noopener noreferrer"&gt;WebLLM&lt;/a&gt; (MLC) to run Qwen2.5 / Llama 3.2 / Phi-3.5 on your GPU via WebGPU. No API key, no server, no cost.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your health data stays on your device.&lt;/strong&gt; Allergy profile is saved in &lt;code&gt;localStorage&lt;/code&gt;, label text never leaves the tab.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Works offline&lt;/strong&gt; once the model is cached — perfect for basements, flights and dhabas with no signal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two layers of safety.&lt;/strong&gt; A deterministic keyword scanner (with Indian label names like &lt;em&gt;kaju, ghee, maida, paneer, til&lt;/em&gt;…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/divyansh2102t-dev/safeplate" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/mlc-ai/web-llm" rel="noopener noreferrer"&gt;WebLLM&lt;/a&gt;&lt;/strong&gt; (MLC AI, Apache-2.0) runs open-weight models directly in the browser using WebGPU.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open-weight models:&lt;/strong&gt; the default is Qwen2.5-1.5B-Instruct. You can also pick Llama 3.2 1B, Qwen2.5 0.5B for older phones, or Phi-3.5-mini for the smartest answers. They're in a dropdown, so changing models takes one line of code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two layers of safety.&lt;/strong&gt; Small models explain things well, but I didn't want to rely on one remembering that &lt;em&gt;ghee is dairy&lt;/em&gt;. So:

&lt;ol&gt;
&lt;li&gt;A &lt;strong&gt;deterministic scanner&lt;/strong&gt; (&lt;code&gt;allergens.js&lt;/code&gt;) uses a synonym dictionary, including Indian label names and Hinglish, to highlight every match instantly. It works without the model.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;LLM&lt;/strong&gt; then gives the verdict, explains it, catches anything the dictionary missed, and suggests swaps. The system prompt tells it to answer &lt;strong&gt;CAUTION, never SAFE&lt;/strong&gt; whenever it's unsure, and it runs at temperature 0.2.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;The allergy profile is saved in &lt;code&gt;localStorage&lt;/code&gt;. Answers stream token by token, and follow-up questions keep the chat history.&lt;/li&gt;
&lt;li&gt;There's no framework and no build step: just &lt;code&gt;index.html&lt;/code&gt;, &lt;code&gt;app.js&lt;/code&gt;, &lt;code&gt;allergens.js&lt;/code&gt; and &lt;code&gt;style.css&lt;/code&gt;, hosted on GitHub Pages.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;For this project, open weights aren't just a nice extra. The app couldn't work the way it does without them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Health data stays private.&lt;/strong&gt; Someone's allergies are medical information. With a closed API, every label Aarav checked would be sent to someone else's server. Here, nothing leaves the browser tab.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It works where he actually needs it.&lt;/strong&gt; Restaurant basements, flights, roadside dhabas with one bar of signal. Once the model is downloaded and cached, SafePlate runs fully offline. A cloud API fails exactly when you're hungry and unsure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It's free to run.&lt;/strong&gt; There's no API key to leak, no bill and no rate limit, so I can give it to every friend who has allergies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I control how it behaves.&lt;/strong&gt; I can pick a model size that suits his phone, tune the prompt to be cautious, and later fine-tune a small model on allergen data. No vendor can quietly change or retire the model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anyone can improve it.&lt;/strong&gt; The repo is tagged &lt;code&gt;hacktoberfest&lt;/code&gt; and has &lt;code&gt;good first issue&lt;/code&gt;s for adding allergen names in more Indian languages and E-number lookups. Every name someone adds makes it safer for everyone.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;p&gt;I built this quickly with an AI coding agent helping with the scaffolding, the allergen dictionary and the WebLLM integration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;This is an entry for the main challenge only.&lt;/p&gt;




&lt;p&gt;⚠️ &lt;em&gt;SafePlate is a second pair of eyes, not a doctor. Always read the real label and carry your epinephrine.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
