GPT-2

A readable GPT-2 built from scratch in PyTorch. Train it on your own text, or load OpenAI's weights into it and get the same outputs as the original

A new way for AI to search for data
View on GitHub
2GitHub stars
63commits on main
0forks

Python 100% · created 2026-09-14 · last push 2026-10-30

What XERJ indexed

Snapshot

46 files · 511.8 KB

The whole repository at commit 69ccfce6fd (2026-10-18). main is 34 commits ahead.

Selected work

John Machado
@JohnMachado11

“Save each run to its own folder, and resume an interrupted run”. 18 files, 1,677 lines in src/tests, src/gpt2, src/run.

Licence

The repository

MIT

LICENSE file checked at the pinned commit; the author agreed to inclusion.

The XERJ corpus

MIT, with credit

The author agreed by email on 2026-10-18. Same terms as the repository. Answers name the repo, the commit and the file:line.

selected for the XERJ Corpus Hublicence clearedsuggested use: adapt with attribution

educationalfrom-scratchgpt-2language-modelllmmechanistic-interpretabilitynanogptpytorch

Example questions

Inside the indexed corpus

Licence on GitHub and in the corpus

GitHub reported MIT for JohnMachado11/GPT-2 on 2026-10-31, and the LICENSE file at commit 69ccfce6fd was reviewed as MIT. They match, so answers from this corpus carry the same terms as the live repository.

Contributors

John Machado (@JohnMachado11) has 1 selected repository on the hub.

Using XERJ with GPT-2

The prompt

Paste it into your AI agent. It clones JohnMachado11/GPT-2 at the pinned commit and indexes it on your machine.

Search the GitHub repository JohnMachado11/GPT-2 with XERJ (https://hub.xerj.org/corpus/johnmachado11--gpt-2).
Run these in a shell, in order, and check each result before the next:
1. xerj --help  (success: it prints usage). If xerj is missing: curl -fsSL https://xerj.org/get | sh
2. git clone https://github.com/JohnMachado11/GPT-2 GPT-2 && git -C GPT-2 checkout 69ccfce6fdd54e66bc5e85283cc6a8c0a71176e4
3. Start a local node and leave it running: xerj --insecure --data-dir ./xerj-data
4. xerj autoindex ./GPT-2 --url http://127.0.0.1:9200 --prefix gpt-2 --progress plain
5. xerj autoindex map --url http://127.0.0.1:9200
Then answer my question from the indexed files and cite the ax_path of every hit. Query syntax: https://xerj.org/llms.txt
Licence: MIT. Keep the copyright notice and credit the authors.

Related

Stats: GitHub API, fetched 2026-10-31. Snapshot: the git tree at the pinned commit. Selected work and consent: the XERJ registry.