Skip to content

Instantly share code, notes, and snippets.

View kaimallea's full-sized avatar
:octocat:

Kai Mallea kaimallea

:octocat:
View GitHub Profile
@kaimallea
kaimallea / llm-wiki.md
Created October 26, 2026 22:55 — 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.

@kaimallea
kaimallea / microgpt.py
Created October 23, 2026 14:31 — forked from karpathy/microgpt.py
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
@kaimallea
kaimallea / .vimrc
Last active June 22, 2019 20:30
.vimrc
set nocompatible " disable compatibility with legacy vi (i.e., enable 'new' features)
set autoindent " copy indent from current line when starting new line
set backspace=indent,eol,start " allow backspacing over autoindent, line breaks, start of insert
set cursorline " highlight the screen line of the cursor
set encoding=utf-8
set expandtab " in insert mode: use the appropriate number of spaces to insert a tab
if has("gui_running")
set antialias " use smooth (antialiased) fonts (OSX GUI only)
set guifont=Operator\ Mono:h16,Dank\ Mono:h16,Courier:h16 " list of fonts to use in GUI version of Vim
endif
@kaimallea
kaimallea / .zshrc
Last active June 22, 2019 20:30
zshrc for linux & osx
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
diff --git a/test/js/common.js b/test/js/common.js
index 8c26dd8..e891743 100644
--- a/test/js/common.js
+++ b/test/js/common.js
@@ -58,7 +58,7 @@ global.spweb = {};
html = '<html><body></body></html>';
}
- jsDomDocument = jsdom(html, null, {
+ jsDomDocument = jsdom(html, {
struct PlayerRoundStats_t {
int team, kills, deaths, clutch_kills;
};
typedef std::unordered_map<const char *, PlayerRoundStats_t> PlayerRoundStatsMap_t;
typedef std::unordered_map<int, PlayerRoundStatsMap_t> RoundStatsMap_t;
Represents:
@kaimallea
kaimallea / UDPClient.hpp
Created November 25, 2014 21:25
Super simple UDP client using boost
#include <iostream>
#include <boost/array.hpp>
#include <boost/asio.hpp>
using boost::asio::ip::udp;
class UDPClient
{
public:
UDPClient(
@kaimallea
kaimallea / keybase.md
Created April 16, 2014 14:53
keybase.md

Keybase proof

I hereby claim:

  • I am kaimallea on github.
  • I am kmallea (https://keybase.io/kmallea) on keybase.
  • I have a public key whose fingerprint is 7EBC 00A2 5D54 DA6F 137B 9325 2EBD 9C14 7D81 4E8D

To claim this, I am signing this object:

@kaimallea
kaimallea / autoexec.cfg
Last active August 18, 2024 05:26
CS:GO Autoexec file (goes in \Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg)
//Steam startup option: -novid -console -high -freq 120
//Network Commands
rate "128000"
cl_interp "0"
cl_interp_ratio "1"
cl_cmdrate "128"
cl_updaterate "128"
fps_max "300"
cl_showfps "1"
@kaimallea
kaimallea / .tmux.conf
Created November 11, 2013 23:36
Tmux Config
set-option -g default-terminal "screen-256color"
set-option -s escape-time 1
set-option -g base-index 1
# Bind v/h-split
bind | split-window -h
bind - split-window -v