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

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.

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.6.tar.gz (294.0 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.6-py3-none-any.whl (396.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for google_tunix-0.1.6.tar.gz
Algorithm Hash digest
SHA256 9397e72c2d206c57c1e77d3e3a03188187b180ee9b88b14dbaf08c057185ccd2
MD5 2175add7aeef541206fba946061dd2f9
BLAKE2b-256 2afee1f5ef4c322b66ba4613e8cad14309a6fb2dacc277243490230538866586

See more details on using hashes here.

Provenance

The following attestation bundles were made for google_tunix-0.1.6.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.6-py3-none-any.whl.

File metadata

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

File hashes

Hashes for google_tunix-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d98083412ce9768eafb1d6143ecca55dc0f7218780ab2e37abb9ec5aa1b7826e
MD5 e32db1eb05b189468c8e316d63a67c7a
BLAKE2b-256 3b457296cd39ea2cfd51abf052860717a37cffd5ad6abf163a90008c44d30e32

See more details on using hashes here.

Provenance

The following attestation bundles were made for google_tunix-0.1.6-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