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-turbo on Defog's sql-eval framework for novel datasets and can surpass gpt-4 when 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
bfloat16 weights, 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.