Skip to main content

Small self-contained micro packages for deep learning codebases.

Project description

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.

PyPI version

Quick Start

pip install mini-kit

You now have three tiny helpers that play nicely together:

  1. mini.config loads plain-Python configs. Start with a single dictionary, then grow into composable templates and parent chains without learning a new DSL.
  2. mini.builder turns dictionaries into Python objects. Supports both registry shortcuts and fully qualified import paths.
  3. mini.trainer provides 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"])
  • load executes configs/model.py; keep a simple config = {...} for small projects, or swap to def config(...): and parents = [...] when you need templates and composition.
  • apply_overrides allows for painless command-line overrides: tweak nested keys with a short-hand syntax: optimizer.lr=..., append with +=, or drop entries with !=.
  • build looks 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:

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

mini_kit-0.2.0.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

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

mini_kit-0.2.0-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file mini_kit-0.2.0.tar.gz.

File metadata

  • Download URL: mini_kit-0.2.0.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.7

File hashes

Hashes for mini_kit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cad43ea85f3b46d0c3ffbd4c0ccd905df3ca7efe7905a68898ef13c37f3c737f
MD5 e8f5ff537ebfaa7ba6de9979f37b043a
BLAKE2b-256 85dccbfc3d1a24fc88e48a1693c724addf3d99d8eebaae524de592a13cfed5c2

See more details on using hashes here.

File details

Details for the file mini_kit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mini_kit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.7

File hashes

Hashes for mini_kit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8a3a9206155b2659ceba13605f4490c0e8b0a4db9dd20a0fa6328b9358c7baa
MD5 ababf13ffa5491a752e11f2a2628d9d0
BLAKE2b-256 407620babbaf3827327a29b0ac7f60a4e36f2bf83702b36994532e857769b987

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