Open-source · Python · MIT License

The open engine for
deep learning
workflows.

Fenn wires up config, logging, monitoring, and notifications — without hiding PyTorch from you. You write real PyTorch code. Fenn handles the rest.

Get early-access updates

ML projects deserve
real infrastructure

Without Fenn

  • Copy-paste config dicts across every experiment
  • Re-implement logging in each new project
  • Forget to seed random state. Reproduce nothing.
  • Find out training crashed — hours later

With Fenn

  • One YAML file drives your whole pipeline
  • Structured logging out of the box, always on
  • Seeds, checksums, and artifacts tracked automatically
  • Discord or Telegram ping the moment a run ends

Everything you need.
Nothing you don't.

Auto-Config via YAML

Declare your entire experiment — model arch, optimiser, scheduler, paths — in one YAML. Fenn parses, validates, and injects it. No argparse sprawl.

config

Unified Logging

Structured log output — loss, metrics, hyperparams — wired up automatically. Every run gets a consistent, searchable trail without extra setup.

observability

Dashboard Integration

Connect your experiment tracking dashboard with a single config flag. Fenn handles initialisation, step logging, and teardown automatically.

monitoring

Notification System

Get notified the moment your run finishes, fails, or hits a new best metric. Know what's happening even when you're away from the terminal.

notifications

Built-in Trainers

Classification, regression, segmentation — Fenn ships battle-tested trainer loops so you can focus on architecture and data, not training boilerplate.

training

Reproducible Templates

Start any new project from a versioned, opinionated template. Seeds, environments, and artifact paths are locked in from the first commit.

reproducibility

Fine-tune a large language model
in under 100 lines

01

Install

$ pip install fenn fenn[transformers] datasets
02

Create a config

# fenn.yaml
project: lora-seq-cls

general:
  device: cuda

model:
  name: distilbert-base-uncased
  num_labels: 2
  max_length: 128

train:
  seed: 42
  epochs: 3
  lr: 2e-4
  batch: 16

lora:
  r: 8
  alpha: 16
  dropout: 0.1
03

Fine-tune

from fenn import Fenn
from fenn.nn.trainers import LoRATrainer
import torch.optim as optim
from torch.utils.data import DataLoader
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from datasets import load_dataset
from sklearn.metrics import accuracy_score

app = Fenn()

@app.entrypoint
def main(args):
    raw = load_dataset("sst2")
    tokenizer = AutoTokenizer.from_pretrained(args["model"]["name"])
    # ... build SentimentDataset and DataLoaders ...

    model = AutoModelForSequenceClassification.from_pretrained(
        args["model"]["name"], num_labels=args["model"]["num_labels"]
    )
    optimizer = optim.AdamW(
        model.parameters(), lr=float(args["train"]["lr"])
    )
    trainer = LoRATrainer(
        model=model, optim=optimizer, task_type="SEQ_CLS",
        r=args["lora"]["r"], lora_alpha=args["lora"]["alpha"],
        lora_dropout=float(args["lora"]["dropout"]),
        target_modules=["q_lin", "v_lin"],
        device=args["general"]["device"],
    )
    trainer.fit(train_loader, epochs=args["train"]["epochs"])
    predictions = trainer.predict(test_loader)
    print(f"Accuracy: {accuracy_score(test_labels, predictions):.4f}")

if __name__ == "__main__":
    app.run()
04

Launch

$ python main.py
// skip the setup

Or pull the template directly.

Fenn's template system bundles config, data loading, and the trainer into a single command. No scaffolding, no copy-pasting — just a complete, working pipeline from the first line.

$ fenn pull lora-cls

Ready to stop fighting boilerplate?

Fenn is open-source and free. Star it, use it, contribute.