Natural language SQL with Ollama and DuckDB — fully local
No API key. No internet. Your questions, your data, your machine. Pipetable uses a local Ollama model to convert plain English to DuckDB SQL.
Why run everything locally?
Some data is too sensitive to send to any cloud API — even for the brief moment it takes to generate a SQL query. With Pipetable + Ollama, the entire pipeline runs on your hardware: file reading, NL-to-SQL generation, and query execution.
Install Ollama
# macOS brew install ollama # Linux curl -fsSL https://ollama.com/install.sh | sh
Pull a model
ollama pull qwen2.5-coder:1.5b
qwen2.5-coder:1.5b is 986MB and runs well on CPU. For better SQL quality on a machine with enough RAM:
ollama pull qwen2.5-coder:7b # 4.7GB, much better SQL
Start Ollama and run Pipetable
ollama serve & pipetable ./data/
Pipetable auto-detects Ollama when no API key is set. You'll see the active provider in the startup message.
Ask in plain English
> show me total revenue by region Using: sales Thinking..... SELECT region, SUM(revenue) AS total FROM sales GROUP BY region ORDER BY total DESC LIMIT 100 3 row(s) region total ───────────── EU 179100 US 96700 APAC 18000 → piped as _last
Chain queries with _last
Every result is saved as _last. Filter it further without re-reading the original file:
> SELECT region, total FROM _last WHERE total > 50000
Switch between providers
Pipetable auto-detects your provider in priority order:
ANTHROPIC_API_KEY → Claude Haiku (best SQL quality) OPENAI_API_KEY → GPT-4o-mini (or any compatible API) neither → Ollama (local, no key needed)
Use OPENAI_BASE_URL to point at LM Studio, Jan, or any OpenAI-compatible local server.
MIT licensed. Fully offline capable. No telemetry.
Download Free →