A lightweight JAX-native LLM post-training framework.
Project description
Tunix: A JAX-native 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 supports for:
- Supervised Fine-Tuning
- Reinforcement Learning (RL)
- Knowledge Distillation
Tunix leverages the power of JAX for accelerated computation and seamless integration with JAX-based modeling framework Flax NNX.
Current Status: Early Development
Tunix is in early development. We're actively working to expand its capabilities, usability and improve its performance. Stay tuned for upcoming updates and new features!
Key Features & Highlights
Tunix is still under development, here's a glimpse of the current features:
- Supervised Fine-Tuning:
- Full Weights Fine-Tuning
- Parameter-Efficient Fine-Tuning (PEFT) with LoRA/Q-LoRA Layers
- Reinforcement Learning (RL):
- Proximal Policy Optimization (PPO)
- Group Relative Policy Optimization (GRPO)
- Token-level Group Sequence Policy Optimization (GSPO-token)
- Preference Fine-Tuning:
- Preference alignments with Direct Preference Optimization (DPO)
- Knowledge Distillation:
- Logit Strategy: A classic approach where the student learns to match the teacher's output probability distribution.
- Attention Transfer & Projection Strategies: Methods to align the attention mechanisms between the student and teacher models.
- Feature Pooling & Projection Strategies: General techniques for matching intermediate feature representations, even between models of different architectures.
- Modularity:
- Components are designed to be reusable and composable
- Easy to customize and extend
- Efficiency:
- Native support of common model sharding strategies such as DP, FSDP and TP
- Designed for distributed training on accelerators (TPU)
Upcoming
- Agentic RL Training:
- Async Rollout
- Multi-turn & multi-step support
- Tool usage
- Advanced Algorithms:
- Addtional state-of-the-art RL and distillation algorithms
- Scalability:
- Multi-host distributed training
- Optimized rollout with vLLM
- User Guides:
- More advanced RL recipe
Installation
You can install Tunix in several ways:
- From PyPI (recommended):
pip install "google-tunix[prod]"
- Directly from GitHub (latest main branch)
pip install git+https://github.com/google/tunix
- From source (editable install) If you plan to modify the codebase and run it
in development mode. If you'd like to install vllm, the tpu-inference
supported version is not released yet, please follow the instructions to
install manually
(https://docs.vllm.ai/en/latest/getting_started/installation/google_tpu.html)
or download the docker image (vllm/vllm-tpu:v0.11.1) then
pip install tpu-inferencefor TPU backend:
git clone https://github.com/google/tunix.git
cd tunix
pip install -e ".[dev]"
# Then install vLLM and tpu-inference
Getting Started
To get started, we have a bunch of detailed examples and tutorials.
- PEFT Gemma with QLoRA
- Training Gemma on grade school Math problems using GRPO
- Logit Distillation using Gemma models
To setup Jupyter notebook on single host GCP TPU VM, please refer to the setup script.
We plan to provide clear, concise documentation and more examples in the near future.
Contributing and Feedbacks
We welcome contributions! As Tunix is in early development, the contribution process is still being formalized. A rough draft of the contribution process is present 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.
Stay Tuned!
Thank you for your interest in Tunix. We're working hard to bring you a powerful and efficient library for LLM post-training. Please follow our progress and check back for updates!
Citing Tunix
@misc{tunix2025,
title={Tunix},
author={Bao, Tianshu and Wang, Lance and Sharma, Abheesht and Shin, Jiwon and
Yan, Ann and Tan, Sizhi and Gao, Haoyu and Ha, Jen and Chai, Lin and
Liu, Dangyi and Iyer, Rakesh and Sahu, Mridul and others},
year={2025},
howpublished={\url{https://github.com/google/tunix}},
}
Acknowledgements
Thank you to all our wonderful contributors!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file google_tunix-0.1.3.tar.gz.
File metadata
- Download URL: google_tunix-0.1.3.tar.gz
- Upload date:
- Size: 183.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
634a372e4faf006b0d3f52678e031c53fa309bf3072a84a811ea65dff34ca7ba
|
|
| MD5 |
29f6cba4ea061d6b8df9c10ce3733695
|
|
| BLAKE2b-256 |
4d1780b4aab2e1e55e447763a24bbd196b951eace6c0e0f2f36c59066e226f59
|
Provenance
The following attestation bundles were made for google_tunix-0.1.3.tar.gz:
Publisher:
pypi_release.yml on google/tunix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
google_tunix-0.1.3.tar.gz -
Subject digest:
634a372e4faf006b0d3f52678e031c53fa309bf3072a84a811ea65dff34ca7ba - Sigstore transparency entry: 623384637
- Sigstore integration time:
-
Permalink:
google/tunix@72d00a897e51ae1177e4c100c867930151d08821 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/google
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_release.yml@72d00a897e51ae1177e4c100c867930151d08821 -
Trigger Event:
release
-
Statement type:
File details
Details for the file google_tunix-0.1.3-py3-none-any.whl.
File metadata
- Download URL: google_tunix-0.1.3-py3-none-any.whl
- Upload date:
- Size: 253.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5ac1e7bf65f61009d85d007136c58acb32fa0322be0fb0503582bcee9c1f32e
|
|
| MD5 |
89842cebb9f7f79afeef758fe7373209
|
|
| BLAKE2b-256 |
9341e37d9fbed1d9f8840d7d9ee1a16eedcaccaaed761a39a2abbd65ba9105da
|
Provenance
The following attestation bundles were made for google_tunix-0.1.3-py3-none-any.whl:
Publisher:
pypi_release.yml on google/tunix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
google_tunix-0.1.3-py3-none-any.whl -
Subject digest:
a5ac1e7bf65f61009d85d007136c58acb32fa0322be0fb0503582bcee9c1f32e - Sigstore transparency entry: 623384642
- Sigstore integration time:
-
Permalink:
google/tunix@72d00a897e51ae1177e4c100c867930151d08821 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/google
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_release.yml@72d00a897e51ae1177e4c100c867930151d08821 -
Trigger Event:
release
-
Statement type: