Skip to content

Instantly share code, notes, and snippets.

@willb
willb / llm-wiki.md
Created July 1, 2026 17:13 — forked from karpathy/llm-wiki.md
llm-wiki

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.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import altair as alt
from vega_datasets import data
source = alt.topo_feature(data.world_110m.url, "countries")
osm_url, otm_url = ('https://tile.openstreetmap.org/', 'https://tile.opentopomap.org/')
select_urls = alt.binding_select(options=[osm_url, otm_url], name='select tile service')
param_urls = alt.param(bind=select_urls, value=osm_url)
param_tx = alt.param(expr="width / 2")
param_ty = alt.param(expr="height / 2")
param_base_tile_size = alt.param(value=256)

How to get firmware onto mutable modules

I had the best luck with the Black Magic Probe and gdb.

Install compiler

First install the arm compiler:

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
@willb
willb / expenv.sh
Created December 2, 2019 19:48 — forked from sophwats/expenv.sh
#!/bin/sh
while getopts ":if:" opt; do
case $opt in
f)
useFile=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
## temporary installing Strimzi
oc apply -f https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.8.2/strimzi-cluster-operator-0.8.2.yaml
# Simple Cluster with one ZK and one Kafka node
oc apply -f https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/master/examples/kafka/kafka-persistent-single.yaml

oc get pods -n myproject -w 

wait...

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@willb
willb / appText.py
Created September 30, 2016 19:38
k-means microbenchmark with text-file input
import argparse
from time import clock
from pyspark.sql import SparkSession
from pyspark.mllib.clustering import KMeans
from numpy import fromstring
parser = argparse.ArgumentParser()
parser.add_argument('--master', help='Spark master URL (default: "local[*]")', default="local[*]")
@willb
willb / explanation.md
Created September 14, 2016 21:29 — forked from masak/explanation.md
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

// 'small' was a subsample of meta-full parquet
scala> small.orderBy(small("@timestamp")).map(utils.toJSON).saveAsTextFile("/home/eje/logdemo/logs_ordered.json")