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
#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 / cups-browsed.md
Created September 27, 2024 00:34 — forked from stong/cups-browsed.md
CUPS disclosure leaked online. Not my report. The original author is @evilsocket

Original report

  • Affected Vendor: OpenPrinting
  • Affected Product: Several components of the CUPS printing system: cups-browsed, libppd, libcupsfilters and cups-filters.
  • Affected Version: All versions <= 2.0.1 (latest release) and master.
  • Significant ICS/OT impact? no
  • Reporter: Simone Margaritelli [evilsocket@gmail.com]
  • Vendor contacted? yes The vendor has been notified trough Github Advisories and all bugs have been confirmed:
@richinseattle
richinseattle / gist:815106f878a64adde45fcf4183e4cc8c
Created July 22, 2024 06:40 — forked from shinyquagsire23/gist:ab6f7c0f9b6514b6b54d69b9a57646be
Enabling USB device mode on Intel devices (Tweet archive)
https://twitter.com/ShinyQuagsire/status/1536432635643211777 12:37 PM · Jun 13, 2022
-----
I figured out how to enable USB device mode on my XPS 13 (9350) 🎉
Though for some ungodly reason, it uses the right-side full USB port. So a crossover cable is required.
-----
https://twitter.com/ShinyQuagsire/status/1536434057671716864 12:43 PM · Jun 13, 2022
-----
@richinseattle
richinseattle / llama-3-70B-qlora.yaml
Created June 1, 2024 11:13 — forked from mtisz/llama-3-70B-qlora.yaml
Axolotl Config for Llama-3-70B QLoRA
base_model: meta-llama/Meta-Llama-3-70B
model_type: LlamaForCausalLM
tokenizer_type: AutoTokenizer
load_in_8bit: false
load_in_4bit: true
strict: false
datasets:
- path: /home/migel/ai_datasets/tess-v1.5b-chatml.jsonl