DuckDB-NSQL is a text-to-SQL model with 7 billion parameters, specifically created for generating SQL queries. It builds upon Meta’s original Llama-2 7B model, undergoing additional pre-training using a dataset of general SQL queries. Subsequently, it is fine-tuned on a dataset containing DuckDB text-to-SQL pairs.
This diagram shows you how to use ollama Python client library to call REST APIs to convert text to SQL.