Text Generation
Transformers
Safetensors
English
qwen3_5
image-text-to-text
flintglass
prismsql
qwen3
text-to-sql
sql
sqlite
rlvr
grpo
apache-2.0
conversational
Instructions to use flintglass/PrismSQL-27B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flintglass/PrismSQL-27B with Transformers:
# 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use flintglass/PrismSQL-27B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "flintglass/PrismSQL-27B" # 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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/flintglass/PrismSQL-27B
- SGLang
How to use flintglass/PrismSQL-27B 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" \ --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", "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" \ --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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use flintglass/PrismSQL-27B with Docker Model Runner:
docker model run hf.co/flintglass/PrismSQL-27B
Release Flintglass PrismSQL-27B BF16 part 1 (81.90% SQLite Exec +2.40 pts, 73.86% Complex SQL +5.01 pts, +84.5 pts Raw SQL)
55fcadb verified |
Download README.md from flintglass/PrismSQL-27B: direct link, hf CLI and curl.
- Browser
- Download file 3.59 kB
-
https://huggingface.co/flintglass/PrismSQL-27B/resolve/main/README.md
- Command line
-
hf download hf://flintglass/PrismSQL-27B/README.md
-
curl -L -o README.md https://huggingface.co/flintglass/PrismSQL-27B/resolve/main/README.md
3.59 kB
| language: | |
| - en | |
| license: apache-2.0 | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| base_model: Qwen/Qwen3.8-27B | |
| tags: | |
| - flintglass | |
| - prismsql | |
| - qwen3 | |
| - text-to-sql | |
| - sql | |
| - sqlite | |
| - rlvr | |
| - grpo | |
| - apache-2.0 | |
| # 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`](https://huggingface.co/flintglass/PrismAgent-27B) · [`PrismVerify-27B`](https://huggingface.co/flintglass/PrismVerify-27B) · [`PrismSQL-27B`](https://huggingface.co/flintglass/PrismSQL-27B) · **GGUF Quantizations:** [`flintglass/PrismSQL-27B-GGUF`](https://huggingface.co/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`) | |
| ```python | |
| 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 | |