← Back to projects

Data Pilot

A sales dashboard you can talk to. The LLM picks which Python function to call (tool calling) and Python does the math, so the model never makes up numbers. Tests guarantee the chat and the dashboard show the same value.

  • Python
  • Streamlit
  • Plotly
  • OpenRouter
  • pytest

Problem

Asking sales questions in plain language is great, but an LLM reading the spreadsheet makes up numbers. I wanted a chat where the model explains and the code calculates, so even a free model is safe to use.

What I built

  • Data cleaning and one Python function per business question (revenue, average ticket, top cities, cancellation rate, period summary).
  • A Streamlit dashboard with cards and Plotly charts, calling the same functions as the chat.
  • A tool-calling chat via OpenRouter: the model picks the function and arguments, Python runs it and the model writes the answer. Every reply shows the tool used and the number returned.

Decisions

  • The model never sees the spreadsheet; it only receives the function result.
  • Category as an enum in the tool definition, so the model cannot ask for a category that does not exist.
  • Tool descriptions tuned from the model's mistakes: it chooses by the description, not by the code.

Results

  • After tuning the descriptions, the model picked the right tool and arguments in 4 of 4 attempts on the case that used to fail.
  • One test guarantees the chat number matches the dashboard card, and another simulates the model to test the tool loop without spending API credits.

Screens

← Back to projects