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.
Instructions to use flintglass/PrismSQL-27B-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flintglass/PrismSQL-27B-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="flintglass/PrismSQL-27B-v2") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("flintglass/PrismSQL-27B-v2") model = AutoModelForMultimodalLM.from_pretrained("flintglass/PrismSQL-27B-v2", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use flintglass/PrismSQL-27B-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "flintglass/PrismSQL-27B-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-27B-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/flintglass/PrismSQL-27B-v2
- SGLang
How to use flintglass/PrismSQL-27B-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-27B-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-27B-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-27B-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-27B-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use flintglass/PrismSQL-27B-v2 with Docker Model Runner:
docker model run hf.co/flintglass/PrismSQL-27B-v2
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 ptsoverPrismSQL-27Bv189.26%,+12.70 ptsoverPrismSQL-9B-v277.68%,100.0%raw executable SQL, and30%fewer tokens than Base152.2 -> 106.4!). 82.00%Live-SQLite Execution Accuracy on OriginalPrismSQLTest Suite (1,000 Queries) (+2.50 ptsover Base79.50%, beatingPrismSQL-27Bv181.90%, at just27.9avg tokens!).- NEW All-Time #1 2-Suite Macro Average (
1,717Live-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