AI Powered Dashboard
Building a Local AI-Powered KPI Dashboard with Streamlit and Ollama⌗
In this project, I built a sleek, brand-aligned business intelligence dashboard powered entirely by local AI β no API keys, no cloud dependencies. Just Python, Streamlit, and Ollama running smart and fast right on my machine.

π― The Goal⌗
Create a lightweight yet powerful app that lets users:
- Upload or use built-in business KPI data
- Visualize revenue, profit, and conversion trends
- Generate AI-powered summaries and insights
- Ask follow-up questions using natural language
- Export clean PDF reports β charts included
π§ The Tech Stack⌗
Layer | Tech |
---|---|
Frontend | Streamlit (Python) |
Charts | Matplotlib |
AI Engine | Ollama + Mistral model |
PDF Export | FPDF |
Storage | tempfile , CSV, session |
π§± What the App Does⌗
π 1. Upload or Simulate Business Data⌗
The app loads default revenue, expenses, leads, and client data β or allows the user to upload a custom CSV. It auto-generates calculated fields like:
- Profit = Revenue - Expenses
- Conversion Rate = Clients Γ· Leads
π 2. Visualize KPIs⌗
Three clean, responsive charts are generated with Matplotlib:
- Revenue vs. Expenses (Line Chart)
- Monthly Profit (Bar Chart)
- Conversion Rate (Line Chart)
π§ 3. Generate AI Summaries⌗
Click a button and get a GPT-style summary of your data using Ollama + a locally-running Mistral model β no API required.
Summaries are cached in session_state
, so they persist between interactions and don’t get overwritten by the chat module.
π¬ 4. Ask the Model Business Questions⌗
Type in a natural language question like:
βWhatβs the trend in profit over the past 3 months?β
The app feeds both the KPI data and the question to Ollama and returns a contextual, AI-generated answer.
π 5. Export PDF Reports⌗
Generate branded PDF reports including:
- Title and summary section
- Embedded KPI charts
- Styled with your brand colors
π₯ 6. Download Raw Data⌗
Export your data as a CSV at any time.
π§ Why Itβs Cool⌗
- Offline AI: Runs entirely on your machine with Ollama (tested with Mistral, Gemma, and Phi)
- Customizable: Plug in any dataset or model
- Scalable: Easy to repurpose for client reporting, SaaS, or internal BI tooling
- Free and Private: No API usage, no cloud costs, no data leaving your machine
π Next Steps⌗
Iβll continue refining it by:
- Adding markdown rendering in PDFs
- Supporting advanced formatting (headings, lists)
- Packaging it for internal use or monetization
Stay tuned β or reach out if you want help building something like this for your team.