defog/sqlcoder-7b-2
Hugging Face
TEXT GENERATIONConcurrency Cost:1Model Size:7BQuant:FP8Ctx Length:4kPublished:Feb 5, 2024License:cc-by-sa-4.0Architecture:Transformer0.4K Open Weights Warm

The defog/sqlcoder-7b-2 is a 7 billion parameter large language model developed by Defog, Inc., fine-tuned from CodeLlama-7B. This model specializes in natural language to SQL generation, excelling particularly in complex SQL operations like joins. It is designed to help non-technical users understand data within SQL databases by converting natural language questions into accurate SQL queries.

Loading preview...

Overview

defog/sqlcoder-7b-2 is a 7 billion parameter language model developed by Defog, Inc., specifically designed for natural language to SQL generation. It is fine-tuned from CodeLlama-7B and was updated in February 2024 for improved performance, especially concerning SQL joins.

Key Capabilities

  • Natural Language to SQL Conversion: Translates user questions into executable SQL queries.
  • Optimized for Joins: The latest model weights significantly enhance its ability to handle SQL queries involving joins.
  • Database Schema Awareness: Generates queries based on provided database schema DDL statements.
  • Evaluation Framework: Evaluated using SQL-Eval, a PostgreSQL-based framework developed by Defog.

Performance Highlights

On the SQL-Eval benchmark, sqlcoder-7b-2 demonstrates strong performance across various SQL categories:

  • Date: 96%
  • Group By: 91.4%
  • Order By: 94.3%
  • Ratio: 91.4%
  • Join: 94.3%
  • Where: 77.1%

Intended Use Cases

This model is primarily intended as an analytics tool for non-technical users to query data in SQL databases. It is crucial to note that it is designed for use with read-only access to databases, as it has not been trained to reject malicious requests from users with write access.