Skip to content

Instantly share code, notes, and snippets.

View MrgSub's full-sized avatar
:electron:
Focusing

Adam MrgSub

:electron:
Focusing
View GitHub Profile
@MrgSub
MrgSub / microgpt.py
Created February 12, 2026 00:09 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and inference a GPT LLM in pure, dependency-free Python.
Differences from GPT-2 are minor: layer norm -> rmsnorm, no biases, GeLU -> square ReLU, no weight tying.
The contents of this file is everything algorithmically needed to train a GPT. Everything else is just efficiency.
Art project by @karpathy.
"""
import os # for os.path.exists
import time # for time.perf_counter
import math # for math.log, math.exp
import { defineSchema, defineTable } from 'convex/server';
import { v } from 'convex/values';
const Sender = v.object({
name: v.optional(v.string()),
email: v.string(),
});
export default defineSchema({
user: defineTable({