Freebie • Step-by-Step

Local Privacy-First Agent

Using Ollama to securely analyze personal bank CSVs and diet logs completely offline.

The Problem: Giving Away Financial Data

ChatGPT and Claude are incredibly useful for summarizing data and extracting insights, but I absolutely refuse to upload my raw bank CSVs or detailed personal logs to public API endpoints. I wanted the intelligence of an LLM, but totally air-gapped on my Macbook.

Step 1: Install Ollama & Extract CSVs

First, head to Ollama.com and download the local runner. Open your terminal and pull a lightweight model like Llama 3:

ollama run llama3

Next, export your monthly bank statement as a `.csv` file into a local folder on your machine.

Step 2: The Python Bridge Script

I wrote a short Python script that reads the CSV, formats it cleanly, and sends it directly to the local Ollama process running on localhost:11434. Nothing ever reaches the internet.

import pandas as pd
import requests
import json

# 1. Load the sensitive CSV data
df = pd.read_csv('sensitive_bank_statement.csv')
summary_text = df.to_csv(index=False) # Convert back to raw string for prompt

# 2. Build the prompt
prompt = f"""
You are a strict financial advisor. Analyze the following CSV bank statement. 
Categorize the spending, tell me where I spent the most money, and suggest 
three areas I can cut costs this month.

Here is the data:
{summary_text}
"""

# 3. Send to Local Ollama Instance Offline
response = requests.post('http://localhost:11434/api/generate', json={
    'model': 'llama3',
    'prompt': prompt,
    'stream': False
})

# Print the insights!
print(response.json()['response'])

Step 3: Expanding to Diet and Health

You can use this exact same pattern for anything sensitive. Export your MyFitnessPal logs or a spreadsheet of your daily meals, change the prompt to "You are a registered dietician," and have a fully private AI audit your macronutrients.

AI doesn't have to mean sacrificing privacy. Enjoy the script!