Text-to-SQL model for local DuckDB analytics
Top 88.6% on sourcepulse
This project provides DuckDB-NSQL, a foundational model (FM) specifically designed for generating SQL queries for local DuckDB analytics. It targets data analysts and engineers who need to interact with DuckDB databases using natural language, offering a streamlined way to query data without extensive SQL knowledge.
How It Works
DuckDB-NSQL is an autoregressive language model trained on a dataset of synthetically generated DuckDB SQL queries and transpiled text-to-SQL pairs. It leverages the NSQL family of models, optimized for SQL generation. The model can be run locally using llama.cpp
for efficient inference, allowing direct integration with DuckDB connections for natural language querying.
Quick Start & Requirements
pip install -r requirements.txt
llama.cpp
(for hosting the model), DuckDB. Model weights available on HuggingFace (e.g., motherduckdb/DuckDB-NSQL-7B-v0.1-GGUF
).examples/
folder demonstrate connecting to DuckDB and querying data.Highlighted Details
eval/
folder.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
The README does not specify the exact license, which may impact commercial adoption. The model is presented as a foundational model for DuckDB SQL analytics, implying potential limitations in handling highly complex or niche SQL constructs not covered in its training data.
9 months ago
Inactive