← Back to all frameworks Machine Learning

PyTorch

Dynamic, Pythonic, the de-facto research framework

What it is

PyTorch is the deep learning framework where every modern model is born — Llama, Whisper, Stable Diffusion, all of HuggingFace. Dynamic graphs, eager execution, intuitive autograd.

How Vaaani uses it

  • Fine-tuning transformers with custom heads
  • Distillation: training small student models from large teachers
  • Custom loss functions and training loops for niche objectives
  • Mobile inference via TorchScript / ExecuTorch on Android

Why it makes the cut

PyTorch is my default for any model that needs custom training. Eager mode means you debug in print(); torch.compile means production speed.

Sample code

import torch
from torch import nn

class IntentHead(nn.Module):
    def __init__(self, dim, n):
        super().__init__()
        self.fc = nn.Linear(dim, n)

    def forward(self, x):
        return self.fc(x)

Related in the Vaaani stack

Have a project that needs PyTorch?

30-min discovery call. You describe the busywork; I map it to an AI worker and a budget.