Skip to main content

PyPI version PyPI - Downloads PyPI - Python Version arXiv Ask DeepWiki GitHub commit activity (branch)

ai2-kit logo

ai2-kit (pronounced as "AI Squared Kit") is a command line and python toolkit featured artificial intelligence × ab initio for complex chemistry systems research.

Feature Highlights

  • Collection of tools and workflows to facilitate the development of automated workflows for computational chemistry research.
  • Use with oh-my-batch to build your own workflow with shell script.
  • Provide reusable skills for building code related to ai2-kit.
    • build-tesla: a skill for building TESLA workflows from existing examples.

2D API Design Pattern

A key innovation of ai2-kit is its 2D API design pattern, shared by the command-line interface and Python module. The two dimensions are:

  • File dimension: A single API call can operate on a collection of files. Wildcards specify inputs, and template variables specify outputs, making batch processing as straightforward as working with a single file.
  • Operation dimension: A sequence of dependent steps can be composed into a single expression. The CLI uses - to separate operations, while Python uses chained method calls. Reading, transforming, and writing data can be combined without intermediate variables or files.

By extending both the file and operation dimensions, ai2-kit provides powerful tools through a concise interface. For example, the following workflow merges trajectory files, samples structures, converts their format, and writes each result to a separate file in a single expression:

Python API

from ai2_kit.tool.ase import AseTool

(
    AseTool()
    .read("./lammps-*/traj.lammpstrj", format="lammps-dump-text")
    .sample(100, method="random")
    .write_frames("./vasp-{i:04d}/POSCAR", format="vasp")
)

Command Line Interface

ai2-kit tool ase read "./lammps-*/traj.lammpstrj" --format lammps-dump-text \
    - sample 100 --method random \
    - write_frames "./vasp-{i:04d}/POSCAR" --format vasp

Environment Requirements

ai2-kit requires Python 3.10 or later. On Windows, use ai2-kit through WSL2. We recommend installing it in a Conda environment.

Installation

Install the core package with pip:

pip install ai2-kit

To install all optional features and their dependencies, including cp2kdata, DeePMD-kit, and TensorFlow, etc, use:

pip install 'ai2-kit[all]'

Note that TensorFlow currently provides wheels for Python 3.10-3.13. The tensorflow and all extras install it only on these Python versions.

Usage

All ai2-kit commands can be accessed via the command line interface ai2-kit. You can run the following command to see the available commands and sub-commands:

ai2-kit
# e.g.
ai2-kit tool
ai2-kit tool dpdata

For detailed usage of each command, you can run the following command to view the help information:

ai2-kit <sub-command> --help
# e.g.
ai2-kit tool dpdata read --help

Manuals

General Tools

Workflows

Workflows are built with oh-my-batch and example shell scripts, which can be easily adapted to your own research purpose.

The supplementary examples accompanying the paper provide workflows for specific research applications:

  • TESLA for bulk water: Active learning for a bulk-water machine learning potential.
  • TESLA for Au-CO2: Active learning for the Au-CO2 system.
  • TESLA for pKa: Active learning for pKa calculations using free energy perturbation and thermodynamic integration (FEP-TI).
  • TESLA for redox potentials: Active learning for redox-potential calculations using FEP-TI.
  • ec-MLP: Constant-potential molecular dynamics at the Cu(111)/water interface.
  • Spectroscopy: IR, Raman, and sum-frequency generation spectra at the air-water interface using machine learning molecular dynamics and Deep Wannier models.
  • AI-agent-generated TESLA: A workflow built with the build-tesla skill, using MACE, OpenMM, and VASP.

Featuring Tools

Online Apps and Notebooks

Tips

  • Tips: useful tips for using ai2-kit

Developer Guide

Install from Source

To install ai2-kit from source, run the following commands from the project root:

pip install uv
uv sync --locked
uv run ai2-kit

Jupyter Book is in the optional doc dependency group and is not installed by default. To install the dependencies needed to build the documentation, run:

uv sync --locked --group doc

Local Tests

Install the runtime and development dependencies from the lockfile, then run the lightweight suite from the project root:

uv sync --locked --extra cp2kdata
uv run --no-sync python -m pytest -q tests --ignore=tests/test_md_spectra.py -k 'not DPFFDPData'

Build Packages

uv build

Appendix: Transitioning from v1 to v2

v2 makes several significant changes to how ai2-kit workflows are built and maintained:

  • Example-driven workflows: v2 replaces v1's configuration-driven workflow system with workflows built from runnable examples. This approach supports a wider range of functionality, makes workflows easier to reuse and adapt, and makes it easier to collaborate with AI coding agents.
  • Python 3.10 or later: v2 drops support for Python 3.9 and earlier. This resolves compatibility issues with key dependencies and makes ai2-kit easier to install and use on newer Python versions.
  • Build tooling: v2 replaces Poetry with uv for dependency management and package builds. Use uv sync --locked to install dependencies from uv.lock, uv run to run commands, and uv build to build distributions.
  • v1 maintenance: The v1 codebase will move to the v1-legacy branch for continued maintenance.

Metadata

Release files for ai2-kit 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai2-kit 2.0.0
File Size Uploaded Provenance Actions
ai2_kit-2.0.0.tar.gz 89.2 kB Without provenance Details for ai2_kit-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ai2-kit 2.0.0
File Interpreter ABI Platform Actions
ai2_kit-2.0.0-py3-none-any.whl Python 3 none any Details for ai2_kit-2.0.0-py3-none-any.whl

Total release size: 213.9 kB

Release files / ai2_kit-2.0.0.tar.gz

Download URL ai2_kit-2.0.0.tar.gz
Size 89.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d980aefd0ef803470301b06b208846cacd0650c5539d967a43eaf55201c8f996
BLAKE2b-256 checksum
How to use checksums
0f0104974f4784caf67d8940df8436ca34ce94cb257d8b51d226e6ad718e79c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / ai2_kit-2.0.0-py3-none-any.whl

Download URL ai2_kit-2.0.0-py3-none-any.whl
Size 124.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6fa785f7db4954d68c0cd795dc1d1becf579f441e88ce0dbe479e4ce66597296
BLAKE2b-256 checksum
How to use checksums
cc128f520f754034accaff58edb880d3c336452974bd5af8b5a0b179a978663a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for ai2-kit 2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page