Universal knowledge distillation toolkit for text, code, vision, and multimodal models
Project description
Zynthé 🧠 ⚡
Zynthé — From "Synthesize". Knowledge distillation is the process of synthesizing knowledge from a massive, complex model down into a smaller, more focused one.
Universal Knowledge Distillation Toolkit
A Python library for compressing large language models into smaller, deployable student models — across text, code, vision, and multimodal architectures.
Large transformer models (BERT-110M, GPT-2-124M, ViT-86M) deliver state-of-the-art accuracy but are often too expensive for edge deployment, mobile inference, and cost-sensitive production. Zynthé solves this by training a smaller "student" model to replicate the behavior of a larger "teacher" model using a unified, multi-stage distillation pipeline.
🌟 Key Features
- Modality Agnostic: Works out-of-the-box with Text, Code, Vision, VLM, and Multimodal models via an auto-detecting
AdapterRegistry. - Multi-Stage Distillation: Supports sequential distillation stages:
- Logit Distillation (KD Hinton)
- Feature Alignment (Hidden representations)
- Attention Transfer (Attention patterns)
- Structural Similarity (Cross-layer relationships)
- Zero-Config Presets: 7 battle-tested distillation plans (
quick_start,balanced,compression_max, etc.). - Preflight Analysis: Validates configurations, hardware compatibility, and estimates memory before training starts.
- Post-Training Quantization (PTQ): Further compress your distilled models to INT8.
- Rich Visualization: Auto-generates training curves, distillation gap plots, and metric grids.
📦 Installation
Install Zynthé via pip:
# Core installation
pip install zynthe
# With evaluation and plotting dependencies
pip install zynthe[eval]
# For computer vision support
pip install zynthe[vision]
🚀 Quickstart
Zynthé makes complex multi-stage distillation as simple as 5 lines of code:
📊 Example Results
BERT-base (110M) → DistilBERT (66M) on SST-2 (Single NVIDIA T4)
| Metric | Teacher | Student | Distilled Student |
|---|---|---|---|
| Accuracy | 92.1% | ~81.5% (scratch) | 86.8% |
| Model Size | 418 MB | 255 MB | 255 MB |
| Quantized (PTQ) | - | - | 64 MB (6.5x smaller) |
🛠️ Architecture
Zynthé uses a modular, plugin-based architecture:
DistillationToolkit: The primary user-facing facade.AdapterRegistry: Automatically normalizes I/O across HuggingFace architectures.PipelineBuilder: Constructs deterministic, multi-stage training plans.PreflightAnalyzer: Catches OOMs and shape mismatches before training.Evaluator&ModelComparator: Side-by-side student vs. teacher analysis.
📚 Documentation
- Quickstart Guide — Get up and running in minutes.
- API Reference — Comprehensive guide to the 44 public API symbols.
- Adapters System — How to add custom model architectures.
- Kaggle Examples — End-to-end notebooks for T4/P100 environments.
📄 License
This project is licensed under the MIT License.
You are free to use, modify, distribute, and use this software for commercial purposes. See the LICENSE file for the full text.
Note: Models distilled using Zynthé inherit the license of their respective teacher models and datasets. Please ensure you comply with the licensing terms of the models you are distilling.
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 zynthe-0.2.4.tar.gz.
File metadata
- Download URL: zynthe-0.2.4.tar.gz
- Upload date:
- Size: 289.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b34e5038918d6e7ab3e3595a9344038077878b12bba7bbdc3ee3cc6919c3e29
|
|
| MD5 |
2803915a67754b7ee666234362cf3c4a
|
|
| BLAKE2b-256 |
56df7f13a2414cc6efb07a8cfde1452bfb0c64118983d05b740003302ac676ec
|
File details
Details for the file zynthe-0.2.4-py3-none-any.whl.
File metadata
- Download URL: zynthe-0.2.4-py3-none-any.whl
- Upload date:
- Size: 323.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5683ac47a452be5d78a58b64f0e6c039fa4ca6fed818077670ed7a64453a3f1
|
|
| MD5 |
5162f4d3562e5769a467039f161f9ad4
|
|
| BLAKE2b-256 |
31a9f13c3841a14a628ebeb7afefd61a4994308db6f11bfce6d6ec5f8ae98215
|