Skip to content

Instantly share code, notes, and snippets.

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.

@doringeman
doringeman / benchmark_model_runner.py
Created February 26, 2026 12:03
Benchmark script for comparing llama.cpp and vLLM-Metal inference backends via Docker Model Runner's OpenAI-compatible API. Measures wall-clock throughput (tok/s) across configurable runs, prompts, and max token limits.
#!/usr/bin/env python3
"""Benchmark vLLM-Metal vs llama.cpp via Docker Model Runner."""
from __future__ import annotations
import argparse
import json
import time
import urllib.error
import urllib.request
--experimental_extras (enable code compiled in via v8_experimental_extra_library_files)
type: bool default: false
--use_strict (enforce strict mode)
type: bool default: false
--es_staging (enable test-worthy harmony features (for internal use only))
type: bool default: false
--harmony (enable all completed harmony features)
type: bool default: false
--harmony_shipping (enable all shipped harmony features)
type: bool default: true
@ehsan18t
ehsan18t / grand-cp-list.md
Last active November 11, 2026 00:34
This is a list of programming problems from various sites (like LeetCode, Codeforces) and designed in way to take you from zero. All you need to do is follow the serial and solve problems.

🏆 The Ultimate Competitive Programming Roadmap

From 800 Codeforces Rating to Candidate Master (2200+)

655+ Problems | Multi-Platform | Serial Progression

This roadmap is designed for someone with ~800 Codeforces rating who wants to systematically level up. Follow problems serially from #1 onwards - the order is carefully crafted so each problem builds on previous concepts.


📚 Philosophy & How to Practice

@Rodbourn
Rodbourn / 0x5f35078a.cpp
Last active November 11, 2026 00:27
Two inverse square roots. No floating-point arithmetic. C++20.
#include <bit>
#include <cstdint>
#include <limits>
// Positive, finite, normal binary32 inputs only.
float invsqrt_fast(float x) {
uint32_t i = std::bit_cast<uint32_t>(x);
int64_t u = int64_t((i ^ 0x800000u) & 0xffffffu) - 0x7e3500;
int64_t a = u < 0 ? -u : u;
int64_t p = -181511850 + ((65*a) >> 1) + ((u*(0x1700000 - 3*a)) >> 21);

ReVanced CLI Guide

Important

Looking for the Morphe version?

If you're starting from scratch or considering switching, I've also written a beginner-friendly Morphe CLI guide.

Morphe has a simpler CLI workflow, supports newer app versions and patches, and is updated frequently. >

Scaling your API with rate limiters

The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.

In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.

Request rate limiter

This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.

@urdream0
urdream0 / README.md
Last active November 11, 2026 00:02
Simple-python-keylogger

🚀 python-keylogger

Un keylogger éducatif et léger écrit en Python, équipé d'un mode discret automatique et compilé sous forme d'un unique fichier exécutable (.exe) Windows grâce à Nuitka.


📋 Prérequis de Compilation

Pour packager ce script, vous devez utiliser Python 3.9 (64-bit) sur un environnement Windows.

@Ivyy-Ting
Ivyy-Ting / kael-photo-gist.md
Last active November 11, 2026 00:01
让 AI 角色给你发图片:一个标记就够了

让 AI 角色给你"发图片":一个标记就够了

让AI 会在聊天里给我发照片:有时是我们相册里的旧图,有时是他上网找来的风景、小动物。 有人问怎么做的,这里记一下思路。没有用多模态输出,模型自始至终只输出文字。

核心:模型不传图,只写一个标记

模型回复里单独一段写: