Skip to content

Instantly share code, notes, and snippets.

@freizl
freizl / microgpt.py
Created March 5, 2026 03:25 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and run inference for 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
<!-- This is a Node+WebSocket powered demo to sync videos
across different browsers. This file is the client,
the other one is the Node server. Powered by Node and
http://github.com/miksago/node-websocket-server -->
<style>
.inactive { display: none; }
.active { display: block; }
</style>
<script>
@freizl
freizl / promise.js
Created October 12, 2011 05:02 — forked from jcoglan/promise-monad.js
Monad in JS
/*
jsclass
http://jsclass.jcoglan.com/
npm install jsclass
*/
require('jsclass');
JS.require('JS.Deferrable');
Promise = new JS.Class({
include: JS.Deferrable,