Skip to content

Instantly share code, notes, and snippets.

View Kashif-E's full-sized avatar
:bowtie:

Kashif Mehmood Kashif-E

:bowtie:
View GitHub Profile
/*
* Copyright 2026 Kyriakos Georgiopoulos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
@Kashif-E
Kashif-E / microgpt.py
Created February 13, 2026 11:48 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and inference a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp