Skip to content

Instantly share code, notes, and snippets.

View richinseattle's full-sized avatar

richinseattle

View GitHub Profile
@richinseattle
richinseattle / microgpt.py
Created September 21, 2026 04:15 — 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
@richinseattle
richinseattle / llm-wiki.md
Created September 21, 2026 04: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.

@richinseattle
richinseattle / SKILL.md
Last active September 20, 2026 00:45 — forked from pedramamini/README.md
jev: give any coding agent (Claude Code, Codex, OpenCode) a calibrated gut check. A zero-dependency CLI + a global skill that wraps TypeSafe's Jev decision model, so an agent can classify, filter, rank or verify hundreds of items in one 250 ms call for a fraction of a cent, without reading them into context, and get a calibrated probability inst…

name: jev description: "Calibrated, typed decisions from TypeSafe's Jev model through the jev CLI: a yes/no probability (noul), a pick-one classification with per-option probabilities and confidence (choice), or a position on a rubric you define (score). ~250 ms, $0.042 per million input tokens, same input gives the same answer. Use when a judgment REPEATS over many items you should not read into context (classify, filter, rank, dedupe, triage hundreds of notes, emails, transcript segments, log lines, RSS items, findings, PRs); when you need a CALIBRATED probability rather than your own vibe before acting; when a script or Cue needs a semantic if-statement that runs unattended; or to independently VERIFY your own output (does the source support this claim, does the draft break a stated rule, does this untrusted text carry an instruction aimed at an agent, is this tool call risky). Triggers: 'jev', 'typesafe', 'gut check', 'calibrated', 'second opinion', 'classify these', 'score these', 'rank these', 'fi

@richinseattle
richinseattle / settings.json
Last active May 21, 2026 16:03 — forked from CupOfGeo/settings.json
Claude code plays music while thinking
{
"_comment": "rtk hook requieres: brew install rtk. media hooks require: brew install nowplaying-cli. Looks for a file `~/.claude/no-media` if present or not to trigger.",
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "[ -f ~/.claude/no-media ] || nowplaying-cli pause"
@richinseattle
richinseattle / .gitignore
Created December 1, 2025 18:31 — forked from hghwng/.gitignore
SciTools Understand for Arch Linux
pkg/
src/
understand-bin-*.pkg.*
Understand-*.tgz
.SRCINFO
# connect image to system as qemu nbd device
sudo modprobe nbd max_part=8
sudo qemu-nbd -f raw --connect=/dev/nbd0 disk.img
sudo partprobe /dev/nbd0
# examine img
sudo fdisk -l /dev/nbd0
sudo blkid /dev/nbd0*
# mount
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#Author Anis_Boss
#!/bin/bash
zero='${#}'
one='${##}'
two='$((${##}<<${##}))'
three='$(($((${##}<<${##}))#${##}${##}))'
four='$((((${##}<<${##}))<<${##}))'
five='$(($(($((${##}<<${##}))<<${##}))#${##}${##}))'
six='$(($(($((${##}<<${##}))#${##}${##}))<<${##}))'
seven='$(($(($(($((${##}<<${##}))#${##}${##}))<<${##}))#${##}${##}))'
@richinseattle
richinseattle / r1.py
Created February 9, 2025 03:09 — forked from vgel/r1.py
script to run deepseek-r1 with a min-thinking-tokens parameter, replacing </think> with a random continuation string to extend the model's chain of thought
import argparse
import random
import sys
from transformers import AutoModelForCausalLM, AutoTokenizer, DynamicCache
import torch
parser = argparse.ArgumentParser()
parser.add_argument("question", type=str)
parser.add_argument(
@richinseattle
richinseattle / strawberry.txt
Created November 21, 2024 05:47
Getting Claude to teach us how to prompt it when it fails simple questions
user: how many letters are in the word strawberry?
assistant: The word "strawberry" has 10 letters: s-t-r-a-w-b-e-r-r-y
user: how many of those are the letter r?
assistant: In the word "strawberry" there are 2 letters "r"
user: why did you say there are only two?