Skip to page content
SAVRN
Search Plan a project

Open-weight model · Text generation

XiYanSQL-QwenCoder-14B-2504

by XGenerationLab XGenerationLab/XiYanSQL-QwenCoder-14B-2504

XiYanSQL-QwenCoder-14B-2504 is an open-weight model for text generation from XGenerationLab, released under Apache License 2.0. It has 14.8B parameters and a 32,768-token context. At 16-bit it needs about 35.4 GB of GPU memory, which fits on 1x MI300X from $1.85 an hour, at the lowest prices in the SAVRN Index. It draws 1.6k downloads a month.

We are excited to release the XiYanSQL-QwenCoder-2504 version, our latest SQL generation model. This version continues to optimize upon the previous version, delivering enhanced performance.

Parameters14.8B
Context32,768
Weights29.5 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads1.6k

Runs On

What it takes to serve XiYanSQL-QwenCoder-14B-2504 (14.8B parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 29.5 GB 35.4 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 14.8 GB 17.7 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 7.4 GB 8.9 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Oct 22, 2026.

XiYanSQL-QwenCoder-14B-2504 on every accelerator the SAVRN Index prices, at every precision

Model Card

By XGenerationLab, published under apache-2.0, revision ddf72719ac2e.

We are excited to release the XiYanSQL-QwenCoder-2504 version, our latest SQL generation model. This version continues to optimize upon the previous version, delivering enhanced performance. - Our model incorporates important explorations combining fine-tuning and GRPO training, leveraging the post-training strategies of GRPO without a thinking process, achieving both efficiency and accuracy in SQL generation. - It demonstrates impressive performance and supports multiple dialects, ready to use out of the box. - Improved generalization capabilities, excelling on different dialects and out-of-domain datasets. In this evaluation, we have also added a real-world SQL benchmark (the DW test…

Read XGenerationLab's full model card

Important Links

Github| ModelScope| XiYan-SQL| 析言GBI| Paper

Introduction

We are excited to release the XiYanSQL-QwenCoder-2504 version, our latest SQL generation model. This version continues to optimize upon the previous version, delivering enhanced performance. - Our model incorporates important explorations combining fine-tuning and GRPO training, leveraging the post-training strategies of GRPO without a thinking process, achieving both efficiency and accuracy in SQL generation. - It demonstrates impressive performance and supports multiple dialects, ready to use out of the box. - Improved generalization capabilities, excelling on different dialects and out-of-domain datasets.

In this evaluation, we have also added a real-world SQL benchmark (the DW test set), which serves as an important internal evaluation baseline. This test set includes thousands of complex queries from real scenarios in both PostgreSQL and MySQL dialects, effectively reflecting the model's performance across multiple dialects and out-of-domain data.

Model Downloads

Model Download Latest
XiYanSQL-QwenCoder-3B HuggingFaceModelscope
XiYanSQL-QwenCoder-7B HuggingFaceModelscope
XiYanSQL-QwenCoder-14B HuggingFaceModelscope
XiYanSQL-QwenCoder-32B HuggingFaceModelscope

Performance

The XiYanSQL-QwenCoder models, as multi-dialect SQL base models, demonstrating robust SQL generation capabilities. The following presents the evaluation results at the time of release. We conducted a comprehensive evaluation of the model's performance under two schema formats, M-Schema, and original DDL, using the BIRD and Spider as SQLite benchmarks in the Text-to-SQL domain, as well as DW benchmarks for PostgreSQL and MySQL dialects.

Model name Size BIRD Dev@M-Schema BIRD Dev@DDL Spider Test@M-Schema Spider Test@DDL DW PostgreSQL@M-Schema DW MySQL@M-Schema
GPT-4o-0806 UNK 58.47% 54.82% 82.89% 78.45% 46.79% 57.77%
GPT-4.1-0414 UNK 59.39% 54.11% 84.45% 79.86% 54.29% 63.18%
Claude3.5-sonnet-1022 UNK 53.32% 50.46% 76.27% 73.04% 55.22% 52.84%
Claude3.7-sonnet UNK 54.82% 49.22% 78.04% 74.66% 53.23% 54.61%
Gemini-1.5-Pro UNK 61.34% 57.89% 85.11% 84.00% 52.78% 62.78%
DeepSeek-V2.5-1210 236B 55.74% 55.61% 82.08% 80.57% 45.74% 52.18%
DeepSeek-V3 685B 59.58% 56.71% 81.52% 79.91% 52.56% 55.95%
DeepSeek-R1 685B 58.15% 55.61% 80.72% 78.85% 60.56% 62.00%
DeepSeek-R1-Distill-Qwen-32B 32B 50.65% 48.31% 78.65% 77.33% 37.22% 44.72%
Deepseek-Coder-33B-Instruct 33B 47.52% 44.72% 72.39% 62.0% 31.48% 36.17%
OmniSQL-32B 32B 60.37% 55.87% 85.16% 83.19% 38.19% 42.34%
XiYanSQL-QwenCoder-3B-2502 3B 53.52% 52.54% 83.34% 79.10% 34.75% 35.62%
XiYanSQL-QwenCoder-3B-2504 3B 55.08% 52.09% 84.10% 80.57% 36.65% 37.63%
XiYanSQL-QwenCoder-7B-2502 7B 59.65% 56.32% 84.15% 80.01% 39.38% 42.10%
XiYanSQL-QwenCoder-7B-2504 7B 62.13% 57.43% 85.97% 82.48% 42.08% 44.67%
XiYanSQL-QwenCoder-14B-2502 14B 63.23% 60.10% 85.31% 82.84% 38.51% 41.62%
XiYanSQL-QwenCoder-14B-2504 14B 65.32% 60.17% 86.82% 83.75% 40.52% 44.60%
XiYanSQL-QwenCoder-32B-2412 32B 67.07% 63.04% 88.39% 85.46% 45.07% 52.84%
XiYanSQL-QwenCoder-32B-2504 32B 67.14% 62.26% 89.20% 86.17% 53.52% 57.74%

Quickstart with Transformers and vLLM

Here is a simple code snippet for quickly using XiYanSQL-QwenCoder model. We provide a Chinese version of the prompt, and you just need to replace the placeholders for "question," "db_schema," and "evidence" to get started. We recommend using our M-Schema format for the schema; other formats such as DDL are also acceptable, but they may affect performance. Currently, we mainly support mainstream dialects like SQLite, PostgreSQL, and MySQL.

Requirements

  • transformers >= 4.37.0
  • vllm >= 0.7.2

Prompt Template

nl2sqlite_template_cn = """你是一名{dialect}专家,现在需要阅读并理解下面的【数据库schema】描述,以及可能用到的【参考信息】,并运用{dialect}知识生成sql语句回答【用户问题】。
【用户问题】
{question}

【数据库schema】
{db_schema}

【参考信息】
{evidence}

【用户问题】
{question}

```sql"""

Inference with Transformers

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "XGenerationLab/XiYanSQL-QwenCoder-14B-2504"
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    device_map="auto"
)

tokenizer = AutoTokenizer.from_pretrained(model_name)

## dialects -> ['SQLite', 'PostgreSQL', 'MySQL']
prompt = nl2sqlite_template_cn.format(dialect="", db_schema="", question="", evidence="")
message = [{'role': 'user', 'content': prompt}]

text = tokenizer.apply_chat_template(
    message,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)

generated_ids = model.generate(
    **model_inputs,
    pad_token_id=tokenizer.pad_token_id,
    eos_token_id=tokenizer.eos_token_id,
    max_new_tokens=1024,
    temperature=0.1,
    top_p=0.8,
    do_sample=True,
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]

Inference with vLLM

from vllm import LLM, SamplingParams
from transformers import AutoTokenizer
model_path = "XGenerationLab/XiYanSQL-QwenCoder-14B-2504"
llm = LLM(model=model_path, tensor_parallel_size=8)
tokenizer = AutoTokenizer.from_pretrained(model_path)
sampling_params = SamplingParams(
    n=1,
    temperature=0.1,
    max_tokens=1024
)

## dialects -> ['SQLite', 'PostgreSQL', 'MySQL']
prompt = nl2sqlite_template_cn.format(dialect="", db_schema="", question="", evidence="")
message = [{'role': 'user', 'content': prompt}]
text = tokenizer.apply_chat_template(
    message,
    tokenize=False,
    add_generation_prompt=True
)
outputs = llm.generate([text], sampling_params=sampling_params)
response = outputs[0].outputs[0].text

Acknowledgments

If you find our work useful, please give us a citation or a like, so we can make a greater contribution to the open-source community!

@ARTICLE{XiYanSQL,
  author={Liu, Yifu and Zhu, Yin and Gao, Yingqi and Luo, Zhiling and Li, Xiaoxia and Shi, Xiaorong and Hong, Yuntao and Gao, Jinyang and Li, Yu and Ding, Bolin and Zhou, Jingren},
  journal={IEEE Transactions on Knowledge and Data Engineering}, 
  title={XiYan-SQL: A Novel Multi-Generator Framework for Text-to-SQL}, 
  year={2026},
  volume={},
  number={},
  pages={1-14},
  doi={10.1109/TKDE.2026.3657851}
}

Configuration

Architecture
Qwen2ForCausalLM
Context length (tokens)
32,768
Layers
48
Hidden size
5,120
Feed-forward size
13,824
Attention heads
40
Key/value heads
8
Vocabulary size
152,064
RoPE base
1e+06
Stored precision
bfloat16
Model type
qwen2

Identity and Version

Repository
XGenerationLab/XiYanSQL-QwenCoder-14B-2504
Publisher
XGenerationLab
Task
Text generation
Modality
Text
Library
Not stated by the source
Parameters
14.8B parameters
Languages
en, zh
Revision
ddf72719ac2e705b08472eb87df05a65b70f2935
First published
2025-04-28
Last updated
2026-10-13

Files and Weights

20 files, 29.6 GB in total. The weights are 6 files totalling 29.5 GB in safetensors.

Weights6 files · 29.5 GB
Configuration6 files · 49.6 KB
Tokenizer4 files · 15.9 MB
Documentation1 file · 10.1 KB
Repository3 files · 2.9 KB
Every file
FileTypeSizeSHA-256
model-00001-of-00006.safetensorsWeights5.0 GB 3f44e1ad109e
model-00002-of-00006.safetensorsWeights5.0 GB 9bbefc153639
model-00003-of-00006.safetensorsWeights5.0 GB bedec51b9cde
model-00004-of-00006.safetensorsWeights5.0 GB da8512e33670
model-00005-of-00006.safetensorsWeights5.0 GB b361a5d233a3
model-00006-of-00006.safetensorsWeights4.7 GB 29592c81ba71
added_tokens.jsonConfiguration605 B —
config.jsonConfiguration756 B —
configuration.jsonConfiguration26 B —
generation_config.jsonConfiguration156 B —
model.safetensors.index.jsonConfiguration47.5 KB —
special_tokens_map.jsonConfiguration613 B —
README.mdDocumentation10.1 KB —
.gitattributesRepository1.6 KB —
.mscRepository1.3 KB —
.mvRepository36 B —
merges.txtTokenizer1.7 MB —
tokenizer.jsonTokenizer11.4 MB 5eee858c5123
tokenizer_config.jsonTokenizer7.3 KB —
vocab.jsonTokenizer2.8 MB —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
29.5 GB
Download from XGenerationLab

Released by XGenerationLab through its official repository on Hugging Face. Read the license.

Built From

  • Derived from XGenerationLab/XiYanSQL-QwenCoder-14B-2502
  • Described by arXiv:2507.04701

Memory Requirements

PrecisionWeights in memory
As published29.5 GB
16-bit29.5 GB
8-bit14.8 GB
4-bit7.4 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About XiYanSQL-QwenCoder-14B-2504

How much GPU memory does XiYanSQL-QwenCoder-14B-2504 need?

About 35.4 GB at 16-bit and 8.9 GB at 4-bit: the weights (14.8B parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run XiYanSQL-QwenCoder-14B-2504 on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use XiYanSQL-QwenCoder-14B-2504 commercially?

Yes. XiYanSQL-QwenCoder-14B-2504 is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

What is XiYanSQL-QwenCoder-14B-2504's context length?

32,768 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Model · Text generation

Qwen2.5-Coder-14B-Instruct

Qwen

Qwen2.5-Coder is the latest series of Code-Specific Qwen large language models (formerly known as CodeQwen). As of now, Qwen2.5-Coder has covered six mainstream model sizes, 0.5, 1.5, 3, 7, 14, 32 billion parameters, to meet the needs of different developers. Qwen2.5-Coder brings the following improvements upon CodeQwen1.5: - Significantly improvements in code generation, code reasoning and code fixing. Base on the strong Qwen2.5, we scale up the training tokens into 5.5 trillion including source code, text-code grounding, Synthetic data, etc. Qwen2.5-Coder-32B has become the current state-of-the-art open-source codeLLM, with its coding abilities matching those of GPT-4o. - A more…

Open weights apache-2.0 14.8B parameters 32,768 tokens transformers

Model · Text generation

Qwen2.5-14B-Instruct-AWQ

Qwen

Qwen2.5 is the latest series of Qwen large language models. For Qwen2.5, we release a number of base language models and instruction-tuned language models ranging from 0.5 to 72 billion parameters. Qwen2.5 brings the following improvements upon Qwen2: - Significantly more knowledge and has greatly improved capabilities in coding and mathematics, thanks to our specialized expert models in these domains. - Significant improvements in instruction following, generating long texts (over 8K tokens), understanding structured data (e.g, tables), and generating structured outputs especially JSON. More resilient to the diversity of system prompts, enhancing role-play implementation and…

Open weights apache-2.0 14.8B parameters 32,768 tokens transformers

Model · Text generation

Qwen2.5-Coder-14B-Instruct-AWQ

Qwen

Qwen2.5-Coder is the latest series of Code-Specific Qwen large language models (formerly known as CodeQwen). As of now, Qwen2.5-Coder has covered six mainstream model sizes, 0.5, 1.5, 3, 7, 14, 32 billion parameters, to meet the needs of different developers. Qwen2.5-Coder brings the following improvements upon CodeQwen1.5: - Significantly improvements in code generation, code reasoning and code fixing. Base on the strong Qwen2.5, we scale up the training tokens into 5.5 trillion including source code, text-code grounding, Synthetic data, etc. Qwen2.5-Coder-32B has become the current state-of-the-art open-source codeLLM, with its coding abilities matching those of GPT-4o. - A more…

Open weights apache-2.0 14.8B parameters 32,768 tokens transformers

Model · Text generation

Qwen2.5-14B-Instruct

Qwen

Qwen2.5 is the latest series of Qwen large language models. For Qwen2.5, we release a number of base language models and instruction-tuned language models ranging from 0.5 to 72 billion parameters. Qwen2.5 brings the following improvements upon Qwen2: - Significantly more knowledge and has greatly improved capabilities in coding and mathematics, thanks to our specialized expert models in these domains. - Significant improvements in instruction following, generating long texts (over 8K tokens), understanding structured data (e.g, tables), and generating structured outputs especially JSON. More resilient to the diversity of system prompts, enhancing role-play implementation and…

Open weights apache-2.0 14.8B parameters 32,768 tokens transformers

A fast and efficient 14B model optimized for CPU inference. The model was refactored with BitNet features and an updated tokenizer that includes new Routing, Media, Vision, Sound, Tool call, and Robotics tags. Built on a DeepSeek R1-14B architecture with native ternary (BitNet-style) support and ready-to-run GGUF quantizations. - JiRack is a cloud-ready model that helps save money on cloud infrastructure. It can be used as an expert model in RAG deployments, with the ONNX JiRack Java server as an alternative. - Benefits high quality CPU inference TQ2 on Llama.cpp and Ollama via QAT - Robotcs, Routing, Coding, Multimedia, Advanced tool calling via CMSManhattan/JiRackPrecisionTokenizer…

Open weights mit 14.8B parameters 131,072 tokens