Skip to content

Instantly share code, notes, and snippets.

from http.server import BaseHTTPRequestHandler, HTTPServer
from http.client import HTTPConnection
import time
import json
import subprocess
import sys
import threading
UPSTREAM_HOST = "127.0.0.1"
UPSTREAM_PORT = 1976
@voxels
voxels / proxy.py
Created July 4, 2026 18:56
fm_proxy
from http.server import BaseHTTPRequestHandler, HTTPServer
from http.client import HTTPConnection
import time
import json
UPSTREAM_HOST = "127.0.0.1"
UPSTREAM_PORT = 1976
class Proxy(BaseHTTPRequestHandler):
def do_GET(self):
# Local AI Video Production Pipeline — Student Edition (May 2026)
---
## Overview
This guide describes a fully offline, modular AI filmmaking pipeline split across two machines:
| Machine | Role |
|---|---|
conda create -n qwen python=3.11 -y
conda activate qwen
pip install mlx-lm
python -m mlx_lm server --model unsloth/Qwen3.6-35B-A3B-UD-MLX-4bit --port 8000 --max-tokens 16384 --prompt-concurrency 2048 --decode-concurrency 1 --prompt-cache-bytes 45G --trust-remote-code
- conda activate qwen
- python -m mlx_lm server \
- --model unsloth/Qwen3.6-35B-A3B-UD-MLX-4bit \
- --port 8000 \
- --max-tokens 8192 \
- --prompt-concurrency 4 \
- --decode-concurrency 1 \
- --prompt-cache-bytes 32G \
- --trust-remote-code
@voxels
voxels / gist:db56aa8088defd5ddad081582a0f1371
Created May 22, 2026 14:26
Install OpenTrainer for NVidia 3080 Ti
Good — this is the right moment to reset. Your current env is in “dependency whack-a-mole mode,” so a clean stack will actually save time.
Below is a **known-stable Windows 11 + RTX 3080 Ti + OneTrainer SDXL LoRA setup** that avoids all the version traps you just hit (torch/torchvision/xformers/numpy/diffusers mismatches).
---
# 🧨 CLEAN INSTALL SCRIPT (Windows 11 / SDXL / OneTrainer)
## ⚠️ What this does
import Foundation
import Combine
import SwiftUI
/// An `ObservableObject` ViewModel that subscribes to a `CDJ3000Manager`
/// and publishes its state for a SwiftUI View.
///
/// This class is marked with `@MainActor`, which ensures that all UI-related
/// state updates are automatically published on the main thread.
@MainActor
import Foundation
/// A `Sendable` struct for defining a single MIDI Note message.
public struct MidiNoteMapping: Sendable, Equatable {
public var channel: UInt8
public var note: UInt8
}
/// A `Sendable` struct for defining a single MIDI Control Change (CC) message.
public struct MidiControlChangeMapping: Sendable, Equatable {
import Foundation
import CoreMIDI
// Note: This file assumes the `MIDIAdapter.h` and `MIDIAdapter.mm` files
// from your project are available and included in the build target.
// It also assumes Core MIDI definitions like MIDIMessage_32 are available.
// --- UPDATE: We are removing the MIDIAdapter dependency for this class ---
// Define a simple Deck ID for clarity
public enum DeckID: Sendable {
@voxels
voxels / CDJ3000_MIDI.swift
Last active November 14, 2025 14:01
CDJ 3000 midi manager actor
import Foundation
import CoreMIDI
import Combine
// MARK: - MIDI Command Mapping
/// A namespace for mapping CDJ-3000 MIDI commands from the official PDF.
/// We focus on MIDI 1.0 Channel Voice messages (Note On/Off, Control Change).
/// "n" (e.g., 9n, Bn) corresponds to the MIDI channel (0-15).
private enum CDJ3000Commands {