Text Generation
Transformers
Safetensors
English
gpt_oss
flintglass
prismsql
gpt-oss
Mixture of Experts
text-to-sql
sql
sqlite
rlvr
grpo
apache-2.0
conversational
Instructions to use flintglass/GPT-OSS-20B-PrismSQL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flintglass/GPT-OSS-20B-PrismSQL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="flintglass/GPT-OSS-20B-PrismSQL") 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/GPT-OSS-20B-PrismSQL") model = AutoModelForCausalLM.from_pretrained("flintglass/GPT-OSS-20B-PrismSQL", 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/GPT-OSS-20B-PrismSQL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "flintglass/GPT-OSS-20B-PrismSQL" # 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/GPT-OSS-20B-PrismSQL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/flintglass/GPT-OSS-20B-PrismSQL
- SGLang
How to use flintglass/GPT-OSS-20B-PrismSQL 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/GPT-OSS-20B-PrismSQL" \ --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/GPT-OSS-20B-PrismSQL", "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/GPT-OSS-20B-PrismSQL" \ --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/GPT-OSS-20B-PrismSQL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use flintglass/GPT-OSS-20B-PrismSQL with Docker Model Runner:
docker model run hf.co/flintglass/GPT-OSS-20B-PrismSQL
Release Flintglass GPT-OSS-20B-PrismSQL BF16 (82.20% SQLite Exec, +3.49 pts Complex SQL, +11.76 pts Multi-Joins)
da8638e verified |
Download README.md from flintglass/GPT-OSS-20B-PrismSQL: direct link, hf CLI and curl.
- Browser
- Download file 3.52 kB
-
https://huggingface.co/flintglass/GPT-OSS-20B-PrismSQL/resolve/main/README.md
- Command line
-
hf download hf://flintglass/GPT-OSS-20B-PrismSQL/README.md
-
curl -L -o README.md https://huggingface.co/flintglass/GPT-OSS-20B-PrismSQL/resolve/main/README.md
3.52 kB
| language: | |
| - en | |
| license: apache-2.0 | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| base_model: openai/gpt-oss-20b | |
| tags: | |
| - flintglass | |
| - prismsql | |
| - gpt-oss | |
| - moe | |
| - text-to-sql | |
| - sql | |
| - sqlite | |
| - rlvr | |
| - grpo | |
| - apache-2.0 | |
| # Flintglass GPT-OSS-20B-PrismSQL | |
| **Pure On-Policy Live-SQLite Execution-Verified Text-to-SQL RLVR on Apache-2.0 `openai/gpt-oss-20b` (21B Total / 3.6B Active MoE)** — achieving **`82.20%` Overall SQLite Execution Accuracy (+1.90 pts)**, **`73.64%` Complex SQL (+3.49 pts)**, **`63.89%` Macro Complexity (+3.02 pts)**, **`+11.76 pts` on Multi-Joins**, **`+6.12 pts` on Subqueries**, **`+5.00 pts` on Single Joins**, and **`-36%` output tokens (`65.6 -> 42.1`)**! | |
| > **Part of the [Flintglass Prism Open-Source Agent & RAG Stack](https://huggingface.co/collections/flintglass/flintglass-prism-open-agent-and-rag-stack-6b0df22104aefbb7e8d4fe11)** · **GGUF Quantizations:** [`flintglass/GPT-OSS-20B-PrismSQL-GGUF`](https://huggingface.co/flintglass/GPT-OSS-20B-PrismSQL-GGUF) (`Q4_K_M`, `Q5_K_M`) | |
| --- | |
| ## 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: | |
| | SQL Category | Tasks | `openai/gpt-oss-20b` (Base) | **`flintglass/GPT-OSS-20B-PrismSQL`** | Delta | | |
| |---|---:|---:|---:|---:| | |
| | **Overall SQLite Execution Accuracy** | **1,000** | 80.30% | **82.20%** | **+1.90 pts** | | |
| | **Complex SQL (Non-Basic, 459 tasks)** | **459** | 70.15% | **73.64%** | **+3.49 pts** | | |
| | **Macro Complexity Avg (7 cats)** | **1,000** | 60.87% | **63.89%** | **+3.02 pts** | | |
| | `basic SQL` | 541 | 88.91% | **89.46%** | +0.55 pts | | |
| | `aggregation` | 224 | 72.32% | **74.55%** | **+2.23 pts** | | |
| | `single join` | 140 | 76.43% | **81.43%** | **+5.00 pts** | | |
| | `subqueries` | 49 | 67.35% | **73.47%** | **+6.12 pts** | | |
| | `multiple_joins` | 17 | 47.06% | **58.82%** | **+11.76 pts** | | |
| | `set operations` | 7 | 28.57% | 28.57% | 0.00 pts | | |
| | `window functions` | 22 | **45.45%** | 40.91% | -4.54 pts | | |
| | **Avg Output Tokens** | 1,000 | 65.6 | **42.1** | **-36% (1.56× faster)** | | |
| --- | |
| ## Quickstart (`transformers`) | |
| ```python | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_id = "flintglass/GPT-OSS-20B-PrismSQL" | |
| 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, created_at TEXT);\nCREATE TABLE customers(id INT, country TEXT);\n\nQuestion: Top 5 countries by total revenue in 2026."}, | |
| ] | |
| prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, reasoning_effort="low") | |
| 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=False)) | |
| ``` | |
| ## Training & Provenance | |
| - **Base Model:** `openai/gpt-oss-20b` (Apache-2.0, 21B total / 3.6B active MoE, dequantized cleanly from MXFP4 to native BF16 with all 336/336 LoRA tensors merged). | |
| - **Algorithm:** Pure On-Policy PPO-Clipped GRPO (`r=32`, `alpha=32`, 40 steps, `K=8` rollouts/prompt, live in-memory SQLite execution reward). | |
| - **License:** Apache-2.0 | |