Skip to main content

Zlynx

Ask DeepWiki

An experimental, lightweight deep learning library built on JAX and Flax NNX. It explores providing researchers and developers with fine-grained control over model architectures, training loops, and distributed setups.

Install

uv pip install zlynx

Experimental Model Interface

Zlynx introduces Z as an experimental base class for models, aiming to provide built-in utilities for saving, loading, and sharing model artifacts.

import jax
from flax import nnx
from zlynx import Z

class MyModel(Z):
    def __init__(self, rngs: nnx.Rngs, in_features: int, hidden: int, out_features: int):
        self.linear1 = nnx.Linear(in_features, hidden, rngs=rngs)
        self.linear2 = nnx.Linear(hidden, out_features, rngs=rngs)

    def __call__(self, x):
        x = jax.nn.relu(self.linear1(x))
        return self.linear2(x)

# Initialize
model = MyModel(nnx.Rngs(42), in_features=784, hidden=256, out_features=10)

# Save & Load
model.save("./my-model", format="safetensors")
restored = MyModel.load("./my-model", rngs=nnx.Rngs(0), in_features=784, hidden=256, out_features=10)

# Push to Hubs (Experimental)
model.push_hf("username/my-model")
model.push_kaggle("username/my-model")

Training

The Trainer is designed to handle common tasks of the training loop, including optimization, checkpointing, and logging.

from zlynx.trainer import Trainer, TrainerConfig

trainer = Trainer(
    model=model,
    loss_fn=loss_fn,
    train_dataset=dataset,
    config=TrainerConfig(
        batch_size=32,
        learning_rate=5e-5,
        num_epochs=3,
        sharding="auto", # Experimental sharding
    ),
)
trainer.train()

PEFT (LoRA, DoRA, VeRA, LoHa, LoKr, AdaLoRA)

Zlynx provides utilities to apply various parameter-efficient fine-tuning (PEFT) methods.

from zlynx.module.peft import apply_peft

model = apply_peft(
    model, 
    method="lora", 
    r=16, 
    alpha=32, 
    target_modules=["linear1", "linear2"]
)

Goals & Features

  • JAX + Flax NNX Integration — Explores combining XLA speed with the flexible NNX module system.
  • Checkpointing Utilities — Experimental support for Orbax + SafeTensors, HuggingFace Hub, and Kaggle.
  • Training Helpers — Gradient accumulation, LR scheduling, and multi-backend logging.
  • Sharding Support — Initial support for transitioning between single-device and distributed (DDP, FSDP) training.
  • PEFT Methods — Implementation of 6 adapter methods via apply_peft().
  • GaLore — Experimental gradient low-rank projection for memory-efficient fine-tuning.

Documentation

For full guides and current API references, visit the Documentation.

Metadata

Release files for zlynx 0.1.11

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

Source distribution (sdist)

Source distribution for zlynx 0.1.11
File Size Uploaded Provenance Actions
zlynx-0.1.11.tar.gz 68.3 kB With provenance Details for zlynx-0.1.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zlynx 0.1.11
File Interpreter ABI Platform Actions
zlynx-0.1.11-py3-none-any.whl Python 3 none any Details for zlynx-0.1.11-py3-none-any.whl

Total release size: 147.8 kB

Release files / zlynx-0.1.11.tar.gz

Download URL zlynx-0.1.11.tar.gz
Size 68.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2afea9e8e5b3bb8b287c7e249895c660495b4664e65e8c2a1d52d075213e3122
BLAKE2b-256 checksum
How to use checksums
0ce8440147d39a4298bbb4eb2fa3b5600b6b88f541cd55400ca3a93d784ebbf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 9, 2026.

Transparency log

Release files / zlynx-0.1.11-py3-none-any.whl

Download URL zlynx-0.1.11-py3-none-any.whl
Size 79.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
657585aa97b06fb029d759b7497124d9af78dabbdc46d81b0854861977303ad9
BLAKE2b-256 checksum
How to use checksums
6eac9e07fd417eecbac506373f9c8de3ead086531e23d2698611bb66053b6f02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 9, 2026.

Transparency log

Security for zlynx 0.1.11

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for zlynx-0.1.11.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 9, 2026.

Transparency log

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.

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