How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="flintglass/PrismSQL-27B")
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")
model = AutoModelForMultimodalLM.from_pretrained("flintglass/PrismSQL-27B", 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]:]))
Quick Links

Flintglass PrismSQL-27B

Flagship 27B Pure On-Policy Live-SQLite Execution-Verified Text-to-SQL Specialist on Apache-2.0 Qwen/Qwen3.8-27B β€” achieving 81.90% Overall SQLite Execution Accuracy (+2.40 pts), 73.86% Complex SQL (+5.01 pts), 65.03% Macro Complexity (+4.02 pts), +14.29 pts on Set Operations, +7.59 pts on Aggregations, +5.88 pts on Multi-Joins, +84.5 pts Clean Raw SQL (4.0% -> 88.5%), and -27% output tokens (37.1 -> 27.0)!

Completes the Flagship Flintglass 27B Trio: PrismAgent-27B Β· PrismVerify-27B Β· PrismSQL-27B Β· GGUF Quantizations: flintglass/PrismSQL-27B-GGUF (Q4_K_M, Q5_K_M, Q6_K)


Verified Zero-Leakage Live-SQLite Execution Results (1,000 Held-Out Schemas)

Every prediction is executed against an isolated in-memory SQLite database populated with schema DDL + sample rows, and verified by normalized result-set equivalence against gold SQL (enable_thinking=False, greedy decoding):

SQL Category Tasks Qwen/Qwen3.8-27B (Base) flintglass/PrismSQL-27B Delta
Overall SQLite Execution Accuracy 1,000 79.50% 81.90% +2.40 pts
Complex SQL (Non-Basic, 459 tasks) 459 68.85% 73.86% +5.01 pts
Macro Complexity Avg (7 cats) 1,000 61.01% 65.03% +4.02 pts
aggregation 224 67.41% 75.00% +7.59 pts
set operations 7 28.57% 42.86% +14.29 pts
multiple_joins 17 52.94% 58.82% +5.88 pts
single join 140 79.29% 83.57% +4.28 pts
basic SQL 541 88.54% 88.72% +0.18 pts
window functions 22 40.91% 40.91% 0.00 pts
subqueries 49 69.39% 65.31% -4.08 pts
Clean Raw SQL Rate 1,000 4.0% 88.5% +84.5 pts
Avg Output Tokens 1,000 37.1 27.0 -27%

Quickstart (transformers)

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

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

messages = [
    {"role": "system", "content": "Return ONLY a valid SQLite SELECT query."},
    {"role": "user", "content": "Schema:\nCREATE TABLE orders(id INT, customer_id INT, total REAL);\nCREATE TABLE customers(id INT, country TEXT);\n\nQuestion: Top 5 countries by total revenue."},
]
prompt = tok.apply_chat_template(messages, 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=192, do_sample=False)
print(tok.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))

Training & Provenance

  • Base Model: Qwen/Qwen3.8-27B (Apache-2.0)
  • Algorithm: Pure On-Policy PPO-Clipped GRPO (r=32, 25 steps, K=8 rollouts/prompt, live in-memory SQLite execution reward). Zero synthetic SFT, zero proprietary distillation.
  • License: Apache-2.0
Downloads last month
-
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

Base model

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

Collection including flintglass/PrismSQL-27B