Skip to main content

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:

  1. From PyPI (recommended):
pip install "tunix[prod]"
  1. Directly from GitHub (latest main branch)
pip install git+https://github.com/google/tunix
  1. From source (editable install) If you plan to modify the codebase and run it in development mode:
git clone https://github.com/google/tunix.git
cd tunix
pip install -e ".[dev]"

Getting Started

To get started, we have a bunch of detailed examples and tutorials.

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!

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.0.dev1.tar.gz (161.6 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.0.dev1-py3-none-any.whl (223.0 kB view details)

Uploaded Python 3

File details

Details for the file google_tunix-0.1.0.dev1.tar.gz.

File metadata

  • Download URL: google_tunix-0.1.0.dev1.tar.gz
  • Upload date:
  • Size: 161.6 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.0.dev1.tar.gz
Algorithm Hash digest
SHA256 91a593040b51f062b4f093edbc63e517c8f18d33f62733819f3dae5fd03733e6
MD5 cc77730aa2fe0b309cd934809ef2c552
BLAKE2b-256 7502846bb3a831f14763844964901c34e824507c8a5f8e01ff568cf00ea3b00d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for google_tunix-0.1.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 671f1368813e70294fceb081ae7fac90a2ca4767d10e93b70c1054e986614f84
MD5 7726c4c0764d1dd23c7a504b6cd57428
BLAKE2b-256 fa4ea8c20793ed6f76f01336fd7418966afe216938f980b9b2283f481883db12

See more details on using hashes here.

Provenance

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