Open-source text-to-SQL models

These models turn a plain-language question into a SQL query so managers can pull numbers from a database without an analyst. Quality depends heavily on how clearly your table structure is described. Check support for your database engine, the license, and plan for read-only access.

11 open model families in this collection.Updated 22 Sep 2026Open the full catalog with filters
Text to SQLGGUF2024–2025

Prem-1B-SQL

Prem AI · UK

A text-to-SQL model of just 1B parameters, designed to run locally so the database never leaves for external services.

  • Local translation of questions into SQL with no internet access
  • Query hints on modest hardware
  • Embedding into internal analytics tools
Sizes
1B
Hardware
from: Laptop
Commercial use allowedDetails
Text to SQLGGUF2025

SQL-R1

IDEA Research · China

A text-to-SQL model trained with reinforcement learning: it works through the schema and the conditions step by step before producing a query.

  • Database queries for questions with several conditions
  • Reviewing and fixing other people SQL queries
  • An analyst helper inside a BI system
Sizes
3B – 14B
Hardware
from: Laptop
Commercial use allowedDetails
Text to SQL2025

Arctic-Text2SQL-R1

Snowflake · USA

A Snowflake model for turning questions into SQL, trained with reinforcement learning by checking query results. The open 7B version is based on Qwen2.5-Coder.

  • Plain-language questions to a data warehouse
  • Generating SQL for reports and dashboards
  • Checking and fixing analysts' queries
Sizes
7B
Hardware
from: Laptop
Commercial use allowedDetails
Text to SQL2025

XiYanSQL-QwenCoder

Alibaba · China

Alibaba models for turning questions into SQL, based on Qwen2.5-Coder. They work with different SQL dialects; a small 3B version suits modest hardware.

  • Plain-language database questions
  • Queries for different databases (PostgreSQL, MySQL, SQLite)
  • Automating routine reports
Sizes
3B – 32B
Hardware
from: Laptop
Commercial use allowedDetails
Text to SQL2025

OmniSQL

Renmin University of China (RUC) · China

Models for turning questions into SQL, trained on millions of synthetic query examples across different databases. Three sizes for different hardware.

  • Database questions without knowing SQL
  • Generating queries for reports
  • A base for fine-tuning on your own database schema
Sizes
7B – 32B
Hardware
from: Laptop
Commercial use allowedDetails
Text to SQLOllamaNot maintained2023–2024

SQLCoder

Defog · USA

One of the first open models that turn a plain-language question into an SQL query against a database. Available in Ollama, but newer competitors are already stronger.

  • Answering managers' questions from the sales database without an analyst
  • Drafting SQL queries for reports
  • An assistant inside a BI system
Sizes
7B – 70B
Hardware
from: Laptop
Commercial use with conditionsDetails
Text to SQLGGUFNot maintained2024

Chat2DB-SQL

Chat2DB · China

A text-to-SQL model from the open Chat2DB database client: it supports different SQL dialects, with an English and Chinese model card.

  • Turning a question into SQL inside a database client
  • Drafting queries for different database engines
  • Hints for developers working with a schema
Sizes
7B
Hardware
from: Laptop
Commercial use allowedDetails
Text to SQLGGUFNot maintained2024

Natural-SQL

ChatDB · USA

A text-to-SQL model built on DeepSeek-Coder, aimed at complex questions spanning several tables and conditions.

  • Complex queries joining several tables
  • Answering database questions without an analyst
  • Drafting SQL for reports and exports
Sizes
7B
Hardware
from: Laptop
Commercial use with conditionsDetails
Text to SQLOllamaNot maintained2024

DuckDB-NSQL

MotherDuck and Numbers Station · USA

A model for turning questions into SQL, built for the embedded analytics database DuckDB. Available in Ollama, convenient for working with CSV and Parquet locally.

  • Plain-language questions about CSV and Parquet exports
  • DuckDB queries inside analytics scripts
  • Quick analytics on a laptop without a server
Sizes
7B
Hardware
from: Laptop
Commercial use with conditionsDetails
Text to SQLNot maintained2023

CodeS

RUCKBReasoning, Renmin University of China · China

An early line of open text-to-SQL models starting at 1B, including variants fine-tuned for specific database schemas.

  • Turning an employee question into an SQL query
  • Drafting warehouse queries for a report
  • Embedding into a BI dashboard as a helper
Sizes
1B – 15B
Hardware
from: Laptop
Commercial use allowedDetails
Text to SQLGGUFNot maintained2023

NSQL

Numbers Station · USA

One of the first open text-to-SQL lines, including very small versions from 350M that run on an ordinary PC.

  • Turning a question into SQL from a table description
  • Hints while writing queries
  • A local analyst helper with no data leaving the company
Sizes
350M – 7B
Hardware
from: Laptop
Commercial use with conditionsDetails

Collections

Need a model for your task?

An open model can run on your own server: data stays in-house, there is no per-request fee, and the model can be fine-tuned on your documents.

  1. SelectThe model and size for your task and hardware budget
  2. DeployOn your server or in a closed network, with an API
  3. Fine-tuneOn your data, or connect a knowledge base
  4. IntegrateInto your CRM, ERP, bot, website or team chat
Discuss deployment