<?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: Chetan Bhandari</title>
    <description>The latest articles on DEV Community by Chetan Bhandari (@chetan_bhandari_01).</description>
    <link>https://dev.to/chetan_bhandari_01</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%2F4156593%2F780704a2-ce68-46f9-bb45-ab9a401569a9.png</url>
      <title>DEV Community: Chetan Bhandari</title>
      <link>https://dev.to/chetan_bhandari_01</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chetan_bhandari_01"/>
    <language>en</language>
    <item>
      <title>Expense Tracker: Private AI-Powered Spending Insights with Gemma 3 4B</title>
      <dc:creator>Chetan Bhandari</dc:creator>
      <pubDate>Sun, 04 Oct 2026 11:50:26 +0000</pubDate>
      <link>https://dev.to/chetan_bhandari_01/expense-tracker-private-ai-powered-spending-insights-with-gemma-3-4b-5hkl</link>
      <guid>https://dev.to/chetan_bhandari_01/expense-tracker-private-ai-powered-spending-insights-with-gemma-3-4b-5hkl</guid>
      <description>&lt;h1&gt;
  
  
  Expense Tracker — Local AI Spending Insights
&lt;/h1&gt;

&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;I built &lt;strong&gt;Expense Tracker&lt;/strong&gt;, a modern Android personal-finance application designed to help people manage their money and understand their spending more easily.&lt;/p&gt;

&lt;p&gt;I built this for &lt;strong&gt;My friends and family members&lt;/strong&gt;, who wanted a simple way to track their expenses and understand where their money was going each month.&lt;/p&gt;

&lt;p&gt;The application combines complete expense management, budgeting, financial analytics, and &lt;strong&gt;local AI-powered spending insights&lt;/strong&gt; in one privacy-focused application.&lt;/p&gt;

&lt;h3&gt;
  
  
  The application allows users to:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Track income and expenses&lt;/li&gt;
&lt;li&gt;Manage multiple accounts&lt;/li&gt;
&lt;li&gt;Organize transactions using categories&lt;/li&gt;
&lt;li&gt;Track transfers between accounts&lt;/li&gt;
&lt;li&gt;Set and monitor monthly budgets&lt;/li&gt;
&lt;li&gt;View transaction history&lt;/li&gt;
&lt;li&gt;Analyze daily, weekly, and monthly spending&lt;/li&gt;
&lt;li&gt;View category-wise spending&lt;/li&gt;
&lt;li&gt;Compare income and expenses&lt;/li&gt;
&lt;li&gt;Analyze savings&lt;/li&gt;
&lt;li&gt;Select a specific month for analysis&lt;/li&gt;
&lt;li&gt;Generate AI-powered spending insights&lt;/li&gt;
&lt;li&gt;Identify high-spending categories&lt;/li&gt;
&lt;li&gt;Identify over-budget categories&lt;/li&gt;
&lt;li&gt;Understand changes in spending patterns&lt;/li&gt;
&lt;li&gt;Receive natural-language suggestions based on their financial summary&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Problem
&lt;/h3&gt;

&lt;p&gt;Traditional expense trackers are good at showing numbers, charts, and categories, but users still have to interpret that information themselves.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Food       ₹8,000
Shopping   ₹7,000
Transport  ₹4,500
Bills      ₹6,000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The user can see the numbers, but may still ask:&lt;br&gt;
Why did my spending increase this month?&lt;/p&gt;

&lt;p&gt;Which category should I pay attention to?&lt;/p&gt;

&lt;p&gt;Am I spending more than my budget?&lt;/p&gt;

&lt;p&gt;What changed compared with last month?&lt;/p&gt;

&lt;p&gt;Expense Tracker answers these questions using local AI.&lt;br&gt;
The AI Spending Insights feature converts the selected month's financial summary into a concise natural-language explanation.&lt;/p&gt;

&lt;p&gt;🎥 &lt;strong&gt;Demo Video:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://youtube.com/shorts/0Nnaxn9Q2bg?feature=share" rel="noopener noreferrer"&gt;https://youtube.com/shorts/0Nnaxn9Q2bg?feature=share&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The demo shows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Adding income and expenses&lt;/li&gt;
&lt;li&gt;Managing financial transactions&lt;/li&gt;
&lt;li&gt;Viewing the Analysis screen&lt;/li&gt;
&lt;li&gt;Selecting a specific month&lt;/li&gt;
&lt;li&gt;Generating AI Spending Insights&lt;/li&gt;
&lt;li&gt;Receiving an explanation from Gemma 3 4B&lt;/li&gt;
&lt;li&gt;Changing the selected month&lt;/li&gt;
&lt;li&gt;Generating month-specific AI analysis&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/chetanbhandari01/Expense-Trackers" rel="noopener noreferrer"&gt;https://github.com/chetanbhandari01/Expense-Trackers&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I Built It:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The application is built as a modern Android application using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kotlin — application development&lt;/li&gt;
&lt;li&gt;Jetpack Compose — UI&lt;/li&gt;
&lt;li&gt;Material 3 — UI design&lt;/li&gt;
&lt;li&gt;MVVM + Clean Architecture — application architecture&lt;/li&gt;
&lt;li&gt;Room Database — local financial data&lt;/li&gt;
&lt;li&gt;DataStore — local preferences&lt;/li&gt;
&lt;li&gt;Koin — dependency injection&lt;/li&gt;
&lt;li&gt;Kotlin Coroutines + Flow — reactive data handling&lt;/li&gt;
&lt;li&gt;OkHttp — communication with the AI service&lt;/li&gt;
&lt;li&gt;Ollama — local LLM runtime&lt;/li&gt;
&lt;li&gt;Gemma 3 4B — open-weight AI model
The application follows a modular architecture separating core functionality, data, models, repositories, and feature screens.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🧠 &lt;strong&gt;Local AI Architecture&lt;/strong&gt;&lt;br&gt;
The AI feature is designed around local inference rather than a cloud AI API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User selects a month
        ↓
Room Database
        ↓
Local Kotlin aggregation
        ↓
┌──────────────────────────┐
│ Income                   │
│ Expenses                 │
│ Savings                  │
│ Category totals          │
│ Budget vs Actual         │
│ Monthly comparison       │
└──────────────────────────┘
        ↓
Structured Monthly Summary
        ↓
Ollama Local API
        ↓
Gemma 3 4B
        ↓
Natural-language explanation
        ↓
Analysis Screen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Local Financial Calculations&lt;/strong&gt;&lt;br&gt;
Important financial calculations are performed by the application rather than delegated to the LLM.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Income          → calculated locally
Expenses        → calculated locally
Savings         → calculated locally
Category totals → calculated locally
Budget status   → calculated locally
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gemma receives the structured summary and focuses on explaining and interpreting the results.&lt;/p&gt;

&lt;p&gt;This provides a clear separation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application
    ↓
Accurate financial calculations

Gemma
    ↓
Natural-language explanation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🤖** &lt;strong&gt;Why Gemma 3 4B?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;**The application uses Gemma 3 4B, an open-weight model served locally through Ollama.&lt;br&gt;
I selected the 4B model because the application's task is focused and lightweight. The model receives a structured monthly spending summary and generates a concise explanation rather than processing a large collection of raw documents.&lt;br&gt;
Using a smaller model makes local inference more practical and can reduce computational requirements compared with larger models. Actual response speed depends on the user's hardware, available memory, prompt size, and system load.&lt;br&gt;
The model runs through Ollama's local API, allowing the Android application to communicate with the locally hosted model.&lt;/p&gt;

&lt;p&gt;⚡ &lt;strong&gt;Lightweight Local AI&lt;/strong&gt;&lt;br&gt;
The AI feature was designed specifically for a personal-finance workflow rather than as a generic chatbot.&lt;br&gt;
Instead of asking Gemma to process every transaction individually, the application first creates a structured summary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Selected Month
       ↓
Financial Data
       ↓
Local Aggregation
       ↓
Structured Summary
       ↓
Gemma 3 4B
       ↓
Spending Explanation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, the model can receive information such as:&lt;br&gt;
Month: September&lt;/p&gt;

&lt;p&gt;Income: ₹50,000&lt;br&gt;
Expenses: ₹32,500&lt;br&gt;
Savings: ₹17,500&lt;/p&gt;

&lt;p&gt;Food: ₹8,000&lt;br&gt;
Shopping: ₹7,000&lt;br&gt;
Transport: ₹4,500&lt;br&gt;
Bills: ₹6,000&lt;/p&gt;

&lt;p&gt;Shopping increased compared with the previous month.&lt;/p&gt;

&lt;p&gt;Gemma then converts this structured information into an explanation that is easier for a user to understand.&lt;/p&gt;

&lt;p&gt;📱 &lt;strong&gt;Built for Real Users&lt;/strong&gt;&lt;br&gt;
My roommates and friends often know how much they spent but don't always know where their spending needs attention.&lt;br&gt;
The application therefore focuses on simple questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where did I spend the most?&lt;/li&gt;
&lt;li&gt;Which category increased?&lt;/li&gt;
&lt;li&gt;Am I exceeding my budget?&lt;/li&gt;
&lt;li&gt;How much did I save?&lt;/li&gt;
&lt;li&gt;What changed this month?&lt;/li&gt;
&lt;li&gt;What should I pay attention to next month?
Instead of requiring users to manually interpret charts and numbers, the AI provides an additional natural-language layer.
Example
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Financial Data:
Food       ₹8,000
Shopping   ₹7,000
Transport  ₹4,500
Bills      ₹6,000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;AI Spending Insight:&lt;/strong&gt;&lt;br&gt;
Your largest discretionary expenses this month were food and shopping. Shopping increased significantly compared with the previous month, so reviewing non-essential purchases may help reduce next month's overall spending.&lt;/p&gt;
&lt;h4&gt;
  
  
  🔒 Privacy-First Design
&lt;/h4&gt;

&lt;p&gt;Financial information is sensitive, so privacy is an important part of the product.&lt;br&gt;
The AI workflow is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Financial Transactions
        ↓
Local Android Database
        ↓
Local Monthly Aggregation
        ↓
Structured Summary
        ↓
Local Ollama Server
        ↓
Gemma 3 4B
        ↓
Spending Explanation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The core AI workflow does not require an OpenAI, Gemini, or other cloud LLM API key.&lt;br&gt;
The model runs through Ollama locally, giving the user control over where the AI inference takes place.&lt;br&gt;
If Ollama is configured to use a remote server, the privacy characteristics depend on that server configuration.&lt;/p&gt;

&lt;p&gt;🛠️ &lt;strong&gt;Product Architecture&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────────────────────────────┐
│          Android App             │
│                                  │
│  Jetpack Compose + Material 3    │
│              ↓                   │
│       ViewModel / MVVM           │
│              ↓                   │
│       Repository Layer           │
│              ↓                   │
│         Room Database            │
└──────────────────┬───────────────┘
                   │
                   │ Monthly Summary
                   ▼
          ┌─────────────────┐
          │  Ollama Local   │
          │      API        │
          └────────┬────────┘
                   │
                   ▼
            ┌─────────────┐
            │ Gemma 3 4B  │
            └──────┬──────┘
                   │
                   ▼
          AI Spending Insight
                   │
                   ▼
             Analysis UI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  🧪 AI Feature Workflow
&lt;/h4&gt;

&lt;p&gt;When a user requests an AI analysis:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. User selects a month
        ↓
2. Application retrieves relevant financial data
        ↓
3. Kotlin calculates financial statistics
        ↓
4. Application creates a structured summary
        ↓
5. Summary is sent to local Ollama
        ↓
6. Gemma 3 4B interprets the summary
        ↓
7. Natural-language insight is returned
        ↓
8. Insight appears on the Analysis screen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The selected month is part of the AI context, so changing the month produces an analysis based on that month's data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Agent Session&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I used &lt;strong&gt;GitHub Copilot as an AI coding and development assistant&lt;/strong&gt; during the development of Expense Tracker.&lt;/p&gt;

&lt;p&gt;GitHub Copilot helped me with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kotlin and Jetpack Compose development&lt;/li&gt;
&lt;li&gt;Gradle configuration and troubleshooting&lt;/li&gt;
&lt;li&gt;Android emulator networking&lt;/li&gt;
&lt;li&gt;Ollama HTTP communication&lt;/li&gt;
&lt;li&gt;Month-specific AI analysis&lt;/li&gt;
&lt;li&gt;Debugging and fixing build issues&lt;/li&gt;
&lt;li&gt;Code refactoring and implementation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Does Open Innovation Matter?&lt;/strong&gt;&lt;br&gt;
Open innovation made it possible to combine modern Android development, open-weight AI, local inference, and a real-world personal-finance use case.&lt;br&gt;
The project brings together:&lt;br&gt;
Android + Local Data + Open-Weight AI + Local Inference + Financial Analytics&lt;br&gt;
Using an open-weight model such as Gemma means the AI component can be run locally through Ollama rather than requiring a proprietary cloud inference API.&lt;br&gt;
This gives developers greater control over:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The model&lt;/li&gt;
&lt;li&gt;The inference environment&lt;/li&gt;
&lt;li&gt;The application architecture&lt;/li&gt;
&lt;li&gt;The AI prompts&lt;/li&gt;
&lt;li&gt;The data flow&lt;/li&gt;
&lt;li&gt;The privacy model&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;🏆 Prize Categories&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Expense Tracker uses &lt;strong&gt;Gemma 3 4B&lt;/strong&gt;, an open-weight AI model, as the core of its local AI spending-insight feature.&lt;/p&gt;

&lt;p&gt;The application:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Calculates financial statistics locally using Kotlin&lt;/li&gt;
&lt;li&gt;Creates a structured monthly financial summary&lt;/li&gt;
&lt;li&gt;Sends only the structured summary to the local Ollama API&lt;/li&gt;
&lt;li&gt;Uses &lt;strong&gt;Gemma 3 4B&lt;/strong&gt; to interpret spending patterns&lt;/li&gt;
&lt;li&gt;Generates natural-language spending insights&lt;/li&gt;
&lt;li&gt;Displays the results directly in the Analysis screen&lt;/li&gt;
&lt;/ul&gt;

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