Image-Text-to-Text
Transformers
Safetensors
inkling2_loop
conversational
Mixture of Experts
modelopt
Instructions to use flintglass/Inkling-2-Mini-PrismSQL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flintglass/Inkling-2-Mini-PrismSQL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="flintglass/Inkling-2-Mini-PrismSQL") 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/Inkling-2-Mini-PrismSQL") model = AutoModelForMultimodalLM.from_pretrained("flintglass/Inkling-2-Mini-PrismSQL", 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/Inkling-2-Mini-PrismSQL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "flintglass/Inkling-2-Mini-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/Inkling-2-Mini-PrismSQL", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/flintglass/Inkling-2-Mini-PrismSQL
- SGLang
How to use flintglass/Inkling-2-Mini-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/Inkling-2-Mini-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/Inkling-2-Mini-PrismSQL", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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/Inkling-2-Mini-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/Inkling-2-Mini-PrismSQL", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use flintglass/Inkling-2-Mini-PrismSQL with Docker Model Runner:
docker model run hf.co/flintglass/Inkling-2-Mini-PrismSQL
Add Flintglass Inkling-2-Mini-PrismSQL model card (66.00% Macro SQL #1, zero regression across all 7 categories, -58% tokens)
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172---language: - en - multilinguallicense: apache-2.0base_model: thinkingmachines/Inkling-2-Minipipeline_tag: text-generationlibrary_name: transformerstags: - text-to-sql - sql - sqlite - code - rlvr - grpo - inkling-2 - flintglass---
# Flintglass Inkling-2-Mini-PrismSQL
**Flintglass Inkling-2-Mini-PrismSQL** is an **Apache-2.0** 26.4B MoE looped-transformer Text-to-SQL specialist achieving **#1 Macro Complexity Accuracy (66.00%, +4.81 pts)** with **zero regression across ALL 7 SQL complexity categories** (**+13.6 pts** window functions `50.0%`, **+6.5 pts** single join, **+5.9 pts** multi-join, **81.00%** overall execution accuracy) while cutting output tokens by **-58%** (`266 -> 113`)!
Trained via **Pure On-Policy Live SQLite Execution-Verified GRPO (PPO-Clipped RLVR)** — every single training rollout is executed inside an isolated in-memory SQLite engine against the table DDL and compared for normalized result-set equivalence against ground-truth queries (**zero LLM-as-a-judge**, **zero synthetic proprietary distillation**, 100% Apache-2.0 training data).
- **GGUF Quantizations (`llama.cpp` / Ollama / LM Studio):** [`flintglass/Inkling-2-Mini-PrismSQL-GGUF`](https://huggingface.co/flintglass/Inkling-2-Mini-PrismSQL-GGUF)- **Standalone PEFT LoRA Adapter:** Included directly inside this repository under [`lora/`](./lora/).- **Flintglass PrismSQL Family:** [`PrismSQL-9B`](https://huggingface.co/flintglass/PrismSQL-9B) · [`PrismSQL-4B`](https://huggingface.co/flintglass/PrismSQL-4B) · [`Inkling-2-Mini-PrismSQL`](https://huggingface.co/flintglass/Inkling-2-Mini-PrismSQL)
---
## Live In-Memory SQLite Execution Evaluation (1,000 Strictly Held-Out Queries)
All models evaluated identically (`temperature=0`, deterministic live SQLite DDL + INSERT + SELECT result equivalence):
| Model (All Apache 2.0) | **Overall SQLite Exec** | **Complex SQL** (Non-Basic) | **Macro Complexity** | **Single Join** | **Multi-Join** | **Aggregation** | **Subqueries** | **Window Fns** | **Avg Tokens** ||---|---:|---:|---:|---:|---:|---:|---:|---:|---:|| `Qwen/Qwen3.5-4B` (Base) | 78.80% | 68.41% | 61.84% | 70.0% | 58.8% | 71.0% | 71.4% | 45.5% | 31.2 || `Qwen/Qwen3.5-9B` (Base) | 80.00% | 68.85% | 64.44% | 75.0% | 64.7% | 68.8% | 69.4% | 40.9% | 30.1 || `Inkling-2-Mini` (Base) | 77.50% | 67.10% | 61.19% | 72.1% | 52.9% | 68.3% | 69.4% | 36.4% | 266.3 || [`flintglass/PrismSQL-4B`](https://huggingface.co/flintglass/PrismSQL-4B) (4.5B) | **80.60%** (+1.80) | **71.24%** (+2.83) | **63.64%** (+1.80) | **77.9%** | **64.7%** | 71.4% | **73.5%** | 40.9% | **28.1** || [`flintglass/Inkling-2-Mini-PrismSQL`](https://huggingface.co/flintglass/Inkling-2-Mini-PrismSQL) (26.4B MoE) | **81.00%** (+3.50) | **71.68%** (+4.58) | **66.00%** (+4.81) | **78.6%** | **58.8%** | **71.4%** | **71.4%** | **50.0%** | **113.0** (-58%) || [`flintglass/PrismSQL-9B`](https://huggingface.co/flintglass/PrismSQL-9B) (9B) | **82.00%** (+2.00) | **74.51%** (+5.66) | **65.86%** (+1.42) | **80.7%** | **70.6%** | **75.9%** | **71.4%** | **45.5%** | **28.6** |
---
## Quickstart (`transformers`)
```pythonimport torchfrom transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "flintglass/Inkling-2-Mini-PrismSQL"tok = AutoTokenizer.from_pretrained(model_id)model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
prompt = ( "Given the following SQLite schema:\n" "CREATE TABLE departments (id INT PRIMARY KEY, name TEXT);\n" "CREATE TABLE employees (id INT PRIMARY KEY, dept_id INT, salary REAL);\n\n" "Write a valid SQLite SELECT query to return the top 5 departments by average salary. Output ONLY the SQL query.")msgs = [{"role": "user", "content": prompt}]text = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)inputs = tok(text, 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. Built by **Flintglass Labs**.README.mdAdded+72