Back to blog

Full AI Data Analysis Without Internet: How We Built It

QueryVeil Team··4 min read
offlinepwawebllmwebgpulocal-firstarchitecture

TL;DR: QueryVeil now runs full AI-powered data analysis without any internet connection. DuckDB WebAssembly handles SQL, WebLLM runs a language model directly in your browser via WebGPU, and a PWA service worker caches the entire app shell. Zero servers, zero cloud, zero excuses.


Why offline matters for data analysis

The conversation about data privacy usually stops at "don't upload your data." That's table stakes. The real question is: what happens when the WiFi goes out?

If you're a consultant running analysis at a client site with no guest WiFi, or an analyst on a plane reviewing numbers before a board meeting, cloud-dependent tools are useless. ChatGPT, Google Sheets, and even most "privacy-first" tools need a connection.

We decided offline shouldn't be a nice-to-have. It should be a core capability.

The three pillars of offline analysis

1. DuckDB WebAssembly for SQL

DuckDB compiles to WebAssembly and runs entirely in the browser. When you upload a CSV or Parquet file, it's loaded into an in-browser analytical database. SQL queries execute locally against your data at near-native speed.

This part was already solid. DuckDB doesn't need a server. Your data lives in IndexedDB and survives browser restarts.

2. WebLLM for AI without a server

This is the piece that makes offline AI analysis possible. WebLLM runs large language models directly in the browser using WebGPU — the GPU acceleration API available in Chrome and Edge.

We support several models:

  • Llama 3.2 1B (~800MB download) — fast, good for simple queries
  • Llama 3.2 3B (~2GB) — our default, handles complex analytical questions
  • Llama 3.1 8B (~4GB) — highest quality, needs more VRAM

Once downloaded, the model is cached in the browser's Cache API. The next time you open QueryVeil — even offline — it loads instantly from cache.

In standard chat, the AI generates SQL from your schema only (table and column names + types) — no data rows are sent. In deep analysis mode, query results (up to 100 rows per step) are also sent so the AI can reason across multiple steps. With local AI, nothing leaves your device at all.

3. PWA service worker for the app shell

The third piece is a service worker that precaches the entire application — JavaScript bundles, CSS, HTML, icons, and fonts. When you navigate to QueryVeil offline, the service worker serves everything from cache.

We use Workbox (via @vite-pwa/nuxt) with:

  • Precaching for all build assets (166 entries)
  • Runtime caching for CDN resources (CacheFirst)
  • API route denylist so auth and backend calls don't get intercepted

Preparing for offline

In Settings > AI Providers, there's a "Prepare for Offline" button that proactively downloads your selected WebLLM model. Once you see the green "Cached" indicator, you're set.

The workflow looks like:

  1. Upload your data while online (or load from a local file — that works anytime)
  2. Hit "Prepare for Offline" to cache the AI model
  3. Go offline. Ask questions. Get SQL. See results. All local.

The offline indicator

When you lose connectivity, a subtle amber banner appears: "You're offline — your data and local AI still work normally."

This is deliberate. We don't want to alarm users. The app is designed to work offline, so losing internet shouldn't feel like an error state. The banner dismisses automatically when you're back online.

What still needs internet

To be transparent about the boundaries:

  • Supabase auth — Login requires a connection. But once authenticated, your session token persists.
  • Cloud AI (OpenRouter) — Only if you're using cloud models instead of WebLLM/Ollama.
  • Stripe billing — Subscription management.
  • Data from URLs — If you're loading data from a remote URL. Local files work fine offline.

Everything else — schema detection, SQL generation, query execution, chart rendering, data briefs, report building — works without internet.

Why this matters competitively

ChatGPT, Claude, and Gemini are all cloud-only. They can't run a SQL query if you're offline. They can't even show you a loading screen.

QueryVeil is the only AI data tool that genuinely works on an airplane, at a secure client site, or in a SCIF. That's not a feature — it's a different architectural philosophy.


Try it: open QueryVeil, upload a file, prepare your model for offline, then disconnect. The whole analysis workflow works. That's the offline fortress.

Related: Privacy data analytics explained | QueryVeil for consultants

Ready to try it?

Analyze your data without uploading it anywhere. Try the live demo with sample data or sign up free.