mini-kit
Minimal, hackable building blocks for deep learning projects. The goal is to keep every layer small enough that you can read it, tweak it, or drop it into your own codebase.
Quick Start
pip install mini-kit
You now have three tiny helpers that play nicely together:
mini.configloads plain-Python configs. Start with a single dictionary, then grow into composable templates and parent chains without learning a new DSL.mini.builderturns dictionaries into Python objects. Supports both registry shortcuts and fully qualified import paths.mini.trainerprovides a lightweight training framework with hooks for logging, checkpointing, and customization.
The example below shows mini.config and mini.builder in action.
# configs/model.py
config = {
"model": {
"type": "Classifier",
"encoder": {"type": "Encoder", "channels": 64},
"head": {"type": "torch.nn.Linear", "*": [64, 10]},
},
"optimizer": {"type": "torch.optim.AdamW", "lr": 3e-4},
}
# main.py
from mini.builder import register, build
from mini.config import apply_overrides, load
@register()
class Encoder:
def __init__(self, channels: int):
self.channels = channels
@register()
class Classifier:
def __init__(self, encoder, head):
self.encoder = encoder
self.head = head
cfg = load("configs/model.py")
cfg = apply_overrides(cfg, ["optimizer.lr=1e-3", "model.encoder.channels=128"])
model = build(cfg["model"])
optimizer = build(cfg["optimizer"])
loadexecutesconfigs/model.py; keep a simpleconfig = {...}for small projects, or swap todef config(...):andparents = [...]when you need templates and composition.apply_overridesallows for painless command-line overrides: tweak nested keys with a short-hand syntax:optimizer.lr=..., append with+=, or drop entries with!=.buildlooks at the"type"key, grabs the right constructor (from the registry or import path), and wires up dependencies for you.
More details are in each subpackage's own README:
Metadata
Release files for mini-kit 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mini_kit-0.2.0.tar.gz | 25.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mini_kit-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.7 kB
Release files / mini_kit-0.2.0.tar.gz
| Download URL | mini_kit-0.2.0.tar.gz |
|---|---|
| Size | 25.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cad43ea85f3b46d0c3ffbd4c0ccd905df3ca7efe7905a68898ef13c37f3c737f
|
|
BLAKE2b-256 checksum How to use checksums |
85dccbfc3d1a24fc88e48a1693c724addf3d99d8eebaae524de592a13cfed5c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.7
|
Release files / mini_kit-0.2.0-py3-none-any.whl
| Download URL | mini_kit-0.2.0-py3-none-any.whl |
|---|---|
| Size | 30.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e8a3a9206155b2659ceba13605f4490c0e8b0a4db9dd20a0fa6328b9358c7baa
|
|
BLAKE2b-256 checksum How to use checksums |
407620babbaf3827327a29b0ac7f60a4e36f2bf83702b36994532e857769b987
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.7
|