Run this model with HF Jobs
Run flintglass/PrismSQL-9B-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-9B-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-9B-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-9B-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-9B-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.
Instructions to use flintglass/PrismSQL-9B-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flintglass/PrismSQL-9B-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="flintglass/PrismSQL-9B-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("flintglass/PrismSQL-9B-v2") model = AutoModelForCausalLM.from_pretrained("flintglass/PrismSQL-9B-v2", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use flintglass/PrismSQL-9B-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "flintglass/PrismSQL-9B-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "flintglass/PrismSQL-9B-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/flintglass/PrismSQL-9B-v2
- SGLang
How to use flintglass/PrismSQL-9B-v2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "flintglass/PrismSQL-9B-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "flintglass/PrismSQL-9B-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "flintglass/PrismSQL-9B-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "flintglass/PrismSQL-9B-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use flintglass/PrismSQL-9B-v2 with Docker Model Runner:
docker model run hf.co/flintglass/PrismSQL-9B-v2
Flintglass PrismSQL-9B-v2
Flintglass PrismSQL-9B-v2 sets a new #1 all-time live-SQLite execution accuracy record in the entire Flintglass PrismSQL stack (82.70% Overall / 76.25% Complex Hard SQL!) β built on Qwen/Qwen3.5-9B via pure on-policy Live-SQLite Execution-Verified GRPO (RLVR) combining our original PrismSQL training pool with our brand-new flintglass/PrismSQL-Hard-Corpus (4,843 dual-model verified analytical multi-table SQLite queries).
- Beats Base
Qwen/Qwen3.5-9Bon BOTH Strictly Held-Out Suites (1,717Live-SQLite Queries!):- PrismSQL Live-SQLite Test (
1,000queries):80.00%->82.70%(+2.70 pts vs Base, +0.70 pts vsPrismSQL-9Bv1 β beating evenPrismSQL-8B82.40%&PrismSQL-27B!) - Complex Hard SQL (joins, aggregations, subqueries, windows, set ops):
68.85%->76.25%(+7.40 pts vs Base, +1.74 pts vs v1!) in just30.0avg tokens! - OOD
PrismSQL-Hard(717hard analytical multi-table queries):74.62%->77.68%(+3.06 pts vs Base,100.0%raw executable SQL!)
- PrismSQL Live-SQLite Test (
- GGUF Quantizations (
llama.cpp/ Ollama / LM Studio):flintglass/PrismSQL-9B-v2-GGUF(Q4_K_M,Q5_K_M,Q6_K,Q8_0β livellama-cliverified!) - License: 100% Apache-2.0.
Benchmark Results (1,717 Live-SQLite Execution-Verified Queries)
1. PrismSQL Live-SQLite Test (1,000 Queries)
| Model | Overall Exec Acc | Complex Hard SQL | Single Join | Multi-Join | Aggregation | Subqueries | Window Funcs | Avg Tok |
|---|---|---|---|---|---|---|---|---|
Qwen/Qwen3.5-9B (Base) |
80.00% |
68.85% |
75.0% |
64.7% |
68.8% |
69.4% |
40.9% |
30.1 |
flintglass/PrismSQL-9B (v1) |
82.00% |
74.51% |
80.7% |
70.6% |
75.9% |
71.4% |
45.5% |
28.6 |
flintglass/PrismSQL-9B-v2 (Ours) |
82.70% (+2.70) |
76.25% (+7.40) |
85.0% (+10.0) |
70.6% (+5.9) |
76.8% (+8.0) |
73.5% (+4.1) |
45.5% (+4.6) |
30.0 |
2. OOD PrismSQL-Hard Analytical Benchmark (717 Multi-Table Queries)
| Model | Overall Exec Acc | Multiple Joins | Set Ops | Complex Agg | Correlated Subqueries | Multi-Step CTEs | Window Funcs | Raw SQL |
|---|---|---|---|---|---|---|---|---|
Qwen/Qwen3.5-9B (Base) |
74.62% |
β | β | β | β | β | β | β |
flintglass/PrismSQL-9B-v2 (Ours) |
77.68% (+3.06) |
86.25% |
82.35% |
76.27% |
75.19% |
74.17% |
71.31% |
100.0% |
Quickstart (transformers & vLLM)
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "flintglass/PrismSQL-9B-v2"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)
messages = [
{"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, customer_id INT, region TEXT, amount REAL, order_date TEXT);\n\nQuestion:\nRank the top 3 customers by total spend within each region using a window function."},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Released under Apache-2.0 by Flintglass Labs.
- Downloads last month
- 301