Skip to content

Instantly share code, notes, and snippets.

View Ewen2015's full-sized avatar
🥥

Ewen Wang Ewen2015

🥥
View GitHub Profile
@Ewen2015
Ewen2015 / llm-wiki.md
Created April 20, 2026 13:11 — 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.

@Ewen2015
Ewen2015 / generate_ssh_key.bash
Created February 23, 2024 08:27
Generating a new SSH key and adding it to the ssh-agent
function generate_ssh_key () {
read -p "Enter github email : " email
echo "Using email $email"
ssh-keygen -t ed25519 -C "$email"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
pub=`cat ~/.ssh/id_ed25519.pub`
echo "$pub"
@Ewen2015
Ewen2015 / notebook_remote.sh
Created May 31, 2023 05:50
setup a jupyter notebook remotely and open it locally
pip install jupyter lab
jupyter notebook --generate-config
cd ~/.jupyter
vi jupyter_notebook_config.py
# # The IP address the notebook server will listen on.
# c.NotebookApp.ip = '0.0.0.0' # default value is 'localhost'
# c.NotebookApp.open_browser = False # default value is True
@Ewen2015
Ewen2015 / plotly in SageMaker
Last active May 25, 2023 03:36
show plotly plot in AWS SageMaker notebook
import plotly.io as pio
pio.renderers.default = 'iframe'
@Ewen2015
Ewen2015 / tf-experiment-template.py
Created December 12, 2018 14:06 — forked from damienpontifex/tf-experiment-template.py
A template for a custom tensorflow estimator and experiment with python3 typings for desired parameter types
import argparse
import psutil
import tensorflow as tf
from typing import Dict, Any, Callable, Tuple
## Data Input Function
def data_input_fn(data_param,
batch_size:int=None,
shuffle=False) -> Callable[[], Tuple]:
"""Return the input function to get the test data.
require(caret)
trans = preProcess(X, c("BoxCox", "center", "scale"))
predictorsTrans = data.frame(trans = predict(trans, X))
<snippet>
<content><![CDATA[
# =============================================================
# Basic
import os
# Fundamental Libraries for Scientific Computing
import numpy as np
import pandas as pd
import scipy as sp