Text Generation
Transformers
Safetensors
English
qwen3_5_moe
image-text-to-text
flintglass
prismsql
qwen3
Mixture of Experts
text-to-sql
sql
sqlite
rlvr
grpo
apache-2.0
conversational
Instructions to use flintglass/PrismSQL-35B-A3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flintglass/PrismSQL-35B-A3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="flintglass/PrismSQL-35B-A3B") 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-35B-A3B") model = AutoModelForMultimodalLM.from_pretrained("flintglass/PrismSQL-35B-A3B", 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-35B-A3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "flintglass/PrismSQL-35B-A3B" # 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-35B-A3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/flintglass/PrismSQL-35B-A3B
- SGLang
How to use flintglass/PrismSQL-35B-A3B 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-35B-A3B" \ --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-35B-A3B", "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-35B-A3B" \ --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-35B-A3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use flintglass/PrismSQL-35B-A3B with Docker Model Runner:
docker model run hf.co/flintglass/PrismSQL-35B-A3B
Release Flintglass PrismSQL-35B-A3B BF16 part 1 (74.73% Complex SQL #1, +11.77 pts Multi-Joins, 3B-active MoE)
d5188bd verified |
Download README.md from flintglass/PrismSQL-35B-A3B: direct link, hf CLI and curl.
- Browser
- Download file 3.57 kB
-
https://huggingface.co/flintglass/PrismSQL-35B-A3B/resolve/main/README.md
- Command line
-
hf download hf://flintglass/PrismSQL-35B-A3B/README.md
-
curl -L -o README.md https://huggingface.co/flintglass/PrismSQL-35B-A3B/resolve/main/README.md
3.57 kB
| language: | |
| - en | |
| license: apache-2.0 | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| base_model: Qwen/Qwen3.6-35B-A3B | |
| tags: | |
| - flintglass | |
| - prismsql | |
| - qwen3 | |
| - moe | |
| - text-to-sql | |
| - sql | |
| - sqlite | |
| - rlvr | |
| - grpo | |
| - apache-2.0 | |
| # Flintglass PrismSQL-35B-A3B | |
| **Ultra-Fast 3B-Active MoE Text-to-SQL RLVR Specialist on Apache-2.0 `Qwen/Qwen3.6-35B-A3B` (35B Total / 3B Active Parameters)** — achieving **#1 Complex SQL Execution Accuracy in the Flintglass Stack (`74.73%` across 459 non-basic SQL schemas, `+2.62 pts`)**, **`64.14%` Macro Complexity (+2.15 pts)**, **`+11.77 pts` on Multi-Joins (`64.71%`)**, **`+5.00 pts` on Single Joins (`84.29%`)**, and crisp **`27.1` average tokens (`-13%`)** at **3B-class inference speed**! | |
| > **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/PrismSQL-35B-A3B-GGUF`](https://huggingface.co/flintglass/PrismSQL-35B-A3B-GGUF) (`Q4_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.6-35B-A3B` (Base) | **`flintglass/PrismSQL-35B-A3B`** | Delta | | |
| |---|---:|---:|---:|---:| | |
| | **Overall SQLite Execution Accuracy** | **1,000** | 81.10% | **82.00%** | **+0.90 pts** | | |
| | **Complex SQL (Non-Basic, 459 tasks)** | **459** | 72.11% | **74.73%** | **+2.62 pts** | | |
| | **Macro Complexity Avg (7 cats)** | **1,000** | 61.99% | **64.14%** | **+2.15 pts** | | |
| | `single join` | 140 | 79.29% | **84.29%** | **+5.00 pts** | | |
| | `multiple_joins` | 17 | 52.94% | **64.71%** | **+11.77 pts** | | |
| | `subqueries` | 49 | 69.39% | **71.43%** | **+2.04 pts** | | |
| | `aggregation` | 224 | 74.11% | **75.45%** | **+1.34 pts** | | |
| | `set operations` | 7 | 28.57% | 28.57% | 0.00 pts | | |
| | `basic SQL` | 541 | **88.72%** | 88.17% | -0.55 pts | | |
| | `window functions` | 22 | **40.91%** | 36.36% | -4.55 pts | | |
| | **Raw Clean SQL Rate** | 1,000 | 86.4% | **88.4%** | **+2.0 pts** | | |
| | **Avg Output Tokens** | 1,000 | 31.3 | **27.1** | **-13%** | | |
| --- | |
| ## Quickstart (`transformers`) | |
| ```python | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_id = "flintglass/PrismSQL-35B-A3B" | |
| 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.6-35B-A3B` (Apache-2.0, 35B total / 3B active MoE) | |
| - **Algorithm:** Pure On-Policy PPO-Clipped GRPO (`r=32`, 50 steps, `K=8` rollouts/prompt, live in-memory SQLite execution reward). Zero synthetic SFT, zero proprietary distillation. | |
| - **License:** Apache-2.0 | |