Updated on Nov 14 to reflect benchmarks for SQLCoder-34B
Defog's SQLCoder is a state-of-the-art LLM for converting natural language questions to SQL queries.
SQLCoder-34B is a 34B parameter model that outperforms
gpt-4-turbo for natural language to SQL generation tasks on our sql-eval framework, and significantly outperforms all popular open-source models.
SQLCoder-34B is fine-tuned on a base CodeLlama model.
The code in this repo (what little there is of it) is Apache-2 licensed. The model weights have a
CC BY-SA 4.0 license. The TL;DR is that you can use and modify the model for any purpose – including commercial use. However, if you modify the weights (for example, by fine-tuning), you must open-source your modified weights under the same license terms.
Defog was trained on more than 20,000 human-curated questions. These questions were based on 10 different schemas. None of the schemas in the training data were included in our evaluation framework.
We classified each generated question into one of 5 categories. The table displays the percentage of questions answered correctly by each model, broken down by category.
python inference.py -q "Question about the sample database goes here" # Sample question: # Do we get more revenue from customers in New York compared to customers in San Francisco? Give me the total revenue for each city, and the difference between the two.
You can also use a demo on our website here
SQLCoder-34B has been tested on a 4xA10 GPU with
float16 weights. You can also load an 8-bit and 4-bit quantized version of the model on consumer GPUs with 20GB or more of memory – like RTX 4090, RTX 3090, and Apple M2 Pro, M2 Max, or M2 Ultra Chips with 20GB or more of memory.
- Open-source the v1 model weights
- Train the model on more data, with higher data variance
- Tune the model further with Reward Modelling and RLHF
- Pretrain a model from scratch that specializes in SQL analysis
- Downloads last month