Skip to content

Instantly share code, notes, and snippets.

@karpathy
karpathy / microgpt.py
Last active November 20, 2026 06:26
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
@3n21c0
3n21c0 / main.go
Last active November 16, 2026 20:51
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"