Skip to content

Instantly share code, notes, and snippets.

View mzbac's full-sized avatar
🦀
I may be slow to respond.

Anchen mzbac

🦀
I may be slow to respond.
  • Australia
  • 01:03 (UTC +11:00)
View GitHub Profile
@karpathy
karpathy / microgpt.py
Last active February 13, 2026 14:03
microgpt
"""
The most atomic way to train and inference a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@awni
awni / open_code_mlx.md
Last active February 8, 2026 19:49
OpenCode with MLX

The following guide will show you how to connect a local model served with MLX to OpenCode for local coding.

1. Install OpenCode

curl -fsSL https://opencode.ai/install | bash

2. Install mlx-lm

@Anemll
Anemll / test.swift
Last active June 10, 2025 00:42
Test Apple Foundation Model t/s
import FoundationModels
import Playgrounds
import Foundation
let session = LanguageModelSession()
let start = Date()
let response = try await session.respond(to: "What is Apple Neural Engine and how to use it?")
let responseText = response.content // Replace 'value' with the actual property name from LanguageModelSession.Response<String> that holds the string payload.
print(responseText)
let end = Date()
@awni
awni / mlx_lm_open_webui.md
Created April 25, 2025 15:41
Open WebUI with MLX LM

Setup

Install packages:

pip install open-webui mlx-lm

Start Open WebUI server:

@wey-gu
wey-gu / animated_connectors.md
Last active February 12, 2026 11:25
How to create diagrams like Alex Xu/bytebytego's great work

Tool: draw.io

Animate the connectors

Animating your connectors is great for demonstrating directional flow charts, electrical circuits and more. To animate your connectors:

  1. Click on the connector you wish to animate. Hold Ctrl or Cmd and click to select multiple connectors
  2. On the right-hand side go to Style > Property and click on the arrow to expand the field
  3. Scroll down to Flow Animation and check the box
@awni
awni / README.md
Last active April 30, 2025 12:30
Test Time Scaling with R1-based Models and MLX LM

Test Time Scaling with MLX LM and R1-based LLMs

Install MLX LM:

pip install mlx-lm

And run:

@willccbb
willccbb / grpo_demo.py
Last active February 12, 2026 09:39
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
"""
citation:
@misc{brown2025grpodemo,
title={Granular Format Rewards for Eliciting Mathematical Reasoning Capabilities in Small Language Models},
author={Brown, William},
@awni
awni / mlx_distributed_deepseek.md
Last active February 7, 2026 10:32
Run DeepSeek R1 or V3 with MLX Distributed

Setup

On every machine in the cluster install openmpi and mlx-lm:

conda install conda-forge::openmpi
pip install -U mlx-lm

Next download the pipeline parallel run script. Download it to the same path on every machine:

@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active February 4, 2026 01:17
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@ivanfioravanti
ivanfioravanti / mlx_whisper_realtime.py
Last active July 29, 2025 20:13
mlx-whisper real time audio
# Required packages:
# pip install SpeechRecognition mlx-whisper pyaudio
# Note: This script requires Apple Silicon Mac for MLX Whisper
import speech_recognition as sr
import numpy as np
import mlx_whisper
r = sr.Recognizer()
mic = sr.Microphone(sample_rate=16000)