Cecil-400M-SQL

A 401M parameter model for Postgres and SQLite SQL: autocomplete inside a query, filling a gap in the middle of a query, and English to SQL. It is the model behind the text2sql tool and is meant to be downloaded and run locally by that tool.

Cecil-400M was pre-trained from scratch on about 60B quality-filtered Common Crawl tokens as part of undergraduate research on MinHash dedup thresholds. The name is a nod to Common Crawl (CC). Cecil-400M-SQL is that model fully fine-tuned on about 600,000 SQL examples built from public text-to-SQL datasets and synthetic pairs on app-style schemas. For a stronger model, see Qwen2.5-Coder-3B-SQL.

Files

File Precision Size
Cecil-400M-SQL-BF16.gguf BF16 0.8 GB

Runs in llama.cpp and anything built on it. To make a smaller file, use llama-quantize.

Model details

  • Architecture: Llama-style decoder, 36 layers, hidden size 960, 15 attention heads (5 KV heads)
  • Context length: 2,048 tokens
  • Tokenizer: SmolLM tokenizer (49,152 tokens)

Prompt format

Every task is written as a small repo with a gap to fill in the last file: the schema first, then the current query file with the gap. Since the tokenizer has no FIM tokens, existing tokens stand in for them: <repo_name>, <file_sep>, <issue_start> (prefix), <issue_comment> (suffix) and <issue_closed> (where the answer starts).

<repo_name>my_db
<file_sep>schema.sql
-- dialect: postgres
CREATE TABLE users (id int, name text, age int);
<file_sep>query.sql
<issue_start>-- users over 30
SELECT name FROM users <issue_comment><issue_closed>

The text2sql tool builds these prompts for you.

Evaluation

BIRD Mini-Dev (SQLite), scored by running the generated SQL and comparing its results to the reference query. Prompts longer than the 2,048 token context count as misses.

Task Score
Continue a query 28.7%
Continue a query, with an intent comment 41.7%
Fill the middle of a query 8.6%
Fill the middle, with an intent comment 17.9%
English to SQL (no hints) 5.2%

Limitations

This is a small model with a short context. Large schemas will not fit, and English to SQL is weak. It works best for short completions when the query has a comment saying what it is for.

Downloads last month
-
GGUF
Model size
0.4B params
Architecture
llama
Hardware compatibility
Log In to add your hardware

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support