Skip to main content

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.

PyPI version License: MIT Python 3.10+

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:

Zynthé Typing Demo


📊 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


📄 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zynthe-0.2.5.tar.gz (302.5 kB view details)

Uploaded Source

Built Distribution

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

zynthe-0.2.5-py3-none-any.whl (341.0 kB view details)

Uploaded Python 3

File details

Details for the file zynthe-0.2.5.tar.gz.

File metadata

  • Download URL: zynthe-0.2.5.tar.gz
  • Upload date:
  • Size: 302.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for zynthe-0.2.5.tar.gz
Algorithm Hash digest
SHA256 95ba9757a1bdb7c04263b4199170c6e5d62726f96d7ed44952d1a070845237f4
MD5 730ed9b915857862b247c538c47f89e1
BLAKE2b-256 8d2e8ee89bd5ef96fcee6a4d8013753ac26637d0a8d525b0a952cf2f6f0ec03e

See more details on using hashes here.

File details

Details for the file zynthe-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: zynthe-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 341.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for zynthe-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5dfe4a6c31f432048df3c363620e4ef959c355f60fe09118a3e24739889f0b86
MD5 f4ed20dd63feda3d8fe513e645b7eed4
BLAKE2b-256 c9a602ff941f8edd3fc7e8e9c8fe8cfc6e7ff4a5b1e602cd33a4ac03fd8e0a3f

See more details on using hashes here.

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