Skip to content

Instantly share code, notes, and snippets.

View charles-cai's full-sized avatar

Charles Cai charles-cai

View GitHub Profile
@rohitg00
rohitg00 / llm-wiki.md
Last active June 1, 2026 21:02 — forked from karpathy/llm-wiki.md
LLM Wiki v2 — extending Karpathy's LLM Wiki pattern with lessons from building agentmemory

LLM Wiki v2

A pattern for building personal knowledge bases using LLMs. Extended with lessons from building agentmemory 10K Stars ⭐️, a persistent memory engine for AI coding agents.

This builds on Andrej Karpathy's original LLM Wiki idea file. Everything in the original still applies. This document adds what we learned running the pattern in production: what breaks at scale, what's missing, and what separates a wiki that stays useful from one that rots.

What the original gets right

The core insight is correct: stop re-deriving, start compiling. RAG retrieves and forgets. A wiki accumulates and compounds. The three-layer architecture (raw sources, wiki, schema) works. The operations (ingest, query, lint) cover the basics. If you haven't read the original, start there.

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.

@jlia0
jlia0 / agent loop
Last active May 31, 2026 20:04
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@willccbb
willccbb / grpo_demo.py
Last active May 12, 2026 07:13
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
"""
citation:
@misc{brown2025grpodemo,
title={Granular Format Rewards for Eliciting Mathematical Reasoning Capabilities in Small Language Models},
author={Brown, William},

Update firmware WD Black SN770 firmware on Arch Linux

Been having problems with my new SN770 drive, and decided to check if I can firmware update it on Linux. WD only provides a Windows tool, Western Digital Dashboard to download and install firmwares, but, it's possible to find the firmware and install it using Linux tooling as well.

1. Check that nvme-cli is installed:

❱ sudo pacman -S nvme-cli
@Databracket9
Databracket9 / API to Postgres ETL
Created July 7, 2024 09:51
End-to-End Data Engineering with Pandas
import pandas as pd
import requests
import configparser
import psycopg2
# raw_data = requests.get("https://storage.googleapis.com/generall-shared-data/startups_demo.json")
# with open("raw_files/raw_data.json", "w") as f:
# f.write(raw_data.text)
@Cdaprod
Cdaprod / Wireless-Bluetooth-USB-C-Keyboard-with-ESP32-S2-Mini.md
Created July 7, 2024 02:22
This setup enables your ESP32-S3 Mini to act as a wireless Bluetooth keyboard using a USB-C keyboard. Ensure you adapt the provided code examples to fit your specific setup and environment.

Building a Wireless Bluetooth USB-C Keyboard with ESP32-S3 Mini

Creating a wireless Bluetooth USB-C keyboard using an ESP32-S3 Mini involves connecting a USB-C keyboard to an ESP32-S3 via a USB Host Shield. This project allows you to transform a wired keyboard into a wireless one, leveraging Bluetooth communication. Below is a detailed guide on how to set up and program this system.

Components Needed

  1. ESP32-S3 Mini
  2. USB Host Shield or USB Host Adapter (e.g., USB Host Shield for Arduino or a USB Host Module)
  3. USB-C Keyboard
  4. USB-C to USB-A Adapter (if necessary)
@pykeras
pykeras / ollama_dedicated_gpu.md
Last active August 6, 2025 16:26
Run ollama on specific GPU(s)

Ollama GPU Selector: Customize GPU Usage for Ollama

If you want to run Ollama on a specific GPU or multiple GPUs, this tutorial is for you. By default, Ollama utilizes all available GPUs, but sometimes you may want to dedicate a specific GPU or a subset of your GPUs for Ollama's use. The idea for this guide originated from the following issue: Run Ollama on dedicated GPU.

Steps:

  1. Create a script let's call it ollama_gpu_selector.sh:

    nano ollama_gpu_selector.sh
@bigsnarfdude
bigsnarfdude / gpt2-ppo-training.ipynb
Last active July 18, 2025 11:04
gpt2-ppo-training.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@levelsio
levelsio / gist:5bc87fd1b1ffbf4a705047bebd9b4790
Last active May 4, 2026 14:08
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!