Code Explorer
Every Python file in the repository at the pinned commit, with its functions, its mathematics, what uses it, and its full source.
This list is read from data/generated/code-index.json, so it holds every Python file the extractor found and nothing else. Files in tests/ are labelled as tests.
| File | Kind | Lines | Functions | Purpose |
|---|---|---|---|---|
| checkpoint.py | Source | 46 | 2 | Save and load weights, model shape and tokenizer |
| config.py | Source | 44 | 0 | Hyperparameters as module-level constants, plus two import-time assertions |
| data.py | Source | 43 | 5 | Corpus loading, encoding, split, windows, batches |
| generate.py | Source | 35 | 2 | Sampling and the generation loop |
| gradcheck.py | Source | 33 | 3 | Finite-difference gradient checker, used only by tests |
| ops.py | Source | 60 | 12 | Differentiable operations with hand-written backward functions |
| optim.py | Source | 50 | 5 | Adam with decoupled weight decay, learning-rate schedule, gradient clipping |
| talk.py | Source | 30 | 1 | Interactive inference entry point |
| tokenizer.py | Source | 119 | 10 | Byte-pair-encoding (BPE) tokenizer, working on characters |
| train.py | Source | 85 | 3 | Training entry point |
| transformer.py | Source | 190 | 15 | Parameters, forward pass, backward pass |
tests/ | ||||
| test_checkpoint.py | Test | 76 | 8 | Checkpoint tests |
| test_data.py | Test | 83 | 11 | Data pipeline tests |
| test_generate.py | Test | 82 | 13 | Sampling tests |
| test_gradcheck.py | Test | 39 | 4 | Gradient-check tests |
| test_ops.py | Test | 88 | 10 | Operation tests |
| test_optim.py | Test | 49 | 6 | Optimizer, schedule and clipping tests |
| test_tokenizer.py | Test | 50 | 9 | Tokenizer tests |
| test_transformer.py | Test | 110 | 11 | Model tests |
Each file's page shows where the file fits in the pipeline, what it imports, what uses it according to the call graph, the concepts that link to it, and its source with real line numbers.
A link to a function scrolls to it and highlights it, for example ops.softmax_forward. A link to one line works the same way, for example the line that saves the weights.
The call graph is static. It follows calls by name and by known types, so a call on a value of unknown type, such as a callback parameter, creates no "used by" entry.