Skip to main content

Zlynx is a lightweight, highly-customizable deep learning library built on top of JAX and Flax NNX

Project description

Zlynx

Ask DeepWiki

A lightweight, highly-customizable deep learning library built on JAX and Flax NNX. Designed for researchers and developers who want fine-grained control over model architectures, training loops, and distributed setups without the bloat of massive frameworks.

Install

uv pip install zlynx

Define & Load Models

from zlynx import Z

class MyModel(Z): ...

# Load from HuggingFace
model = MyModel.load_hf("username/my-model", format="safetensors")

# Load from Kaggle
model = MyModel.load_kaggle("username/my-model", sharding="fsdp")

# Load from local checkpoint
model = MyModel.load("./checkpoint", key=jax.random.key(0))

Built-in Llama

from zlynx.models.llama import LlamaConfig, LlamaLanguageModel

config = LlamaConfig(vocab_size=32000, hidden_size=512, num_hidden_layers=2)
model = LlamaLanguageModel(config)

# Generate
output_ids = model.generate(input_ids, key=jax.random.key(0), max_new_tokens=128)

Train

from zlynx.trainer import Trainer, TrainerConfig

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

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

from zlynx.modules.peft import apply_peft

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

Save & Push

model.save("./my-model", format="safetensors")
model.push_hf("username/my-model")
model.push_kaggle("username/my-model")

Features

  • Checkpointing — Orbax + SafeTensors, HuggingFace Hub & Kaggle integration
  • Training — gradient accumulation, LR scheduling, multi-backend logging (W&B, TensorBoard)
  • Sharding — auto, DDP, FSDP with one config change
  • PEFT — 6 adapter methods via apply_peft()
  • GaLore — gradient low-rank projection for memory-efficient full fine-tuning
  • Data — Grain-based pipeline accepting lists, HF datasets, dicts, and iterables
  • Modules — Attention (GQA/MQA), MLP (SwiGLU), RMSNorm, RoPE, KV Cache, DiT blocks

Documentation

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

zlynx-0.1.9.tar.gz (58.5 kB view details)

Uploaded Source

Built Distribution

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

zlynx-0.1.9-py3-none-any.whl (61.3 kB view details)

Uploaded Python 3

File details

Details for the file zlynx-0.1.9.tar.gz.

File metadata

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

File hashes

Hashes for zlynx-0.1.9.tar.gz
Algorithm Hash digest
SHA256 77c289a324494a7b007d6ec50a8c16ae37aa137a2eafe01ee310ddde24abcfde
MD5 b5aeb09acca9600e5cf81efe6cfaacaa
BLAKE2b-256 76189d8c8dff799887abe23465d994d11ed4c71ee133f30862dfdcc5bbce2be0

See more details on using hashes here.

Provenance

The following attestation bundles were made for zlynx-0.1.9.tar.gz:

Publisher: publish.yml on zlynx-ai/zlynx

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

File details

Details for the file zlynx-0.1.9-py3-none-any.whl.

File metadata

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

File hashes

Hashes for zlynx-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 66584a741834c2559f6d98e542e2ca4157c6d4fd1dcfac21d534edbcb717d02f
MD5 1b63291aa38c20b6f590c656abdb8ddf
BLAKE2b-256 3db9208a9c47dcea6373faa8975d18e15cad55aa37f9ac39f726e3ccfb7d3377

See more details on using hashes here.

Provenance

The following attestation bundles were made for zlynx-0.1.9-py3-none-any.whl:

Publisher: publish.yml on zlynx-ai/zlynx

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