Zlynx is a lightweight, highly-customizable deep learning library built on top of JAX and Flax NNX
Project description
Zlynx
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
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 zlynx-0.1.7.tar.gz.
File metadata
- Download URL: zlynx-0.1.7.tar.gz
- Upload date:
- Size: 57.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0358231e5a2cd4f76bcc18a36d50ddfd5fe0e485950f864af29a8f031e17dd8c
|
|
| MD5 |
fe2592a1f4ebe4b10867d16a92a8378d
|
|
| BLAKE2b-256 |
3403fa38136454b47e41f2f627d24a376bd403aa106c5f408c41fd6d6a93e5d6
|
Provenance
The following attestation bundles were made for zlynx-0.1.7.tar.gz:
Publisher:
publish.yml on zlynx-ai/zlynx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zlynx-0.1.7.tar.gz -
Subject digest:
0358231e5a2cd4f76bcc18a36d50ddfd5fe0e485950f864af29a8f031e17dd8c - Sigstore transparency entry: 1245966086
- Sigstore integration time:
-
Permalink:
zlynx-ai/zlynx@c7ce94e0d147c7fdc1fff8db1c452d25e283d399 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/zlynx-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c7ce94e0d147c7fdc1fff8db1c452d25e283d399 -
Trigger Event:
push
-
Statement type:
File details
Details for the file zlynx-0.1.7-py3-none-any.whl.
File metadata
- Download URL: zlynx-0.1.7-py3-none-any.whl
- Upload date:
- Size: 60.4 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 |
bd56afc729ada5495d03689f50617160be340033989ce2386eac6562ea5968c2
|
|
| MD5 |
400cf5dd2aaa9dd3735b38b853f652b8
|
|
| BLAKE2b-256 |
1104961b98450f5b36419934efdee45682d7b2e530d47bd050138b5992219c95
|
Provenance
The following attestation bundles were made for zlynx-0.1.7-py3-none-any.whl:
Publisher:
publish.yml on zlynx-ai/zlynx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zlynx-0.1.7-py3-none-any.whl -
Subject digest:
bd56afc729ada5495d03689f50617160be340033989ce2386eac6562ea5968c2 - Sigstore transparency entry: 1245966087
- Sigstore integration time:
-
Permalink:
zlynx-ai/zlynx@c7ce94e0d147c7fdc1fff8db1c452d25e283d399 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/zlynx-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c7ce94e0d147c7fdc1fff8db1c452d25e283d399 -
Trigger Event:
push
-
Statement type: