DataPilot -- Private AI Data Analyst

A self-hostable analyst that turns plain-English requests into real Python analysis and visual reports, while your data stays on your own server.

Overview

DataPilot lets anyone analyse a dataset by describing what they want in plain language. Instead of guessing the answer, it writes the actual Python code (pandas, numpy, matplotlib) to preprocess, analyse and visualise your data, runs that code against your file, and returns a report: charts, printed results, and the code itself so everything is auditable. You then refine the report by asking follow-up questions.

It is built for organisations that cannot send their data to a cloud AI. The analytics is done by code running on your server, and the AI that writes the code can be a local model, so raw data never leaves your network.

How it works

Each request goes through a short pipeline. The AI is only ever given the structure of your data (column names, types, and a 5-row sample) to write the code. The full dataset is only ever touched by the code that runs locally.

your request + dataset
        |
        v
1. AI writes Python   (sees only: column names, types, 5-row sample)
        |
        v
2. Sandbox runs it    (against the FULL data, locally:
                       no network, 30s timeout, memory cap)
        |
        v
3. Report             (charts + printed results + the code)
        |
        v
4. You refine         (follow-up prompts build on prior steps)

Charts and numbers are produced by the executed code, not invented by the language model. That is what keeps the results trustworthy: the AI reasons about how to analyse the data, but the figures come from real computation.

User workflow

Using DataPilot takes four simple steps:

1. Load your data
Click Upload CSV to bring in your own file, or Load sample data to try it. The column names and row count appear so you know it is read correctly.
2. Describe the analysis
Type what you want in plain English, for example "show the daily revenue trend and flag anomalies" or "compare performance by region with a bar chart". Use the suggestion chips to start.
3. Watch it work, then read the report
DataPilot writes the Python live (you see it typed out), runs it in the sandbox, and returns the report: the chart(s), the printed results, and a View code button to inspect exactly what ran.
4. Refine by prompting
Ask follow-ups like "add a 7-day moving average" or "break this down by month". Each step builds on the previous one, like a notebook you drive with words.

Privacy & security

Privacy is the core design goal. Two things keep your data safe:

  • The AI never sees your rows. To write the code, the model receives only the column names, their inferred types, and a 5-row sample. Your full dataset is never sent to the AI.
  • The data is only processed locally. The generated Python runs on your own server, against the full file. Results (charts, numbers) are returned to your browser; the raw data never leaves the machine.
  • The code runs in a sandbox. Generated code executes in an isolated process with no plt.show, a 30-second timeout, a memory cap, and a denylist for dangerous operations (network, subprocess, file deletion). Production deployments add container/nsjail isolation with no network.
  • The AI itself can be local. The code-generation model is a swappable layer. Point it at a local model (Qwen2.5-Coder, Llama, Mistral via Ollama or vLLM) and the whole system is on-premise and air-gappable.

Self-correction loop

AI-written code is not always right the first time. If the generated code throws an error, DataPilot feeds the traceback back to the model with the failing code and asks it to fix the problem, then re-runs it. This repeats up to three times. When a fix succeeds, the report is shown with an "auto-fixed an error" note so you know it happened.

What you can ask

Anything you would ask a data analyst to do with a table, for example:

  • - "Show the revenue trend over time and flag any anomalies"
  • - "Compare performance by region with a bar chart and print the totals"
  • - "What columns are most correlated? Show a heatmap"
  • - "Clean the data, then forecast next month with a simple model"
  • - "Break refunds down by week and highlight the worst week"
  • - "Give me summary statistics and a distribution for each numeric column"

It handles preprocessing (type conversion, missing values, date parsing), aggregation, statistics, correlation, simple modelling (scikit-learn), and any matplotlib visualisation.

Running fully local

For a private deployment, two pieces run on the customer's infrastructure:

1. The code model -- served with Ollama or vLLM. A 7-8B coder (Qwen2.5-Coder 7B, DeepSeek-Coder) runs on a modest GPU or on CPU; a 14-32B coder is sharper and wants a GPU. Nothing is sent to any external API.

2. The execution sandbox -- a locked-down container (Docker / nsjail) with no network access and strict CPU, memory and time limits, where the generated code runs against the data.

The result is an analyst that an enterprise can put behind its own firewall with no data egress.

Limitations & notes

  • - A smaller local model writes slightly less polished code than a top cloud model; the View code button lets you review what ran.
  • - Very large datasets should be sampled or pushed to a database step; the demo targets files that fit comfortably in memory.
  • - Generated analysis is a strong starting point, not a substitute for domain review of important decisions.
  • - This hosted demo runs code-gen on a cloud model for speed and uses a representative sample dataset.

FAQ

Does my data get sent to the AI?
No. The AI only receives column names, types and a 5-row sample to write the code. The full data is only processed by the code running on your server.
Can it run with no internet at all?
Yes. With a local model (Ollama/vLLM) and the local sandbox, the whole system is air-gappable.
Can I see and trust the analysis?
Yes. Every report includes the exact Python that produced it via the View code button, and the numbers come from real execution, not the model's imagination.
What data formats are supported?
CSV today; the same engine extends to Excel, databases and APIs as a preprocessing step in a full build.