Skip to content

Instantly share code, notes, and snippets.

View bquast's full-sized avatar
🌴
On vacation, but I love this stuff, so still working 😄

Bastiaan Quast bquast

🌴
On vacation, but I love this stuff, so still working 😄
View GitHub Profile
@bquast
bquast / qwen3-1-7b-sft-simplified-technical-english.ipynb
Created August 10, 2026 18:45
qwen3-1.7b-SFT-Simplified-Technical-English.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bquast
bquast / qwen3-1-7b.ipynb
Created August 10, 2026 17:45
qwen3-1.7b.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bquast
bquast / sft-smollm2.ipynb
Created August 10, 2026 00:54
SFT-SmolLM2.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import time
import numpy as np
from lerobot.common.robot_devices.robots.so101 import SO101Follower
from lerobot.common.robot_devices.cameras import get_cameras
# initialize robot and cameras
robot = SO101Follower(port="/dev/ttyACM0", id="my_so101") # Adjust port
robot.connect()
@bquast
bquast / SmolLM-135M-quantize-int8-mlx.py
Created May 18, 2026 09:38
MLX script to quantize SmolLM-135M from bf16 to int8
import mlx.core as mx
from mlx.utils import tree_flatten
from mlx_lm import load
model, _ = load("HuggingFaceTB/SmolLM2-135M")
def absmax_int8(w):
scale = mx.max(mx.abs(w)) / 127.0
w_q = mx.round(w / scale).astype(mx.int8)
w_hat = w_q.astype(w.dtype) * scale
@bquast
bquast / big-files-list.sh
Last active May 12, 2026 18:51
Saving disk space: below script lists the large files and folders, to be copy-pasted into an LLM, for space-saving suggestions
#!/bin/zsh
# cleanup.sh
# Usage: ./cleanup.sh [directory]
# Default to HOME if no directory is provided
TARGET="${1:-$HOME}"
echo "### macOS SSD Analysis for: $TARGET"
echo "### Date: $(date)"
echo "---"
@bquast
bquast / llama.go
Last active May 10, 2026 20:09
llama inference engine, written in Go, builds to wasm, downloads SmolLM2-135M and runs inference in the browser
package main
import (
"encoding/binary"
"fmt"
"math"
"math/rand"
"regexp"
"strings"
"syscall/js"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RSA — Multiplicative Homomorphism</title>
<link href="https://fonts.googleapis.com/css2?family=Archivo+Black&family=Work+Sans:wght@400;600&family=Space+Mono&display=swap" rel="stylesheet">
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
@bquast
bquast / claude-export-markdown.js
Created April 12, 2026 10:33
Export Claude conversation to markdown
(() => {
const title = document.title.replace(' - Claude', '').trim();
const lines = [`# ${title}\n`];
// Grab every turn in the conversation
const turns = document.querySelectorAll('[data-testid="user-message"], .font-claude-response-body, .standard-markdown');
// Better approach: walk the full message list
// User messages
const userMsgs = [...document.querySelectorAll('[data-testid="user-message"]')];
@bquast
bquast / calmplot.js
Last active April 11, 2026 12:28
calm animation for blog charts live, example in the comments
(function () {
function parseDuration(value) {
var text = String(value || "").trim();
if (text.endsWith("ms")) {
return parseFloat(text.slice(0, -2));
}
if (text.endsWith("s")) {
return parseFloat(text.slice(0, -1)) * 1000;