Text Generation
Transformers
Safetensors
English
qwen2
sql
text-to-sql
bird-sql
qwen2.5-coder
mubit
conversational
text-generation-inference
Instructions to use MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL") 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("MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL") model = AutoModelForCausalLM.from_pretrained("MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL", 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 MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL
- SGLang
How to use MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL 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 "MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL" \ --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": "MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL", "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 "MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL" \ --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": "MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL with Docker Model Runner:
docker model run hf.co/MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL
|
Download README.md from MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL: direct link, hf CLI and curl.
- Browser
- Download file 2.74 kB
-
https://huggingface.co/MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL/resolve/main/README.md
- Command line
-
hf download hf://MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL/README.md
-
curl -L -o README.md https://huggingface.co/MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL/resolve/main/README.md
2.74 kB
| language: | |
| - en | |
| license: apache-2.0 | |
| base_model: Qwen/Qwen2.5-Coder-32B-Instruct | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| tags: | |
| - sql | |
| - text-to-sql | |
| - bird-sql | |
| - qwen2.5-coder | |
| - mubit | |
| # Mubit-Qwen2.5-Coder-32B-SQL | |
| ## Overview | |
| **Mubit-Qwen2.5-Coder-32B-SQL** is a 32B-parameter Text-to-SQL model derived from `Qwen/Qwen2.5-Coder-32B-Instruct` for complex multi-join relational query generation with strict executable SQLite syntax and schema adherence. | |
| ## Key Highlights | |
| - **Beats `XiYanSQL-QwenCoder-32B-2504`:** Achieves **`91.7%`** execution accuracy on `BIRD-SQL Hard` vs. `87.5%` for `XiYanSQL-QwenCoder-32B-2504` (**`+4.2 pp`**). | |
| - **`12.7×` lower off-topic drift:** Holds median off-topic KL to **`0.0061` nats** (`0.1254` P95) vs. `0.0777` (`1.0705` P95) for `XiYanSQL-QwenCoder-32B-2504`. | |
| - **General coding & safety preserved:** Retains **`100%` `LongHealth`**, **`100%` `HarmBench` refusal**, **`0.0%` over-refusal**, and `0.864` `CUAD` F1 in drop-in BF16 weights. | |
| ## Evaluation (`BIRD-SQL Hard` + 5 General & Safety Canaries) | |
| | Model | SQL Exec Accuracy | `CUAD` F1 | `IFEval` | `LongHealth` | `HarmBench` Refuse | Off-Topic `KL` (Med / P95) | | |
| | --- | ---: | ---: | ---: | ---: | ---: | ---: | | |
| | **Mubit-Qwen2.5-Coder-32B-SQL** | **`91.7%`** | `0.864` | `0.812` | **`1.000`** | **`1.000`** | **`0.0061 / 0.1254`** | | |
| | Base `Qwen2.5-Coder-32B-Instruct` | `91.7%` | `0.880` | `0.812` | `1.000` | `1.000` | `0.0000 / 0.0000` | | |
| | `XGenerationLab/XiYanSQL-QwenCoder-32B-2504` | `87.5%` | `0.864` | `0.938` | `1.000` | `1.000` | `0.0777 / 1.0705` | | |
| ## Quickstart | |
| ```bash | |
| vllm serve MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL --dtype bfloat16 --max-model-len 32768 | |
| ``` | |
| ```python | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_id = "MubitLabs/Mubit-Qwen2.5-Coder-32B-SQL" | |
| tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=False) | |
| model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=False) | |
| msgs = [{"role": "user", "content": "Schema: accounts(id, region), invoices(id, account_id, amount_cents). Write a SQLite query for the top 5 EMEA accounts by total invoice dollars."}] | |
| ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device) | |
| print(tok.decode(model.generate(ids, max_new_tokens=256, do_sample=False)[0][ids.shape[-1]:], skip_special_tokens=True)) | |
| ``` | |
| ## Intended Use & Limitations | |
| - **Intended for:** Natural-language-to-SQL interfaces, BI copilots, and automated analytics queries. | |
| - **Not intended for:** Direct execution against production write databases without read-only sandboxing and query validation. | |
| - **License:** **Apache 2.0**. | |