Skip to content

Instantly share code, notes, and snippets.

View theycallmeloki's full-sized avatar

theycallmeloki theycallmeloki

View GitHub Profile

Alignment Notice — July 2025

MiladyOS began as a creative experiment: part infrastructure metaphor, part cultural remix, part personal mythos.

In its early phases, it used abstract language, surreal imagery, and intentionally ambiguous tone. While this was never intended to cause harm or misinterpretation, I now recognize that parts of the original presentation lacked clarity for broader audiences.

To realign with my own values — and those of responsible open-source development — I’ve made the following changes:

  • Archived all experimental content under a private repository
  • Rewritten the public README for safety, maturity, and neutrality
@theycallmeloki
theycallmeloki / k3s.sh
Last active July 20, 2024 06:15
kubernetes miladyos bootstrapper script with password auth
#!/bin/bash
echo -e " \033[33;5m __ _ _ ___ \033[0m"
echo -e " \033[33;5m \ \(_)_ __ ___( )__ / _ \__ _ _ __ __ _ __ _ ___ \033[0m"
echo -e " \033[33;5m \ \ | '_ \` _ \/ __| / /_\/ _\` | '__/ _\` |/ _\` |/ _ \ \033[0m"
echo -e " \033[33;5m /\_/ / | | | | | \__ \ / /_\\ (_| | | | (_| | (_| | __/ \033[0m"
echo -e " \033[33;5m \___/|_|_| |_| |_|___/ \____/\__,_|_| \__,_|\__, |\___| \033[0m"
echo -e " \033[33;5m |___/ \033[0m"
echo -e " \033[36;5m _ _________ ___ _ _ _ \033[0m"
from flask import Flask, request, jsonify
from escpos.printer import Usb
app = Flask(__name__)
# Run with sudo
# Configure your USB printer
# Analog Devices, Inc. H58 Printer settings
VENDOR_ID = 0x0456
PRODUCT_ID = 0x0808
@theycallmeloki
theycallmeloki / batch_template.py
Created February 4, 2024 04:32
Generic batch parquet template
import asyncio
from quart import Quart
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import os
import pandas as pd
from vllm import LLM, SamplingParams
from langchain.llms import VLLM
from collections import deque
import threading
@theycallmeloki
theycallmeloki / axolotl-train.Jenkinsfile
Last active December 13, 2023 10:49
Axolotl finetune mistral (miladyos)
pipeline {
agent any
stages {
stage('Run Training Session') {
agent {
docker {
image 'winglian/axolotl:main-py3.10-cu118-2.0.1'
args '--privileged --gpus all --shm-size 10g --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 --mount type=volume,src=axolotl,target=/workspace/axolotl -v ${HOME}/.cache/huggingface:/root/.cache/huggingface'
}
@theycallmeloki
theycallmeloki / minikube-to-regular-user.py
Last active February 2, 2024 17:35
grab pachyderm config and kubeconfigs from root minikube user and provision them under the regular user (RUN THIS WITH SUDO)
import os
import yaml
import base64
import shutil
import pwd
from pathlib import Path
# Update these variables with your actual username and paths
username = "your_username"
home_dir = Path(f"/home/{username}")
@theycallmeloki
theycallmeloki / Raspberry Pi 4 x 6 cluster 65B Llama runner gist
Last active October 14, 2024 15:56
an ansbile script that quickly bootstraps a Pi 4 cluster with tools required to run a 65B llama model
You will need the following two files, be sure to change the IP address in both sections, the `hostfile_contents`
as well as the ansible inventory section to reflect your configuration
Rest of the steps should run parallely across the different machines, for any updates to this script,
check this thread: https://github.com/ggerganov/llama.cpp/issues/2164#issuecomment-1639640846
If you want an automated way to do this in the future and would like an opionated setup procedure,
check this repo: https://github.com/theycallmeloki/edith-cli
did:3:kjzl6cwe1jw145y3y8k7fl0s67ozotq2my6x82oqvhtxz68flts4kz3e7guv344
@theycallmeloki
theycallmeloki / thread-pool-executor.py
Created December 10, 2022 09:38
A quick and dirty way to add parallelization to a task in python, in this example, to download images from a huge json list
import json
import os
import uuid
from pathlib import Path
import requests
import threading
import concurrent.futures
def download(link, filelocation):
@theycallmeloki
theycallmeloki / aggregator-pachyderm.json
Created June 3, 2022 12:09
A sample aggregator for pachyderm
{
"name": "LAMBO",
"metadata": "",
"oracleRequestBatchSize": 1,
"minOracleResults": 1,
"minJobResults": 1,
"minUpdateDelaySeconds": 900,
"jobs": [
{
"name": "duration LAMBO",