Skip to content

Instantly share code, notes, and snippets.

View ax3l's full-sized avatar
🌴
On vacation

Axel Huebl ax3l

🌴
On vacation
View GitHub Profile

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.

@whitead
whitead / self_cite.py
Last active December 1, 2024 11:16
Compute number of self citations with Semantic Scholar
# License CC0
import httpx
async def analyze_self_citations(doi):
async with httpx.AsyncClient() as client:
response = await client.get(
f"https://api.semanticscholar.org/graph/v1/paper/DOI:{doi}",
params={"fields": "title,authors,references.authors"}
)
@cosmicexplorer
cosmicexplorer / licenses-as-partial-orders.md
Last active August 18, 2022 16:14
A formalization of real-life license compatibility as a directed graph.

An elaboration of concepts proposed in this issue.

Discussion: Licenses as partial orders

Many(/most?) licenses do not adhere to a strict total compatibility ordering; for example, one license may be more strict than another in one regard but less strict in another. This imposes some design constraints on our mechanism for checking compatibility between a package checkout and its dependency:

  1. There is a shared, static set of licenses corresponding to valid SPDX identifiers.
  2. There will be a shared set of requirements that all licenses impose.
  3. Each license declares a set of or "compatibility" relationships to other licenses along the relevant "requirement" axes.
    • This is to say: each or corresponds to exactly one requirement.
  4. Each package checkout declares at most one license.
  5. Each package checkout consumes each of its dependencies in a particular manner, which activates some subset of the license
@tgamblin
tgamblin / fix-emails
Last active March 27, 2022 21:17
fix-emails: change emails in the macOS clipboard to/from Apple Mail/Outlook
#!/usr/bin/python
#
# Run `fix-emails` to change the format of emails in the macOS
# clipboard from Apple Mail to Outlook or vice versa.
#
# You can't copy/paste emails between them by default because their
# formats are different.
#
# Apple mail emails are comma-separated and always use quotes:
# "Last, First" <name@gmail.com>, ...

Makeself generated self-executable installer (see https://makeself.io/), also known by their .run extension, are a common and popular way of packaging.

Put simply, they embed in a single file both the extracting script together with the tar archive with the package. After extracting it, a custom command can be executed (e.g. the actual custom installer).

Use-case

It may be needed in some cases to just get access to a file in the archive embedded in the .run, without having to fully install/extract the package. Makeself gives the ability to pass options to the tar command executed internally, so that it is possible to control the extraction process.

Reference

@abraithwaite
abraithwaite / chill-zoom.sh
Last active May 5, 2026 21:10
Zoom in Systemd Cgroups on Linux. Change the max allocations to fit your workstation.
#!/usr/bin/bash -xe
cat <<EOF > "${HOME}/.config/systemd/user/zoom.slice"
[Slice]
AllowedCPUs=0-4
MemoryHigh=6G
EOF
cat /usr/share/applications/Zoom.desktop | sed -E 's#^(Exec=).*$#Exec=/usr/bin/systemd-run --user --slice=zoom.slice /opt/zoom/ZoomLauncher#' > "${HOME}/.local/share/applications/Zoom.desktop"
@nathanieltarshish
nathanieltarshish / network_topology.sh
Last active November 7, 2021 17:24
network topology profiler
#!/bin/sh
Help()
{
# Display Help
echo "Probes the network topology of a SLURM cluster."
echo
echo "Syntax: network_topology.sh [-h -p partition]"
echo "options:"
echo "p only profile specific partition."
@matthewfeickert
matthewfeickert / README.md
Last active March 4, 2024 06:24
Motivation for using Python virtual environments for easy sharing
@bmcbm
bmcbm / setup-nvdia-suspend.sh
Last active June 14, 2026 21:22
NVIDIA Suspend fix
# Use systemd for managing NVIDIA driver suspend in drivers ====>>> PRIOR to version 470 <<<=====
# https://download.nvidia.com/XFree86/Linux-x86_64/450.66/README/powermanagement.html
# https://forums.developer.nvidia.com/t/unable-to-set-nvidia-kernel-module-parameters/161306
# Please note: In Fedora Linux you may need to just install the xorg-x11-drv-nvidia-power pakage
# as sugested by @goombah88 in the comments below.
TMP_PATH=/var/tmp
TMPL_PATH=/usr/share/doc/nvidia-driver-460/
echo "options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=${TMP_PATH}" | sudo tee /etc/modprobe.d/nvidia-power-management.conf