defog/sqlcoder-7b
Defog/sqlcoder-7b is a 7 billion parameter language model developed by Defog, fine-tuned on a Mistral-7B base, specifically designed for converting natural language questions into SQL queries. This model demonstrates strong performance in SQL generation tasks, outperforming gpt-3.5-turbo on novel datasets and achieving competitive results against larger models like gpt-4 when fine-tuned. It is optimized for accurate SQL query generation across various categories, including date, group_by, order_by, ratio, join, and where clauses.
Loading preview...
Overview
defog/sqlcoder-7b is a 7 billion parameter model, fine-tuned on a Mistral-7B base, developed by Defog for natural language to SQL query generation. It was trained on over 20,000 human-curated questions across 10 distinct schemas, none of which were included in its evaluation framework. The model is licensed under CC BY-SA 4.0, allowing for commercial use and modification, provided modified weights are open-sourced under the same terms.
Key Capabilities
- Natural Language to SQL Conversion: Excels at transforming natural language questions into precise SQL queries.
- Performance: Outperforms
gpt-3.5-turboon Defog'ssql-evalframework for novel datasets and can surpassgpt-4when fine-tuned on specific schemas. - Category-Specific Accuracy: Demonstrates robust performance across various SQL query categories, including date, group_by, order_by, ratio, join, and where clauses.
- Hardware Compatibility: Can run on A100 40GB GPUs with
bfloat16weights, or on consumer GPUs with 20GB+ memory (e.g., RTX 4090, RTX 3090, Apple M2 Pro/Max/Ultra) using 8-bit or 4-bit quantization.
When to Use This Model
This model is ideal for applications requiring accurate and efficient conversion of natural language into SQL queries. It is particularly well-suited for:
- Database Interaction: Building interfaces that allow users to query databases using plain English.
- Data Analysis Tools: Integrating natural language querying capabilities into business intelligence or data exploration platforms.
- Benchmarking: As a strong open-source baseline for SQL generation tasks, especially when comparing against proprietary models.