Skip to content

Instantly share code, notes, and snippets.

@lloydchang
lloydchang / karpathy-llm-wiki.md
Last active May 20, 2026 07:44 — forked from karpathy/llm-wiki.md
karpathy-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.

@lloydchang
lloydchang / amazon.md
Created January 6, 2025 22:46 — forked from terabyte/amazon.md
Amazon's Build System

Prologue

I wrote this answer on stackexchange, here: https://stackoverflow.com/posts/12597919/

It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.

The Question

Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?

@lloydchang
lloydchang / openrouter.ts
Created December 13, 2024 07:49 — forked from ewired/openrouter.ts
OpenRouter MCP Server
#!/usr/bin/env -S deno run --allow-net --allow-env
/*
{
"mcpServers": {
"openrouter": {
"command": "/path/to/deno",
"args": [
"run",
"--allow-net",
"--allow-env",
@lloydchang
lloydchang / searxng.ts
Created December 13, 2024 06:50 — forked from ewired/searxng.ts
SearXNG MCP server
#!/usr/bin/env -S deno run --allow-net
/*
{
"mcpServers": {
"searxng": {
"command": "/path/to/deno",
"args": [
"run",
"--allow-net",
"/home/<YOUR USERNAME>/Documents/Cline/MCP/searxng.ts",
@lloydchang
lloydchang / claude_3.5_sonnet_artifacts.xml
Created December 5, 2024 09:53 — forked from dedlim/claude_3.5_sonnet_artifacts.xml
Claude 3.5 Sonnet, Full Artifacts System Prompt
<artifacts_info>
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.
# Good artifacts are...
- Substantial content (>15 lines)
- Content that the user is likely to modify, iterate on, or take ownership of
- Self-contained, complex content that can be understood on its own, without context from the conversation
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)
- Content likely to be referenced or reused multiple times
Questions are not from any actual exam!!!
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
@lloydchang
lloydchang / CKAD.md
Created December 1, 2024 01:19 — forked from veggiemonk/CKAD.md
CKAD exam preparation
@lloydchang
lloydchang / claude-autoclicker.sh
Created November 26, 2024 18:17 — forked from supersational/claude-autoclicker.sh
Claude Autoclick "Allow Tool"
while true; do
osascript -e '
tell application "System Events"
if exists process "Claude" then
tell process "Claude"
if exists button "Allow for This Chat" of group 2 of group 1 of group 1 of group 1 of UI element 2 of group 1 of group 1 of group 1 of group 1 of window "Claude" then
click button "Allow for This Chat" of group 2 of group 1 of group 1 of group 1 of UI element 2 of group 1 of group 1 of group 1 of group 1 of window "Claude"
log "clicked allow button"
end if
end tell
@lloydchang
lloydchang / dev-containers-cloud-native.md
Created November 19, 2024 17:16 — forked from craiglpeters/dev-containers-cloud-native.md
Dev Containers in the Cloud Native Ecosystem

Dev Containers

https://containers.dev an open spec that extends container definition to also include dev environment configuration including:

  • packages
  • lifecycle automation
  • processes
  • IDE configurations
  • remote connection
  • port forwarding