Industry & Use Cases

Best LLM for Data Analysis (2026): Models for SQL, Excel and Python You Can Run on Your Own Data

Which language models handle SQL generation, spreadsheet work and pandas analysis best in November 2026, checked against the BIRD, Spider 2.0 and SpreadsheetBench leaderboards, with open-weight picks for each GPU tier, the arithmetic behind them and the silent errors that matter more than any benchmark.

The best LLM for data analysis in November 2026 depends on where your data may go. Hosted frontier models lead: GPT-6.1 and Claude Opus 5.5 scored about 87% on BIRD's October 2026 Mini-Dev text-to-SQL set. For company data kept in-house, Qwen3.8-27B on one 24–32 GB GPU is the practical open pick, and SQL fine-tunes such as Kwai-AutoSQL-32B rival much larger models. Spreadsheet work remains hard for every model.

Quick picks for analysts and data teams

“Data analysis” covers three jobs that models handle very differently: writing SQL against a database, manipulating spreadsheets, and writing Python (usually pandas) to clean, join and summarise data. The picks below come from the public leaderboards for each job and from Hugging Face model cards, all checked on 23 November 2026.

SituationPickWhy
Data may leave your network, hardest questionsGPT-6.1 or Claude Opus 5.587.27% and 87.13% on BIRD Mini-Dev (October 2026), well ahead of the open models in the same run
One 24–32 GB GPU, mixed SQL and PythonQwen3.8-27BApache 2.0, 262K context, image input for charts; 74.51% on the BIRD test set inside the Blender-SQL pipeline
One 32 GB GPU, SQL onlyKwai-AutoSQL-32BApache 2.0 fine-tune of Qwen3-32B; 74.12% on the BIRD test set as a single model
Laptop or 8 GB GPU, SQLiteflash-sqlite-4b75.68% on the BIRD test set from a 4B model; trained for the SQLite dialect
One 80 GB GPU, many usersgpt-oss-120bFits one H100-class card in MXFP4; built-in Python tool calling
128 GB workstationQwen3.8-Flash-Next68.33% on BIRD Mini-Dev, the best open-weight score in that run; read the licence first
Multi-GPU server, agentic SQL over a warehouseGLM-5.2 or GLM-5.3GLM-5.2 powers the top Spider 2.0-Lite entry (76.23%)

Two warnings before you pick. Benchmark rows come from different setups, so a single-model score, a pipeline score and a zero-shot baseline are not directly comparable. And the harness, meaning schema retrieval, execution feedback and self-checks, moves scores by more points than most model swaps do.

How the main data benchmarks work

Three public benchmarks cover most of what analysts do. Knowing what each one measures tells you how far to trust it.

BIRD (text-to-SQL). BIRD pairs natural-language questions with real databases that contain messy values, and scores execution accuracy: whether the generated query returns the same rows as the reference answer. Data engineers and database students score 92.96% on its hidden test set. In late October 2026 the top system, AT&T’s AskData, reached 83.40%. BIRD also keeps a separate single-model track for entries that use one trained model, and a 500-question Mini-Dev set in SQLite, MySQL and PostgreSQL. The BIRD team refreshed Mini-Dev on 28 October 2026, correcting annotations and replacing some questions, and published new baselines for current models.

Spider 2.0 (enterprise SQL workflows). Spider 2.0 was built to look like warehouse work: large schemas, cloud dialects such as Snowflake and BigQuery, and multi-step tasks. When it was published at ICLR 2025, an o1-preview code agent solved only 21.3% of its 632 tasks, against 91.2% on the older Spider 1.0 and 73.0% on BIRD. Agent systems have climbed fast since. On 23 November 2026 the top Spider 2.0-Lite entry scored 76.23%, and the Snowflake-only variant is led by systems above 90%.

SpreadsheetBench (Excel work). The first version has 912 tasks built from real questions on Excel forums, with multiple test spreadsheets per task. Version 2 has 321 expert-curated business workflows: building financial models from templates, debugging formulas and making charts. It is the closest public proxy for “can a model do my spreadsheet job”.

A fourth benchmark, DABstep, built from a financial analytics platform’s real questions, found in June 2025 that the best agent solved only 14.55% of its hard multi-step tasks. That result is from 2025 models, but it makes the same point as the others: multi-step analysis over real files is far harder than answering a single question about one table.

Whatever you pick, size the hardware before you buy: the VRAM calculator does the weights and cache arithmetic shown later in this guide for any model and context length.

Best LLM for SQL: closed, open and fine-tuned models compared

The BIRD leaderboards give the cleanest comparison of models for SQL generation, because the scoring is mechanical and the test set is hidden.

Model or systemTypeScoreSet and date
GPT-6.1Closed87.27%Mini-Dev 2026, three dialects, 28 Oct 2026
Claude Opus 5.5Closed87.13%Mini-Dev 2026, 28 Oct 2026
Claude Sonnet 5.5Closed84.20%Mini-Dev 2026, 28 Oct 2026
Qwen3.8-Flash-NextOpen weight, Qwen Community License68.33%Mini-Dev 2026, 28 Oct 2026
DeepSeek-V4.1-FlashOpen weight, MIT59.67%Mini-Dev 2026, 28 Oct 2026
GLM-5.3Open weight49.40%Mini-Dev 2026, 28 Oct 2026
Qwen3.6-35B-A3BOpen weight, Apache 2.021.13%Mini-Dev 2026, 28 Oct 2026
flash-sqlite-4bOpen SQL fine-tune, Apache 2.075.68%Test set, single-model track, 27 Oct 2026
Blender-SQL with Qwen3.8-27BPipeline on an open model74.51%Test set, 14 Oct 2026
Kwai-AutoSQL-32BOpen SQL fine-tune, Apache 2.074.12%Test set, single-model track, 19 Sep 2026
OmniSQL-32BOpen SQL fine-tune, Apache 2.072.05%Test set, 4 Mar 2025

The Mini-Dev rows and the test-set rows are different question sets and should not be compared with each other. Within each group, three patterns stand out.

First, the closed frontier models are far ahead when used plainly. On the refreshed Mini-Dev, the gap between Claude Opus 5.5 and the best open model is almost 19 points.

Second, fine-tuning and pipelines close much of that gap. A 4B model that writes SQL, repairs failed queries from the database’s error message and judges its own candidates scores 75.68% on the hidden test set. Its card says the scoring run used 32 candidates per question on a single 80 GB A100, so that accuracy costs many generations per answer.

Third, the zero-shot baseline for a small mixture-of-experts model can be poor. Qwen3.6-35B-A3B scored 21.13% on Mini-Dev, far below its general reputation. Do not assume a model that chats well writes good SQL without testing it on your own schema.

Independent work on self-hosted models points the same way. A study of open models on the BIRD development set, revised in October 2026, found that letting the model see execution errors and try again was the only technique that improved accuracy consistently, adding 1.2 to 4.4 points. Schema-linking tricks and majority voting did not pay for their extra tokens in that study.

Best LLM for Excel and spreadsheet analysis

Spreadsheets are harder than databases for language models. A sheet mixes several tables, merged headers, notes and formulas, and the task is often to change the file, not just answer a question.

SpreadsheetBench’s second version tested general models inside the same SWE-agent scaffold in March 2026:

ModelOverallFinancial modellingFormula debuggingVisualisation
Claude Opus 4.634.89%34.0%12.0%62.5%
GPT-5.226.79%33.0%8.0%45.83%
Gemini 3.1 Pro23.68%31.0%7.0%41.67%
GLM-5.0 (open weight)17.14%22.0%7.0%37.5%
DeepSeek-V3.2 (open weight)15.58%7.0%10.0%33.33%
Kimi K2.5 (open weight)14.64%15.0%4.0%41.67%
Qwen3.5-397B-A17B (open weight)11.22%10.0%3.0%25.0%

Purpose-built spreadsheet agents do better on the same set: arito scored 54.51% in September 2026 and WPS AI 50.86% in August 2026. On the easier first version, Google’s Gemini in Google Sheets scored 70.48% (verified, March 2026), and Kingsoft’s Qingqiu Agent 83.11%.

None of the newer open models, such as Qwen3.8-27B or GLM-5.3, had a SpreadsheetBench 2 score on 23 November 2026, so treat the open-weight rows as a floor from older checkpoints.

What this means in practice:

  • Formula debugging is the weakest skill everywhere. No general model passed more than 12% of those tasks. Keep a person on any change to a model that feeds a decision.
  • Do not let the model do arithmetic in prose. Ask it to write the formula, or a short Python script with openpyxl or pandas, then run that and keep it as the audit trail.
  • Flatten before you ask. Convert each logical table to a clean range or CSV with one header row first. Our article on why retrieval breaks on tables and spreadsheets covers the parsing side in depth.

Finance teams have extra constraints on top of this; our guide to LLMs for finance teams covers filings, statements and the controls around them.

Python and pandas: where coding models help analysts

For cleaning, reshaping and statistics, the most reliable pattern is code execution: the model writes pandas, a sandbox runs it, and the model reads the output, including errors, before answering. That turns the model from a calculator into a programmer whose work you can rerun.

Any strong coding model works here. Qwen3.8-27B, Gemma 4 31B and gpt-oss-120b all support function calling, and the gpt-oss card lists Python code execution among its native agentic capabilities. Our comparison of open-weight coding models ranks them on software tasks; for analysis, the differences matter less than three harness choices:

  1. Show the data’s shape, not the data. Pass column names, types, row counts and a small sample. Sending a whole file into the prompt wastes context and invites the model to “read” numbers instead of computing them.
  2. Run every step. A chain of reasoning that was never executed is a guess. Keep the notebook or script with the answer.
  3. Check counts at every join. Print row counts before and after each merge. A count that grows after a left join means duplicate keys on the right.

The CSV analyzer tool and the other data and analytics tools in VDF AI follow this pattern: the agent calls a tool that computes, rather than estimating figures itself.

Silent wrong answers: the accuracy risk that benchmarks miss

A query with a syntax error fails loudly. The dangerous errors run cleanly and return a plausible number. Benchmarks such as BIRD count these as wrong, but in daily use nobody has a reference answer to compare against.

ErrorWhat happensCheck that catches it
Join fan-outJoining orders to a table with several rows per order multiplies revenue by that factorCompare row counts and the sum before and after the join
Null exclusionWHERE region <> 'EU' drops every row where region is blankCount nulls in every filtered column
Wrong grainAveraging daily averages instead of averaging the underlying rowsState the grain of the result in words
Wrong date basisOrder date used where the report uses invoice dateName the date column in the answer
Invented columnThe model uses a plausible column that does not exist, then a real one that means something elseRead the live schema before drafting
Prose arithmeticThe model adds numbers it read from a pasted table and drops a rowNever accept a figure that no code computed

Two habits remove most of the risk. Make the model state, in one sentence, what the query counts: the population, the grain and what it excludes. And reconcile at least one number against a report the business already trusts before anyone uses the new figure.

Best local LLM for data analysis by hardware tier

Memory goes to two places: the model’s weights and the KV cache, which grows with every token of prompt and reply. Analysis prompts are moderate: a schema description, a few sample rows, the question and the conversation so far fit in about 32,000 tokens for most jobs. The table counts keys and values at 16 bits for 32,768 tokens, from each model’s config.json, plus the named 4-bit file. Add 1 to 2 GB for the runtime and compute buffers.

Model4-bit file (repository)KV cache at 32KTotal before overheadFits on
flash-sqlite-4b2.71 GB Q4_K_M (mradermacher/flash-sqlite-4b-GGUF)1.1 GB3.8 GBLaptop GPU with 8 GB
gpt-oss-20b12.11 GB MXFP4 (ggml-org/gpt-oss-20b-GGUF)0.8 GB12.9 GBOne 16 GB GPU
Qwen3.8-27B16.56 GB UD-Q4_K_M (unsloth/Qwen3.8-27B-GGUF)2.1 GB18.7 GBOne 24 GB GPU
Kwai-AutoSQL-32B19.76 GB Q4_K_M (mradermacher/Kwai-AutoSQL-32B-GGUF)8.6 GB28.4 GBOne 32 GB GPU
gpt-oss-120b63.39 GB MXFP4 (ggml-org/gpt-oss-120b-GGUF)1.2 GB64.6 GBOne 80 GB GPU
Qwen3.8-Flash-Nextabout 111 GB UD-Q4_K_XL in four parts (unsloth/Qwen3.8-Flash-Next-GGUF)small; mostly linear attentionabout 112 GB128 GB unified memory or two 80 GB GPUs

The cache arithmetic is two (keys and values) × attention layers × KV heads × head dimension × 2 bytes × tokens. Qwen3.8-27B keeps a growing cache on only 16 of its 64 layers, with 4 KV heads of dimension 256, so it needs 65,536 bytes per token, or 2.1 GB at 32K. Kwai-AutoSQL-32B inherits Qwen3-32B’s 64 full-attention layers with 8 KV heads of dimension 128, which is 262,144 bytes per token, four times as much. A SQL fine-tune with the smaller file can still need more memory than a newer general model.

Two licence notes. Qwen3.8-Flash-Next uses the Qwen Community License 1.0. If you or an affiliate run a “Model as a Service” or “AI Work Assistant” business (an AI product built mainly for coding or office productivity), you need a separate licence from Qwen before any commercial use. Internal use is exempt only while the model, its outputs and its capabilities are not made available to any third party, and products above 100 million monthly users or US$20 million monthly revenue must display the model name. And flash-sqlite-4b was tuned for SQLite; test it on your own dialect before relying on it for Snowflake, BigQuery or T-SQL.

Keeping company data confidential during analysis

Analysis touches the most sensitive data a company has: customer records at row level, payroll, margins, unreleased results. Three facts shape the decision about where the model runs.

The schema is itself sensitive. Table and column names describe products, segments and processes. Even a tool that only sends the schema and never the rows discloses something.

Hosted spreadsheet features process data in the vendor’s cloud. Microsoft, for example, says Python in Excel runs the code in a container on the Microsoft Cloud inside your organisation’s compliance boundary, without network access and without keeping the data at rest. That is a reasonable design, but the processing still happens outside your network, and each hosted tool needs its own review.

Results travel too. Even when the warehouse stays put, the rows a query returns go back to the model for interpretation. If the model is hosted, those rows leave.

A model on your own GPUs removes the outside processor from each of these flows. The trade-off is the accuracy gap shown above, which you narrow with schema retrieval, execution feedback and a fine-tune where the dialect allows. Our article on private retrieval across SQL databases and document repositories covers the architecture, and the Academy lesson on retrieval over databases and tables walks through a build.

How VDF AI fits data analysis on your own servers

VDF AI is software you install on your own servers, in a private cloud or in an air-gapped network. VDF AI Router registers Ollama and custom on-prem deployments alongside cloud models, applies allow and deny lists, and its air-gap mode restricts routing to local models only. VDF AI Agents can use any OpenAI-compatible endpoint as an agent’s model, so a Qwen3.8-27B served by vLLM or llama.cpp can sit behind an analysis agent, and agents can be given database query tools and connected data sources.

Two agents in the catalogue map to the workflows in this guide. The AI SQL Analyst Agent writes read-only SQL against your live schema, checks it for join fan-out, null traps and scan cost, and explains in plain language what the query counts. The AI Data Analyst Agent turns a business question into testable claims, checks them with read-only queries, and returns the finding with the query, the rows it returned and the caveats that limit what it can support. Both run over read-only connections. Every run is captured in an audit log of input, retrieval, tool calls and output, and role-based access control comes with every plan. The data and analytics agents hub lists the related reporting, BI and data quality agents.

Sources

Primary documents, leaderboards and model cards, as retrieved on 23 November 2026.


Analysing customer, finance or operations data that cannot leave your network? See how VDF AI Agents run read-only analysis on your own infrastructure, or book a demo.

Frequently asked questions

Which LLM is best for data analysis in 2026?

For hosted use, the frontier closed models lead every public data benchmark we checked. On BIRD's refreshed Mini-Dev set in October 2026, GPT-6.1 and Claude Opus 5.5 both scored about 87% execution accuracy. For data that must stay in-house, Qwen3.8-27B on one 24 or 32 GB GPU is the practical open-weight pick, and a team at DAMENG reached 74.51% on the BIRD test set with it inside a two-model pipeline. In every case the harness that runs and checks the code matters as much as the model.

What is the best LLM for Excel?

No model handles real spreadsheet workflows well yet. On SpreadsheetBench 2, which uses 321 expert-built tasks such as financial models and formula debugging, Claude Opus 4.6 scored 34.89% in March 2026 with the same agent scaffold that gave GPT-5.2 26.79% and the best open model, GLM-5.0, 17.14%. Purpose-built spreadsheet agents score higher, up to 54.51%. Have the model write formulas or Python that you can audit, rather than asking it to read numbers and do the sums itself.

What is the best local LLM for SQL?

A text-to-SQL fine-tune usually beats a general model of the same size. Kwai-AutoSQL-32B, an Apache 2.0 fine-tune of Qwen3-32B, scores 74.12% on BIRD's hidden test set and fits a 32 GB GPU at 4-bit. On small hardware, flash-sqlite-4b reaches 75.68% from a 2.7 GB Q4_K_M file, though it was trained for the SQLite dialect. For warehouses with hundreds of tables and dialect quirks, a general model such as Qwen3.8-27B with schema retrieval and execution feedback is more flexible.

Can ChatGPT or Claude analyze confidential company data?

They can, but the file or query results then leave your network for the provider's servers, so the question becomes whether your contract, data classification and regulators allow that. Enterprise plans restrict training on your data, yet the rows still travel. Customer records, payroll and unreleased financials are the usual blockers. Running an open-weight model on your own GPUs removes the outside processor entirely, at the cost of somewhat lower accuracy on the hardest tasks, which a good harness narrows.

Why does an AI give the wrong total from my data?

Most wrong totals come from logic that runs cleanly. A join to a table with repeated keys multiplies rows, so a sum comes out two or three times too high. A filter on a column with blanks silently drops those rows. A model that reads a pasted table may also skip or invent rows while doing arithmetic in prose. Make the model write SQL or pandas code, run it, check row counts before and after each join, and reconcile one figure against a trusted report.

Do I need a GPU to run an LLM for data analysis locally?

Not for small jobs, but you will want one for daily work. A 4B text-to-SQL model needs under 4 GB at 4-bit with a 32,000-token prompt, which a laptop or CPU can run slowly. A capable general model such as Qwen3.8-27B needs about 19 GB with the same prompt, so a 24 GB GPU or a Mac with 32 GB of unified memory is the realistic floor. Multi-user analysis services sit on 80 GB server GPUs or larger.

Filed under
data analysistext-to-SQLopen-weight modelslocal LLMspreadsheetson-premises AI
On-Prem AI

Plan your on-prem AI deployment

Book an architecture call and we will scope a private, on-prem AI deployment for your environment — integrations, hardware, and governance included.

Keep reading