Skip to content

Instantly share code, notes, and snippets.

View ondrejsojka's full-sized avatar

Ondřej Sojka ondrejsojka

  • Brno, Czech Republic
View GitHub Profile
@ondrejsojka
ondrejsojka / simple-base-model-gui.html
Created May 2, 2025 12:13
Simple GUI for llama-server to interact with a base model
<!-- llama-server -m gemma-3-12b-pt-q4_0.gguf --chat-template "" -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>llama.cpp simple tui</title>
<style>
body {
font-family: monospace;
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "aiofiles",
# "aiohttp",
# "tiktoken",
# "openai>=1.75.0", # for openai.AsyncOpenAI
# "pathspec",
# ]
# ///
@ondrejsojka
ondrejsojka / concatdir.py
Created April 1, 2025 14:17
Script to concatenate all files in a directory into one .md file. Supports an inclusion filter based off gpt-4o-mini
import os
import sys
import argparse
import re
import pathspec
import subprocess
from typing import Optional
from openai import OpenAI
@ondrejsojka
ondrejsojka / semaphore-v4-ceremony_attestation.log
Created June 14, 2024 13:55
Attestation for Semaphore V4 Ceremony MPC Phase 2 Trusted Setup ceremony
Hey, I'm tensojka-8470346 and I have contributed to the Semaphore V4 Ceremony.
The following are my contribution signatures:
Circuit # 1 (semaphorev4-1)
Contributor # 117
Contribution Hash: 0f0f7761 d1aef881 83978921 0599fce0
be19492b 6ab9f847 ce4cf28b 270e55ba
acf538b7 2d404187 6808623e 1833031e
5e8b078f 048562b5 50242a14 8e74894e
@ondrejsojka
ondrejsojka / codemerger.py
Created March 13, 2024 13:29
This script merges files in a specific directory into one file, prefixing each with its name and separating the files with ---. The purpose is to be able to then feed a nearly whole codebase to a LLM easily.
import os
import sys
import argparse
import re
import pathspec
import subprocess
def load_gitignore(root_dir):
gitignore = os.path.join(root_dir, '.gitignore')
try:
@ondrejsojka
ondrejsojka / pack-git-for-llm.py
Created July 15, 2023 21:49
This script concats all of a git repository into one .txt file, perfect for supplying as context to Claude or for integration with other LLMs.
import os
import sys
import pathspec
def load_gitignore(root_dir):
gitignore = os.path.join(root_dir, '.gitignore')
if os.path.exists(gitignore):
with open(gitignore, 'r') as file:
spec = pathspec.PathSpec.from_lines('gitwildmatch', file)
else: