XMetAI Core
XMETAI Core is the core framework for meteorological AI model training and inference, developed by the Xiong’an Institute of Meteorological Artificial Intelligence (雄安气象人工智能研究院). It is built on PyTorch and supports model development, training, evaluation, and ONNX export.
Release version: 1.0.0. See the changelog.
Related projects
Exported ONNX models require GPU inference support. Use xmetai-onnx-plugins to provide the custom GPU operators required by the corresponding models.
| Project | Purpose |
|---|---|
| xmetai-skills | Skills for model development |
| xmetai-datakit | Data processing and evaluation |
| xmetai-inference | Dedicated inference workflows |
| xmetai-onnx-plugins | Custom GPU operators for exported ONNX models |
Features
- LazyConfig configuration and reusable training recipes.
- Single- and multi-GPU training, with distributed settings defined by the selected recipe.
- Deterministic and ensemble forecasting, probabilistic losses, and weather evaluation metrics.
- Optional Lightning training, ONNX export, and ONNX Runtime inference.
Installation
Requires Python 3.10+ and PyTorch 2.9+. GPU features require a compatible device and runtime. These are declared minimums, not a claim that every version combination has been tested.
From a source checkout, run:
python -m venv .venv
source .venv/bin/activate
pip install -e .
# Development tools
pip install -e '.[dev]'
# Install only the optional features you need
pip install -e '.[lightning,export,inference]'
The gpu extra installs Mamba (mamba-ssm) for models that need it; it does not install GPU drivers. The inference extra installs onnxruntime-gpu; install the corresponding ONNX plugins for models that use custom GPU operators. pyproject.toml is the dependency source of truth.
Data and configuration
Training requires separately prepared data and statistics; datasets and trained weights are not bundled. Existing weather recipes use Zarr data with companion mean.npy, std.npy, and weight.npy files. Review the selected dataset implementation and configure data paths, variable order, units, resolution, time steps, and static fields before running. Do not assume all recipes use the same layout.
configs/s2s_vit.py is a tutorial entry point; configs/s2s_tongyun.py is the TongYun S2S recipe. Configurations may switch stages when checkpoints exist: inspect the recipe and output directory before resuming.
Training, evaluation, and export
Run from the repository root after configuring data paths:
bash scripts/train.bash --stage train -m configs/s2s_vit.py --gpu 1 --batch 1
bash scripts/train.bash --stage eval -m configs/s2s_vit.py --members 8
bash scripts/train.bash --stage export -m configs/s2s_vit.py
bash scripts/train.bash --help
Export requires the export extra and an export-capable model. Checkpoint loading and output paths follow the selected configuration. The wrapper generates configs/tmp_config.py; do not edit that file manually. For direct CLI usage:
xmetai-train --help
xmetai-train --config-file configs/s2s_vit.py
# Requires the lightning extra
xmetai-train-lightning --config-file configs/s2s_vit.py
Repository configurations, scripts, and documentation are accessed from a source checkout; the wheel installs the xmetai library and CLI entry points.
Models and repository layout
| Path | Purpose |
|---|---|
xmetai/models/tongyun/ |
TongYun grouped latent forecasting |
xmetai/models/puyun/ |
PuYun autoregressive prediction |
xmetai/models/tianquan/ |
TianQuan-S2S climatology-conditioned prediction |
xmetai/models/afno/ |
AFNO spectral prediction |
xmetai/models/dit/ |
Diffusion and flow matching predictors |
xmetai/models/adapter/ |
Forecast correction adapters |
xmetai/models/infer/ |
ONNX inference and ensemble evaluation |
xmetai/models/tutorials/ |
ViT/ViTEns tutorial models |
xmetai/core/, xmetai/layers/ |
Shared predictor contracts and network components |
xmetai/recipes/, configs/ |
Reusable recipes and task configurations |
scripts/, tools/, tests/ |
Launchers, data utilities, and tests |
Available losses include Charbonnier, CRPS variants, and KL divergence; metrics include RMSE and TCC. Availability and behavior depend on the model and recipe.
Development and validation
pip install -e '.[dev]'
pre-commit run --all-files
pytest tests -q
Some checks require optional dependencies, GPU hardware, or external data. Report passed, skipped, and unverified checks separately; test counts and coverage should come from the current run.
See CONTRIBUTING.md for contribution rules. Use a PR title such as fix: describe the change [codex] for Codex contributions.
License and contact
Licensed under GPL-3.0-or-later; see LICENSE. Data, weights, and third-party assets may have separate terms.
XMetAI Team: douzsh@gmail.com.
Acknowledgements
XMetAI Core uses the following libraries for selected model components:
- Flash Linear Attention (FLA): Gated DeltaNet-2 layers and efficient linear attention kernels, used by
xmetai/layers/gated_deltanet2.py. - Mamba: selective state space models and scan kernels, used by
xmetai/layers/mamba_vision.py.
These components require the corresponding upstream libraries and compatible GPU environments. FLA-based recipes need an FLA version exposing fla.layers.GatedDeltaNet2; Mamba variants require their corresponding upstream implementations. Please follow each upstream project's installation instructions, license, and citation guidance.
Citation
If you use XMetAI Core in your research, please cite this software:
@software{xmetai-core,
title = {XMetAI Core: A Framework for Meteorological AI Model Training and Inference},
author = {Dou Zesheng and Hu jiahui and Zhengjinfang and Shenzhewen and Zhao Han and Zhou Shuang and Liu Junjie},
url = {https://github.com/XMetAI-Lab/xmetai-core},
version = {1.0.0},
year = {2026}
}
Metadata
Release files for xmetai-core 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xmetai_core-1.0.0.tar.gz | 633.4 kB | With provenance | Details for xmetai_core-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xmetai_core-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for xmetai_core-1.0.0-py3-none-any.whl |
Total release size: 1.3 MB
Release files / xmetai_core-1.0.0.tar.gz
| Download URL | xmetai_core-1.0.0.tar.gz |
|---|---|
| Size | 633.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7d39a644e5d6448b207f283fce6af46af6e84fca3c534c5503ab1ece423eb46
|
|
BLAKE2b-256 checksum How to use checksums |
584d36b540e697fd28acdee83e115821197f84323ef62710873b10cfe3032665
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logRelease files / xmetai_core-1.0.0-py3-none-any.whl
| Download URL | xmetai_core-1.0.0-py3-none-any.whl |
|---|---|
| Size | 696.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
45684df8bd77a92584bd5c67a838bcb2e8e64c23fee1b9ca373377f87e70670b
|
|
BLAKE2b-256 checksum How to use checksums |
b1470fde32a63ead85b40760011cb431d8ff62e85148978fe6397675d98a8d2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logSecurity for xmetai-core 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for xmetai_core-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.