Skip to content

Instantly share code, notes, and snippets.

@rohitg00
rohitg00 / llm-wiki.md
Last active June 16, 2026 02:54 — forked from karpathy/llm-wiki.md
LLM Wiki v2 — extending Karpathy's LLM Wiki pattern with lessons from building agentmemory

LLM Wiki v2

A pattern for building personal knowledge bases using LLMs. Extended with lessons from building agentmemory 20K+ Stars ⭐️, a persistent memory engine for AI coding agents.

This builds on Andrej Karpathy's original LLM Wiki idea file. Everything in the original still applies. This document adds what we learned running the pattern in production: what breaks at scale, what's missing, and what separates a wiki that stays useful from one that rots.

What the original gets right

The core insight is correct: stop re-deriving, start compiling. RAG retrieves and forgets. A wiki accumulates and compounds. The three-layer architecture (raw sources, wiki, schema) works. The operations (ingest, query, lint) cover the basics. If you haven't read the original, start there.

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@Chrisbryan17
Chrisbryan17 / microgpt.py
Last active March 23, 2026 07:25 — forked from karpathy/microgpt.py
microgpt
#!/usr/bin/env python3
"""
microgpt2.py
A dependency-free, single-file GPT-style language model in pure Python.
Key properties:
- stdlib only
- explicit forward/backward kernels (no generic scalar autograd)
- flat float32 parameter buffers using array('f')
@busfahrer
busfahrer / microgpt-moe.py
Created March 10, 2026 15:36
MoE hack of 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
@logan-robbins
logan-robbins / microgpt_dnb.py
Created March 5, 2026 19:45 — forked from karpathy/microgpt.py
microgpt_dnb — Karpathy's microgpt + Dynamic Notes Bus for parallel decoding
"""
microgpt_dnb.py — Fork of Karpathy's microgpt with Dynamic Notes Bus
Original: https://gist.github.com/karpathy/8627fe009c40f57531cb18360106ce95
Paper: https://arxiv.org/abs/2512.10054
Code: https://github.com/logan-robbins/parallel-decoder-transformer
Karpathy's microgpt is the complete GPT algorithm in ~200 lines of pure Python.
This fork adds ~100 lines to show where the Dynamic Notes Bus (DNB), Shared
Notes Cross-Attention (SNC), and Planner Head fit inside the transformer to
@olveirap
olveirap / microgpt.py
Last active March 4, 2026 16:00 — forked from karpathy/microgpt.py
fadam-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
@mplekh
mplekh / tapegpt.py
Last active March 12, 2026 00:43
Karpathy's microgpt modified to use Wengert Tape architecture (Flat Array of Values instead of Graph of Objects)
import math
import random
random.seed(42)
# -----------------------------------------------------------------------------
# Tape-based Autograd Engine
# -----------------------------------------------------------------------------
class Tape:
"""
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
@nort3x
nort3x / readme.md
Last active June 15, 2026 11:30
prevent Jetbrains products (Intellij, Webstorm, Rider, Goland ...) checking for validity of License - don't use ja-netfilter

Warning

I see many people proposing solutions for other platforms (such as Windows or macOS). I cannot verify the authenticity of those methods, and you should not copy, paste, and run code from random people on the internet without first understanding what it does. Ideally, review every line carefully and, even then, run it with caution in a sandboxed environment.

Introduction

I personally experienced slowdowns and issues while using the ja-netfilter agent.

I decided to investigate how JetBrains checks license validity, because despite explicitly configuring JetBrains to work offline, it still attempts to validate licenses.

Here are my findings:

@jet10000
jet10000 / https-during-dev.macos.sh
Created October 3, 2022 13:52 — forked from disintegrator/https-during-dev.macos.sh
Use Caddy, mkcert and dnsmasq to expose your development server over HTTPS
brew install caddy mkcert nss dnsmasq
mkcert -install
mkcert '*.app.test' '*.cdn.test'
# rename the certs and move them under /usr/local/etc/caddy/certs
cat <<EOF > /usr/local/etc/caddy/Caddyfile
*.app.test:443, *.cdn.test:443 {