Skip to content

Instantly share code, notes, and snippets.

View alexlib's full-sized avatar
:octocat:
Working

Alex Liberzon alexlib

:octocat:
Working
View GitHub Profile
@alexlib
alexlib / llm-wiki.md
Created April 4, 2026 17:39 — 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.

@alexlib
alexlib / llamaCPP_Compilation_Execution_low-resources.md
Created April 3, 2026 14:13 — forked from 0ut0flin3/llamaCPP_Compilation_Execution_low-resources.md
llama.cpp on 2-core CPU + 8GB DDR2: My Full CPU-only Guide

Below are the generic details and resources of the machine I used:

  • Operating System: Linux Mint 22.3 - MATE 64-bit (safe-graphics / boot with 'nomodeset') - Linux Kernel: 6.14.0-37-generic
  • GPU: not relevant / not used
  • CPU: 2 cores – Intel® Core™2 Duo CPU E8400 @ 3.00GHz × 2
  • RAM: 8 GB (DDR2)

Given my recent personal good experience in running inference with CPU-only (no GPU) on local models up to 2B-4B parameters with more than acceptable speed and performance on really limited hardware and very little RAM, I decided to share the instructions and commands I used to compile llama.cpp on my machine and the arguments I currently use to launch llama.

@alexlib
alexlib / Dockerfile
Created August 25, 2025 21:41 — forked from Moosems/Dockerfile
Tkinter Docker App Example
FROM ubuntu:20.04 as builder
FROM python:3.10.7
# Create a user to run the application
RUN apt-get update && \
apt-get -y install sudo
RUN useradd -ms /bin/bash docker && echo "docker:docker" | chpasswd && adduser docker sudo
@alexlib
alexlib / bundle_adjustment_scipy.ipynb
Created March 14, 2025 18:01 — forked from nmayorov/bundle_adjustment_scipy.ipynb
Large scale bundle adjustment in scipy
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexlib
alexlib / simple_idw.ipynb
Created December 24, 2024 20:52 — forked from Majramos/simple_idw.ipynb
Simple inverse distance weighted (IDW) interpolation with python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexlib
alexlib / 00README.rst
Created December 13, 2024 15:53 — forked from GaelVaroquaux/00README.rst
Copy-less bindings of C-generated arrays with Cython

Cython example of exposing C-computed arrays in Python without data copies

The goal of this example is to show how an existing C codebase for numerical computing (here c_code.c) can be wrapped in Cython to be exposed in Python.

The meat of the example is that the data is allocated in C, but exposed in Python without a copy using the PyArray_SimpleNewFromData numpy

@alexlib
alexlib / embed_video.tex
Created April 22, 2023 11:01 — forked from FedericoTartarini/embed_video.tex
Embed a video into LaTeX wihout using Flash
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \embedvideo{<poster or text>}{<video file (MP4+H264)>}
% \embedvideo*{...}{...} % auto-play
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[bigfiles]{pdfbase}
\ExplSyntaxOn
\NewDocumentCommand\embedvideo{smm}{
\group_begin:
\leavevmode
@alexlib
alexlib / graph.py
Created December 9, 2022 06:15 — forked from aasensio/graph.py
import napari
import numpy as np
import matplotlib.pyplot as pl
import h5py
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
#from qtpy.QtWidgets import QApplication, QMainWindow, QPushButton, QMenu, QVBoxLayout, QSizePolicy, QMessageBox, QWidget, QPushButton
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
import sys
@alexlib
alexlib / MinMaxForPIV.py
Created October 19, 2022 21:28 — forked from nepomnyi/MinMaxForPIV.py
A python min-max filter implementation after Adrain & Westerweel, "Particle image velocimetry", 2011, p.250.
import cv2
import numpy as np
def minMaxFilter(img, filterSize, minContrast):
"""
After R.Adrian, J.Westerweel, "Particle image velocimetry", Cambridge
university press, 2011. See ch.6.1.2, p.248-250.
Parameters: img (cv2.imread) - image to be filtered
filterSize (nd.array) - a 1x2 numpy array of the filter height
and width correspondingly
@alexlib
alexlib / customDeen.py
Created October 19, 2022 21:28 — forked from nepomnyi/customDeen.py
The custom implementation of the PIV image preprocessing algorithm after N. Deen et al., "On image preprocessing for PIV of single- and two-phase flows over reflecting objects", Exp. Fluids, 49(2):525-530, 2010.
def customDeen(frame0,
frame1,
algorithmType = 'basic',
cliplimit = 2.0,
tileGridSize = (4, 4)
):
"""
This is the custom implementation of the image processing alogrithm for PIV
after Deen, Willems, Annaland, Kuipers, Lammertink, Kemperman, Wessling,
Meer, "On image preprocessing for PIV of single and two phase flows over