# XiYan-SQL is a family of text-to-SQL models and tooling, not one codebase

> The XGenerationLab repository is a landing page for an ensemble of generators: fine-tuned QwenCoder models at four sizes, a post-training framework, an MCP server that can run locally, a schema representation method and a date resolver.

**XGenerationLab/XiYan-SQL** — A MULTI-GENERATOR ENSEMBLE FRAMEWORK FOR NATURAL LANGUAGE TO SQL

- Repository: https://github.com/XGenerationLab/XiYan-SQL
- Stars: 1,018 · Forks: 54
- Language: Unknown
- License: Apache-2.0
- Published: 2026-10-19 · Updated: 2026-10-19 · Language: en
- Canonical page: https://hysenlabs.com/projects/xgenerationlab-xiyan-sql

## What this repository actually contains

The XGenerationLab/XiYan-SQL repository is a hub rather than an implementation. Its top level holds a LICENSE, the English README, a Chinese README, a PDF with the Chinese version of the document, and three images. There is no source tree, no package manifest and no test suite at the root, which is the first fact an engineer should notice before planning around it.

The README states the situation plainly. A link at the top says the new official Alibaba repository for XiYan-SQL is at github.com/alibaba/XiYan-SQL, and that the two addresses are currently kept in sync. So the project has an origin organisation and a destination, and the XGenerationLab copy is the older of the two locations.

That has consequences for anyone evaluating the project. The code, the training framework and the model release instructions live elsewhere, and the version of the framework described here is a set of announcements rather than a versioned package. The framework itself is described as a multi-generator ensemble framework for natural language to SQL, and the description in the repository metadata is even more direct, in capitals, a multi-generator ensemble framework for natural language to SQL.

For the rest of this article the useful unit is therefore the component, not the repository, and each component has its own repository, its own release history and its own model weights.

## The generator side: XiYanSQL-QwenCoder at four sizes

The SQL generators are the XiYanSQL-QwenCoder series, fine-tuned models released at four sizes: 3B, 7B, 14B and 32B parameters, and the README says they exist to meet the needs of different developers. The first model release was the 32B on 2025-01-22, and the weights were open sourced at the same time. The series was updated on 2025-04-29 with the XiYanSQL-QwenCoder-2504 models, which the announcement describes as including significant optimizations over the previous version.

The weights are distributed in the places you would expect for a Chinese research group. The HuggingFace collection for the XiYanSQL models is linked from the March 2025 entry, and the ModelScope studio was live in December 2024, with the 32B also made available directly through the ModelScope API in March 2025. A hosted product entry points at the Aliyun Bailian console under the name 析言GBI, which is the Chinese language business intelligence surface of the same technology.

The point of the size range is deployment shape rather than leaderboard position. A 3B model is small enough to run on a laptop, which the MCP server work makes concrete, and a 32B model is what the published benchmark numbers are attached to. The cost of the ensemble approach is that you now have several models to consider, and the README does not include a routing policy that would tell you which generator handles which question.

## The supporting research pieces: schema, descriptions and dates

Text-to-SQL fails for reasons that have nothing to do with the SQL grammar, and most of the XiYan components attack those specific failures.

M-Schema is described as a semi-structured schema representation method, and it is the piece that addresses the fact that a real database schema does not fit neatly into a prompt. The Database Description Generation project, released with its method and code on 2025-03-04, is described as a method and corresponding code for automatically generating database description for text-to-SQL, which is the part of the pipeline that produces the column and table commentary a model needs to choose the right field.

DateResolver, released with its model and source code on 2024-12-13, is a date understanding and reasoning enhanced model, and the README notes it is major for Chinese. That is a specific and common failure mode: a question like last month's revenue needs the model to bind a relative expression to concrete dates, and a relative date also depends on the database's own time zone and the current date. A dedicated resolver is the project's answer to that problem rather than a general instruction in the prompt.

MoMQ is a multi-dialect text-to-SQL mixture of experts model based on Qwen. Dialect matters because the SQL a business database actually speaks is often not the SQL in the training set, and the BIRD-CRITIC benchmarks, which the README describes as a highly challenging multi-dialect benchmark, are where the project reports measuring this.

## Serving it: the MCP server, local mode and the training framework

The serving path is the XiYan-MCP server, released in March 2025, which enables natural language queries to databases powered by XiYan-SQL. In March of the same year the README announced a local mode that runs the 3B model on your own PC or Mac, framed as a high security data access option, which is the interesting part for anyone whose data cannot leave the building.

The other half of the project is the training side. XiYan-SQLTraining was released on 2025-10-30 as a framework primarily designed for the training of SQL and general LLMs, and it includes capabilities such as SQL data processing, model training and evaluation, as proposed by XiYan. The announcement says the framework will continue to be enhanced.

The consequence for an adopter is that the pieces are separable. If you want to fine tune your own text-to-SQL model on your own schema, the training framework and the description generator are the inputs and the output is a model you host. If you want a running query interface, the MCP server and a published model are the inputs. The README does not describe a single command that assembles both, and the training framework was released as open source in the official Alibaba repository rather than here, so the setup work is on you.

## What the reported benchmark numbers are, and what they are not

The News section is long and specific about results, so it is worth separating what the project claims from what an adopter can conclude. The December 2024 entry reports that XiYan-SQL reached the top of the Bird leaderboard with an EX score of 75.63%, ahead of the second place by 0.84 points, with a reported R-VES score of 71.41%. The January 2025 entry reports an EX score of 69.03% for the single 32B model on the BIRD test set, described as a new state of the art under only a single fine-tuned model.

The BIRD-CRITIC numbers follow a similar pattern. The project reports 41% pass rate on BIRD-CRITIC-Flash in May 2025, 44.53% on BIRD-CRITIC-PG and 48.5% on BIRD-CRITIC-Flash in October 2025, and 44.37% on BIRD-CRITIC-Open in November 2025, each described as a new best result. The README also links a preview paper and a later arXiv entry, and a PapersWithCode page, so the claims are documented rather than only asserted.

What these numbers do not tell you is anything about your schema. BIRD and BIRD-CRITIC are public benchmarks with a fixed set of databases and questions, and a leaderboard position is a property of the benchmark at a point in time, not of your data. The scores also say nothing about latency, cost per query, or the failure mode that matters to you, which is usually a question the model answers with a syntactically valid query against the wrong column. Nothing in the repository describes accuracy on a proprietary schema, and no evaluation harness for your own databases is documented here.

One naming detail is easy to trip over. The entries describe a XiYan-SQL-CRITIC technique on the BIRD-CRITIC benchmarks, while the released generators are named XiYanSQL-QwenCoder, and the repository description mentions an ensemble. The relationship between the technique that produced the leaderboard numbers and the weights you can download is not spelled out in the README.

## Licence, maintenance and where the framework is the wrong tool

The framework code carries the Apache-2.0 licence, with the LICENSE file at the root of this repository. Model weights are a separate question: the README announces that the 32B weights were open sourced, but the README does not state which licence applies to them, and a research group release can carry its own terms. If you are building a product on top of a model, read the licence on the model's own page rather than inheriting the framework's.

The maintenance signal in this repository is thin. The last push was on 2026-05-18, the repository is not archived, and there are no GitHub releases, so there is no versioned artifact here at all. The content that is being maintained is the announcement list and the documentation, and the actual engineering has moved to the sibling repositories, each with its own cadence. The README's own construction, with a dated news entry per milestone and links out to every component, is a good description of a project whose centre of gravity is now distributed.

As for when this is the wrong tool, the simplest test is the shape of your data. Text-to-SQL models help when the schema is relational, the questions are about rows and aggregates, and someone can review the generated query before it runs. They help much less when the answer lives in a document store, when the question is about a metric with a business definition encoded elsewhere, or when the query must be right the first time with no reviewer. The security angle deserves care too. A local mode running a 3B model on your own machine removes the data leaving the building, but the generated SQL is still arbitrary SQL against your own database, and the repository says nothing about how the MCP server restricts what a query may do. Any deployment that lets a model write SQL needs a read only role, a statement timeout and a limit on the rows returned, and that limit is your responsibility, not a feature of this project.

## Conclusion

Adopt XiYan-SQL if you need text-to-SQL over your own databases and want the pieces separately, because the models, the schema representation, the description generator and the MCP server are released as distinct projects and can be used one at a time. Do not adopt it if you need a single installable package with a stable API from this repository, since the code now lives in the alibaba repository and this one holds documentation, images and a PDF. Verify first by cloning alibaba/XiYan-SQL and confirming which model sizes are published on HuggingFace and ModelScope, then check the licence of the model weights separately from the Apache-2.0 licence of the framework code.

## FAQ

### What is XiYan-SQL and what does it contain?

It is a framework for LLM based text-to-SQL, organised as a set of separate projects: the XiYanSQL-QwenCoder model series, the XiYan-SQLTraining post-training framework, the XiYan MCP server, the M-Schema schema representation, Database Description Generation, the DateResolver model and the MoMQ multi-dialect model.

### Where is the XiYan-SQL source code, given that this repository has no source tree?

The README states that the new official Alibaba repository is github.com/alibaba/XiYan-SQL, and that the two addresses are kept in sync. The XGenerationLab repository holds the documentation, the Chinese README, a PDF and images, and links out to the component repositories.

### Which XiYanSQL model sizes are available?

The series covers four sizes, 3B, 7B, 14B and 32B parameters, released as the XiYanSQL-QwenCoder models. The 32B weights were open sourced in January 2025, the series was updated with the 2504 models in April 2025, and the weights are distributed through HuggingFace and ModelScope.

### Can XiYan-SQL run against a database on my own machine?

The XiYan MCP server gained a local mode in March 2025 that runs the 3B model on your own PC or Mac, so the query does not need to leave the machine. The README does not describe how the server restricts what the generated SQL may do, so read only credentials and row limits remain your responsibility.

### What licence applies to XiYan-SQL?

The framework code in this repository is under the Apache-2.0 licence, with the LICENSE file at the root. The model weights are distributed separately, and the README does not state which licence applies to them, so check the model's own release page if you plan to build on them.

## Sources

- [Issues](https://github.com/XGenerationLab/XiYan-SQL/issues)
- [License: Apache-2.0](https://github.com/XGenerationLab/XiYan-SQL/blob/main/LICENSE)
- [README](https://github.com/XGenerationLab/XiYan-SQL/blob/main/README.md)
- [XGenerationLab/XiYan-SQL on GitHub](https://github.com/XGenerationLab/XiYan-SQL)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/xgenerationlab-xiyan-sql
