<?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: Meghana</title>
    <description>The latest articles on DEV Community by Meghana (@freya_meja_21).</description>
    <link>https://dev.to/freya_meja_21</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3560721%2Fdefe319a-9df2-4404-8daa-7308b3dacbfc.jpeg</url>
      <title>DEV Community: Meghana</title>
      <link>https://dev.to/freya_meja_21</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/freya_meja_21"/>
    <language>en</language>
    <item>
      <title>Buy or Bye — An AI Purchase Reality Check for My Impulse-Buying Friend</title>
      <dc:creator>Meghana</dc:creator>
      <pubDate>Mon, 05 Oct 2026 06:55:58 +0000</pubDate>
      <link>https://dev.to/freya_meja_21/buy-or-bye-an-ai-purchase-reality-check-for-my-impulse-buying-friend-41nh</link>
      <guid>https://dev.to/freya_meja_21/buy-or-bye-an-ai-purchase-reality-check-for-my-impulse-buying-friend-41nh</guid>
      <description>&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;Using the open-weight &lt;strong&gt;Gemma 3:1b&lt;/strong&gt; model through Ollama allows Buy or Bye to run its AI explanation layer locally instead of relying on a closed hosted LLM API.&lt;/p&gt;

&lt;p&gt;This makes the AI workflow local, controllable, and transparent.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Demo video:&lt;/strong&gt; &lt;a href="https://www.loom.com/share/149be4d701334eef9021cf69c96f4ce6" rel="noopener noreferrer"&gt;https://www.loom.com/share/149be4d701334eef9021cf69c96f4ce6&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🔗 Project
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/Meghana-2124/buy-or-bye" rel="noopener noreferrer"&gt;https://github.com/Meghana-2124/buy-or-bye&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How the Decision Works
&lt;/h2&gt;

&lt;p&gt;Buy or Bye evaluates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Budget&lt;/strong&gt; — Is the product within the user's budget?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Need&lt;/strong&gt; — How strongly is the product needed?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Usage&lt;/strong&gt; — How often will it be used?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Existing Product&lt;/strong&gt; — Is something similar already owned?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Impulse&lt;/strong&gt; — How impulsive is the purchase?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cheaper Alternative&lt;/strong&gt; — Is there a cheaper option that meets the need?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Decision Logic
&lt;/h2&gt;

&lt;p&gt;Python uses deterministic rules to generate one of three verdicts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BUY  → Purchase factors are generally positive
WAIT → There are reasons to reconsider
BYE  → The purchase does not make sense based on the inputs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The decision is calculated before involving the AI model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Gemma Is Used
&lt;/h2&gt;

&lt;p&gt;Gemma is the &lt;strong&gt;explanation layer&lt;/strong&gt;, not the decision-maker.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Python → Decides
Gemma  → Explains
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Python provides the fixed verdict and purchase factors, while Gemma turns them into a short natural-language explanation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why SerpApi Is Used
&lt;/h2&gt;

&lt;p&gt;SerpApi provides current web information about the product.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Python  → Personal purchase decision
SerpApi → Current web information
Gemma   → Explanation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The search results provide additional context but do not change the personal verdict.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Product: Headphones
Price: ₹30,000
Budget: ₹50,000
Usage: 15 times/month
Need: 4/5
Similar product: No
Impulse: 2/5
Cheaper alternative: No

Verdict: BUY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Changing the inputs can produce &lt;strong&gt;WAIT&lt;/strong&gt; or &lt;strong&gt;BYE&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technology Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;Streamlit&lt;/li&gt;
&lt;li&gt;Gemma 3:1b&lt;/li&gt;
&lt;li&gt;Ollama&lt;/li&gt;
&lt;li&gt;SerpApi&lt;/li&gt;
&lt;li&gt;Requests&lt;/li&gt;
&lt;li&gt;python-dotenv&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Project Structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;buy-or-bye/
├── app.py
├── README.md
├── LICENSE
├── requirements.txt
├── .gitignore
└── screenshots/
    ├── main-interface.png
    ├── purchase-reality-check.png
    ├── web-information.png
    └── gemmas-verdict.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Running the Project Locally
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;Ollama&lt;/li&gt;
&lt;li&gt;Gemma 3:1b&lt;/li&gt;
&lt;li&gt;SerpApi API key&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Install Dependencies
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Install Gemma
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull gemma3:1b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Configure SerpApi
&lt;/h3&gt;

&lt;p&gt;Create &lt;code&gt;.env&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SERPAPI_KEY=your_serpapi_api_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Run the Application
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;streamlit run app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Design Philosophy
&lt;/h2&gt;

&lt;p&gt;Each component has a clear role:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Python&lt;/strong&gt; — decision logic&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma&lt;/strong&gt; — natural-language explanation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SerpApi&lt;/strong&gt; — current web context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This keeps the system simple and transparent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;p&gt;Buy or Bye is a decision-support tool, not financial advice.&lt;/p&gt;

&lt;p&gt;The verdict depends on the user's provided information and does not account for their complete financial situation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Future Improvements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Price tracking&lt;/li&gt;
&lt;li&gt;Product comparison&lt;/li&gt;
&lt;li&gt;Better alternative discovery&lt;/li&gt;
&lt;li&gt;Purchase history&lt;/li&gt;
&lt;li&gt;Personalized spending insights&lt;/li&gt;
&lt;li&gt;Additional open-weight models&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h3&gt;
  
  
  Gemma
&lt;/h3&gt;

&lt;p&gt;Uses &lt;strong&gt;Gemma 3:1b&lt;/strong&gt; as the core open-weight AI explanation layer through Ollama.&lt;/p&gt;

&lt;h3&gt;
  
  
  SerpApi
&lt;/h3&gt;

&lt;p&gt;Uses &lt;strong&gt;SerpApi&lt;/strong&gt; for current web information about products.&lt;/p&gt;

&lt;h2&gt;
  
  
  License
&lt;/h2&gt;

&lt;p&gt;This project is released under the MIT License.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;"Is this product worth buying?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Maybe the better question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Is this purchase worth it for me?"&lt;/strong&gt;&lt;br&gt;
Yes.&lt;/p&gt;

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