Local-first AI data analysis

Data Analysis with AI + Python Using Local LLMs

Analyze your data with AI without giving up control of your files.

Ask questions in plain English, run AI-generated Python locally, inspect every step, and keep the complete workflow in a reproducible notebook. MLJAR Studio currently supports local models through Ollama.

Local Python execution Visible generated code Notebook output
Runs locally

Your files

CSV · Excel · SQL

MLJAR Studio

Desktop workspace

Local LLM

Understands and writes code

Python

Calculates the real result

Reproducible notebook

Question + code + output + chart

The basic idea

What is local AI data analysis?

A language model running on infrastructure you control works alongside Python, pandas, visualization libraries, and statistical packages.

Instead of asking an LLM to calculate everything in a text response, the model helps decide what analysis to perform and generates the Python code needed to do it. Python then runs against your actual data.

The distinction matters

The LLM handles reasoning, instructions, and code generation. Python performs transformations, statistics, visualizations, and machine learning.

In MLJAR Studio, generated Python is visible and every executed step can be preserved in the notebook, making the analysis inspectable and reproducible.

Your data

Files or SQL

Local LLM

Plans and writes Python

Notebook

Code, output, explanation

Verifiable answers

Why use Python together with a local LLM?

An LLM can translate an analytical question into a plan and code. Python makes sure the answer is calculated from the real data.

“Which customers increased their spending the most compared with last year?”

You usually do not want the language model to guess the answer. You want it to create code that reads the data and calculates the result. The AI makes Python easier to use; Python makes the analysis verifiable and repeatable.

Load CSV and Excel files
Query databases
Clean inconsistent data
Merge datasets
Calculate statistics
Group and aggregate records
Create charts
Detect outliers
Train machine learning models
Export data and reports

From question to notebook

How local LLM data analysis works

The language model and Python have separate jobs, and every stage stays available for inspection.

01

Open your data locally

Start with CSV, Excel, experiment files, or a SQL database already available from your computer. There is no need to paste hundreds of rows into a chat window.

sales.xlsx · customers.csv · experiment-results.csv

02

Ask a question in plain English

Describe the result you need: compare groups, highlight a decline, merge files, clean records, or create a visualization.

“Show revenue by month and highlight the three largest declines.”

03

The local LLM generates Python

The model interprets the request, plans the analysis, and writes Python using pandas and the data-science libraries suited to the task.

Readable code remains available for review and editing.

04

Python runs the calculation

Python executes against the real dataset and produces a table, statistic, chart, cleaned file, or machine learning model.

The result comes from computation, not a language-model guess.

05

Keep the complete workflow

Questions, generated code, outputs, charts, and follow-up analysis stay together in a notebook that can be reopened and rerun.

Inspectable · editable · reproducible

generated-analysis.py
monthly = ( df.groupby("month", as_index=False)["revenue"] .sum() .sort_values("month") ) monthly["change"] = monthly["revenue"].pct_change() monthly.nsmallest(3, "change")

Python groups the actual data, calculates month-over-month change, and returns the three largest declines.

Use cases

What can you analyze with a local LLM and Python?

Use the same conversational workflow for everyday data preparation, rigorous analysis, and predictive modeling.

Excel and CSV files

Clean spreadsheets, merge files, find duplicates, summarize columns, calculate KPIs, create charts, and detect unusual values.

Business and database data

Combine natural-language questions with SQL and Python, then continue the analysis after the selected data is loaded.

Statistical analysis

Use visible Python for t-tests, ANOVA, correlations, regression, confidence intervals, and outlier detection.

Data visualization

Ask for trends, distributions, comparisons, or relationships and let Python create the visualization from your data.

Machine learning

Prepare features, train models, evaluate results, and continue experimenting without moving the data to another tool.

Privacy and control

Why run the LLM locally?

The biggest difference between a local and cloud LLM is where inference happens.

With a local model, inference can run on your computer or infrastructure you control. That gives you more control over model choice and can be useful when data cannot be uploaded to a third-party AI service.

Confidential company data
Unpublished research
Financial information
Customer records
Healthcare datasets
Proprietary databases

Know the tradeoffs

Local control uses local resources

Cloud models provide capable inference without requiring powerful local hardware. A local model needs enough RAM or GPU memory for the model you want to run, plus memory for Python and your dataset.

Your hardware defines the practical model size

Smaller models are easier to run; larger models often improve analysis quality but demand more memory.

Two separate choices

Local LLMs are not the same as local LLM providers

First choose the neural network that will generate responses. Then choose the software that loads and serves it.

1. Choose a model

The model is the neural network that understands your request and generates the response. Families such as Qwen and Gemma are examples used in current MLJAR Ollama documentation.

Python coding abilityReasoning and tool useContext sizeSpeedMemory requirementsModel license

2. Choose a model runtime

The runtime loads the model and makes it available to applications. These tools solve model serving; MLJAR Studio turns the served model into a practical Python data-analysis workflow.

Ollama

Supported

A straightforward way to download and run models locally. It is the local provider currently documented and supported by MLJAR Studio.

LM Studio

Runs models locally and can expose local REST and OpenAI-compatible API endpoints.

Jan

Includes a local OpenAI-compatible API server powered by llama.cpp.

vLLM

Provides an OpenAI-compatible server for serving models from GPU infrastructure.

Choosing a model

Which local LLM is best for data analysis?

There is no single best model for every computer and every analytical task.

A small model may run comfortably on a laptop but produce weaker code. A larger model may perform better but require considerably more memory. Model selection should be based on real data-analysis tasks, not only generic chatbot benchmarks.

  1. 1Understand the analytical request
  2. 2Generate correct Python
  3. 3Work with pandas and data-science libraries
  4. 4Interpret outputs from previous steps
  5. 5Recover when generated code fails
  6. 6Continue a multi-step analysis
  7. 7Explain the final result clearly

MLJAR LLM benchmark

We benchmark LLMs on real Python data analysis

Every model receives the same multi-step analytical prompts. The complete interaction is saved as a notebook, so you can inspect prompts, generated Python, outputs, errors, charts, final answers, and scores.

Exploratory data analysis
Statistics
Machine learning
Time series
Finance
NLP

Local resources

What hardware do you need?

The practical answer depends mainly on the model, but the language model is only part of your memory budget.

RAM

System memory used by the model, Python environment, and your dataset.

VRAM

GPU memory available for acceleration when your machine has a compatible GPU.

Model size

Larger models generally need more memory and compute, but may provide stronger results.

Quantization

Reduced-precision model versions lower memory requirements and can improve local speed.

Context length

Long conversations and substantial notebook context can increase memory requirements.

Remember to leave memory for Python and the dataset—not only the language model.

Flexible by project

Local AI does not mean giving up the cloud

You do not have to choose one provider for every notebook. Match the model location to the project and task.

Sensitive project

Local LLM

Everyday analysis

Local or cloud model

Difficult reasoning task

Powerful cloud model

Offline environment

Local LLM

MLJAR Studio supports different provider configurations. Current documentation includes MLJAR AI, OpenAI, Ollama Local, and Ollama Cloud, giving you control over which setup fits each project.

One desktop workspace

A desktop environment for local AI + Python data analysis

MLJAR Studio puts the AI conversation and local Python execution environment in one application.

Open local files
Ask questions in English
Generate Python
Execute it locally
Inspect and edit code
Create charts and statistics
Train ML models
Save the notebook workflow

MLJAR Studio runs on your computer and is designed around local Python execution and reproducible notebooks. With Ollama configured, the language model can run locally too.

Your files

CSV · Excel · SQL

MLJAR Studio + Local LLM

Conversation and reasoning

AI Data Analyst

Generates visible Python

Python results

Tables · charts · models

Notebook

Saved and reproducible

From analysis to application

Go beyond the notebook

After cleaning or analyzing the data, turn the useful workflow into something other people can use.

Dashboard

Let someone explore metrics and charts interactively.

Chat app

Give users a conversational interface for a specific dataset or workflow.

Internal tool

Create an interface for files, cleaning, calculations, or reports.

Web app

Expose the useful part of an analysis without asking users to run a notebook.

Publish notebook workflows with Mercury

MLJAR Studio integrates with Mercury for turning notebooks into interactive dashboards, chat apps, internal tools, and web applications.

Explore Mercury

FAQ

Frequently asked questions

Can I analyze data with a local LLM?+

Yes. A local LLM can understand analytical questions and generate Python code, while Python performs calculations and transformations against the actual dataset.

Does the LLM calculate the results?+

Not necessarily. A more reliable approach for structured data analysis is to let the model generate Python and let Python perform the calculations against the real data.

Does MLJAR Studio run Python locally?+

Yes. MLJAR Studio is a desktop application and executes the analysis in the local Python environment. Generated code is visible and can be inspected and reused.

Can MLJAR Studio use a local LLM?+

Yes. MLJAR Studio currently supports and documents local LLM connections through Ollama.

Do I need to know Python?+

No. You can ask questions in plain English. Knowing Python gives you additional control, but the AI Data Analyst can generate and execute Python for you.

Which local model should I choose?+

It depends on your hardware and the complexity of the analysis. Coding quality, reasoning, memory use, speed, and the ability to complete multi-step data-analysis tasks are all important.

Can I use local AI for Excel and CSV files?+

Yes. MLJAR Studio’s AI Data Analyst can work with local structured files, including CSV and Excel, as well as SQL database connections.

Can I turn the analysis into an app?+

Yes. Notebook-based analysis in MLJAR Studio can be turned into an interactive web application using Mercury.

Start analyzing locally

Use AI to understand the question. Use Python to calculate the answer.

MLJAR Studio gives you a desktop environment for AI-assisted Python data analysis with visible code, reproducible notebooks, and support for local LLMs through Ollama.

Keep the code, data, and workflow under your control.