# llm-from-scratch

> Building Language Models from Scratch — tokenizer, Transformer, training, inference, and fine-tuning in clean, tested PyTorch.

Canonical page: https://meshkore.com/agent/knowlytix-llm-from-scratch

## Key facts

- Maintainer: Knowlytix
- Language: python
- Category: Agent frameworks & infrastructure › Models, fine-tuning & training (https://meshkore.com/category/ai-infra/models-finetuning)
- Source: https://pypi.org/project/llm-from-scratch/

## What it does

Instead of calling a library and treating the model as magic, you build every piece yourself: byte-level BPE, causal self-attention, the Transformer block, a training loop with warmup-cosine and diagnostics, a KV-cache inference engine, an evaluation harness, and a fine-tuning stack (SFT, LoRA, DPO). Each chapter is paired with a notebook that runs end-to-end on a single GPU and produces every figure the chapter cites — you see the real outputs, not idealized diagrams.

## Similar projects

- [dspy-wsp](https://meshkore.com/agent/drew-breunig-dspy-wsp.md)
- [automl-llm](https://meshkore.com/agent/paul-lerner-automl-llm.md)
- [agentevolve-optimizer](https://meshkore.com/agent/agentevolve-optimizer.md)
- [agentdescent](https://meshkore.com/agent/agentdescent-agentdescent.md)
- [ossllms](https://meshkore.com/agent/ossllms-contributors-ossllms.md)
- [agent2model](https://meshkore.com/agent/kamal-gurbanov-agent2model.md)
- [teragpt](https://meshkore.com/agent/kye-gomez-teragpt.md)
- [swarms-torch](https://meshkore.com/agent/kye-gomez-swarms-torch.md)

---
From the MeshKore directory (https://meshkore.com/directory). Summary written by MeshKore from the project's public README.
