Skip to main content

A lightweight JAX-native LLM post-training framework.

Project description

Tunix: A Lightweight LLM Post-Training Library

Tunix (Tune-in-JAX) is a JAX based library designed to streamline the post-training of Large Language Models. It provides efficient and scalable support for:

  • SOTA Training performance on TPUs
  • Supervised Fine-Tuning
  • Reinforcement Learning (RL)
  • Agentic RL

Tunix leverages the power of JAX for accelerated computation and seamless integration with JAX-based modeling frameworks like Flax NNX, and integrates with high-performance inference engines like vLLM and SGLang-JAX for rollout. For our detailed documentation, please refer to the Tunix Website.

Current Status: V2 Release

Tunix is under active development. Our team is actively working on expanding its capabilities, usability and performance. Stay tuned for upcoming updates and new features! See Talks and Announcements for latest updates, talks, and blog posts.

High Level Architecture

Tunix serves as a state-of-the-art post-training library within the JAX training stack, positioned to leverage foundational tools like Flax, Optax, Orbax, etc. for efficient model refinement. It sits as an intermediate layer between these core utilities and optimized models like MaxText and MaxDiffusion, streamlining tuning workflows on top of the XLA and JAX infrastructure. See Design Overview for more details on the architecture.

Tunix in JAX ecosystem

Key Features

  • Supervised Fine-Tuning (SFT):
    • Full Weights Fine-Tuning
    • PEFT (Parameter-Efficient Fine-Tuning)
    • DPO (Direct Preference Optimization)
    • ORPO (Odds Ratio Preference Optimization)
  • Reinforcement Learning (RL):
    • PPO (Proximal Policy Optimization)
    • GRPO (Group Relative Policy Optimization)
    • GSPO-Token (Token-level Group Sequence Policy Optimization)
    • DAPO (Direct Alignment via Preference Optimization)
    • Dr.GRPO (Distributionally Robust GRPO)
  • Agentic RL:
    • Multi-turn tool use
    • Asynchronous rollout for high-throughput trajectory collection
    • Trajectory batching and grouping

News

  • [2026/04] Gemma4 models are supported in Tunix! Stay tuned for upcoming training recipes.
  • [2026/01] Tunix model now supports efficient kernel execution (splash attn, GMM MoE).
  • [2025/12] Agentic RL Training has been released, with efficient support of multi-turn agent-env interaction, tool usage, async rollout, etc.

Framework & Infra Highlights

  • Modularity:
    • Components are designed to be reusable and composable
    • Easy to customize and extend
  • Performance & Efficiency:
    • Native vLLM and SGLang-JAX on TPU integration for performant rollout
    • Native MaxText model integration for high performance kernels and model execution
    • Micro-batching support for component level efficient execution
  • Stability

Getting Started

Installation: Jump to Installation to install Tunix and run your first training job.

For TPU users integrating vllm and tpu-inference, there are two supported setup paths:

  • Docker image builds use Dockerfile and install the pinned dependencies directly from requirements/requirements.txt and requirements/special_requirements.txt.
  • Local TPU VM or developer-machine installs can use scripts/install_tunix_vllm_requirement.sh, which installs the same requirement files outside Docker.

These are separate entry points. If you are building the Docker image, you do not need to run the install script inside the container build.

Examples: To get started, we have a number of detailed examples and tutorials. You can see Quick Start for a great set of starting examples and Examples and Guides for a comprehensive list of all the notebooks and examples we have.

Supported Models

Tunix supports a growing list of models including Gemma, Llama, and Qwen families. See Models for a full list and details on how to add new ones.

Contributing and Feedback

We welcome contributions! As Tunix is in early development, the contribution process is still being formalized. The detailed contribution process is outlined here. In the meantime, you can make feature requests, report issues and ask questions in our Tunix GitHub discussion forum.

Collaborations and Partnership

GRL (Game Reinforcement Learning), developed by Hao AI Lab from UCSD, is an open-source framework for post-training large language models through multi-turn RL on challenging games. In collaboration with Tunix, GRL integrates seamless TPU support—letting users quickly run scalable, reproducible RL experiments (like PPO rollouts on Qwen2.5-0.5B-Instruct) on TPU v4 meshes with minimal setup. This partnership empowers the community to push LLM capabilities further, combining Tunix’s optimized TPU runtime with GRL’s flexible game RL pipeline for cutting-edge research and easy reproducibility.

Citing Tunix

@misc{tunix2025,
  title={Tunix (Tune-in-JAX)},
  author={Bao, Tianshu and Carpenter, Jeff and Chai, Lin and Gao, Haoyu and Jiang, Yangmu and Noghabi, Shadi and Sharma, Abheesht and Tan, Sizhi and Wang, Lance and Yan, Ann and Yu, Weiren and others},
  year={2025},
  howpublished={\url{https://github.com/google/tunix}},
}

Acknowledgements

Thank you to all our wonderful contributors!

Contributors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google_tunix-0.1.7.tar.gz (390.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

google_tunix-0.1.7-py3-none-any.whl (504.9 kB view details)

Uploaded Python 3

File details

Details for the file google_tunix-0.1.7.tar.gz.

File metadata

  • Download URL: google_tunix-0.1.7.tar.gz
  • Upload date:
  • Size: 390.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for google_tunix-0.1.7.tar.gz
Algorithm Hash digest
SHA256 42cedab577e662cb35cb0ebfe5894c8a61e1f53ae5a9d4151a082435c7ecdf0e
MD5 5d47205dc9cc5862aee7dc6c756db4f8
BLAKE2b-256 f4982ad062fb117533aebe76d0b490a8136b6ee5755606fabadd2ff28707d675

See more details on using hashes here.

Provenance

The following attestation bundles were made for google_tunix-0.1.7.tar.gz:

Publisher: pypi_release.yml on google/tunix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file google_tunix-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: google_tunix-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 504.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for google_tunix-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 857b893b8ba71a61cce8cb9de2301218d311f72044de94aa2b826275968033b4
MD5 06418c8011121b4c15f90240032cb484
BLAKE2b-256 e29b0b81c26cb0d9f875418bf7fa21c8c5623237b4d15b6b30ec503746164d0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for google_tunix-0.1.7-py3-none-any.whl:

Publisher: pypi_release.yml on google/tunix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page