Run this model with HF Jobs

Run flintglass/PrismSQL-27B-v2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/flintglass/PrismSQL-27B-v2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/flintglass/PrismSQL-27B-v2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/flintglass/PrismSQL-27B-v2. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/flintglass/PrismSQL-27B-v2. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Flintglass PrismSQL-27B-v2

NEW All-Time #1 Text-to-SQL Flagship in the Flintglass Stack (86.19% 2-Suite Live-SQLite Execution Average!) β€” Pure On-Policy Live-SQLite Execution-Verified RLVR (PPO-Clipped GRPO) trained on Apache-2.0 Qwen/Qwen3.8-27B across both standard SQLite workloads and flintglass/PrismSQL-Hard-Corpus (multi-step CTEs, window functions, correlated subqueries, multi-table joins, set operations, and complex aggregations).

Key Highlights over Base & v1:

  • FIRST Flintglass SQL Model to Break 90% on Held-Out OOD PrismSQL-Hard (717 Complex Multi-Table Analytical Queries): 90.38% (+1.12 pts over PrismSQL-27B v1 89.26%, +12.70 pts over PrismSQL-9B-v2 77.68%, 100.0% raw executable SQL, and 30% fewer tokens than Base 152.2 -> 106.4!).
  • 82.00% Live-SQLite Execution Accuracy on Original PrismSQL Test Suite (1,000 Queries) (+2.50 pts over Base 79.50%, beating PrismSQL-27B v1 81.90%, at just 27.9 avg tokens!).
  • NEW All-Time #1 2-Suite Macro Average (1,717 Live-SQLite Queries): 85.01% (Base) -> 85.58% (v1) -> 86.19% (PrismSQL-27B-v2)!

Part of the Flintglass Prism Open-Source Agent & RAG Stack Β· GGUF Quantizations (Q4_K_M, Q5_K_M, Q6_K): flintglass/PrismSQL-27B-v2-GGUF Β· Leaderboard: flintglass/PrismBench-Leaderboard


Verified Live-SQLite Execution Accuracy (1,717 Queries)

Evaluated identically with greedy decoding (temperature=0.0, enable_thinking=False) by executing every generated query inside real SQLite databases and comparing result sets:

Model Original PrismSQL (1,000) OOD PrismSQL-Hard (717) 2-Suite Avg Hard Avg Tokens Hard Raw SQL %
Qwen/Qwen3.8-27B (Base, NoThink) 79.50% 90.52% 85.01% 152.2 β€”
flintglass/PrismSQL-27B (v1) 81.90% 89.26% 85.58% 103.8 β€”
flintglass/PrismSQL-27B-v2 (Ours) 82.00% 90.38% 86.19% 106.4 (-30%) 100.0%

PrismSQL-Hard (717 OOD Queries) Per-Category Breakdown

Category PrismSQL-27B-v2 Exec Accuracy
multiple_joins (160) 96.88%
set_operations (68) 94.12%
correlated_subqueries (129) 91.47%
complex_aggregation (118) 89.83%
cte_multi_step (120) 85.00%
window_functions (122) 83.61%

Quickstart (transformers)

import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer

model_id = "flintglass/PrismSQL-27B-v2"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")

msgs = [
    {"role": "system", "content": "You are an expert SQL engineer. Given a SQLite database schema and a question, output ONLY the executable SQLite SQL query that answers the question. Do not include explanations."},
    {"role": "user", "content": "Database Schema:\nCREATE TABLE orders (id INT, region TEXT, amount REAL, created_at TEXT);\n\nQuestion:\nReturn the top 3 regions by total order amount in 2025."},
]
prompt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True, enable_thinking=False)
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

License

Apache-2.0. Pure on-policy live-SQLite RLVR trained from Apache-2.0 Qwen/Qwen3.8-27B.

Downloads last month
339
Safetensors
Model size
28B params
Tensor type
BF16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for flintglass/PrismSQL-27B-v2

Base model

Qwen/Qwen3.8-27B
Finetuned
(1,158)
this model
Quantizations
2 models

Dataset used to train flintglass/PrismSQL-27B-v2

Space using flintglass/PrismSQL-27B-v2 1

Collection including flintglass/PrismSQL-27B-v2