Skip to content

Instantly share code, notes, and snippets.

View gerritgr's full-sized avatar

Gerrit gerritgr

View GitHub Profile

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.

@Flunzmas
Flunzmas / calc_2_wasserstein_dist.py
Last active March 2, 2026 09:00
Differentiable 2-Wasserstein Distance in PyTorch
import math
import torch
import torch.linalg as linalg
def calculate_2_wasserstein_dist(X, Y):
'''
Calulates the two components of the 2-Wasserstein metric:
The general formula is given by: d(P_X, P_Y) = min_{X, Y} E[|X-Y|^2]
For multivariate gaussian distributed inputs z_X ~ MN(mu_X, cov_X) and z_Y ~ MN(mu_Y, cov_Y),
@wohlert
wohlert / Sinkhorn-solver.ipynb
Created April 3, 2019 11:43
Sinkhorn solver in PyTorch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kiwidamien
kiwidamien / pre-commit
Last active February 5, 2023 10:59
Github pre-commit hook to prevent commits of large files
#!/bin/sh
# This is a pre-commit hook that ensures attempts to commit files that
# are larger than 100 MB to your _local_ repo fail, with a helpful error
# message.
#
# This prevents the local repo from getting out of sync with the Github
# repo. To install
# 1) Change this file to executable:
# $ chmod a+x pre-commit
@nlap
nlap / graph-tool-ubuntu.md
Last active January 3, 2022 21:07
graph-tool on Ubuntu 14.04

graph-tool on Ubuntu 14.04

Recommended: Graph-tool one-line install commands:

anaconda conda create --name gt -c conda-forge graph-tool

homebrew brew install graph-tool