Skip to content

Instantly share code, notes, and snippets.

name explain-diff-html
description Use when the user asks for a rich explanation of a code change, diff, branch, or PR. Produces HTML output.

Explain Diff

Please make me a rich, interactive explanation of the specified code change.

It should have these sections:

@awni
awni / mlx_lm_benchmarks.md
Last active April 13, 2026 03:25
MLX LM Benchmarks

Benchmarks for mlx-lm

The command for evaluating on MMLU Pro:

mlx_lm.evaluate --model model/repo --task mmlu_pro

The command for efficiency benchmarks:

@willswire
willswire / jazz.swift
Created June 29, 2025 00:34
jazz.swift
import ArgumentParser
import Foundation
import FoundationModels
@main
struct JazzCommand: AsyncParsableCommand {
static var configuration = CommandConfiguration(
commandName: "jazz",
abstract: "A CLI tool to interpret shell tasks as natural language instructions."
)

Foundation Models

At WWDC 25 Apple opened up the on-device large-language model that powers Apple Intelligence to every iOS, iPadOS, macOS and visionOS app via a new “Foundation Models” framework. The model is a compact ~3 billion-parameter LLM that has been quantized to just 2 bits per weight, so it runs fast, offline and entirely on the user’s device, keeping data private while still handling tasks such as summarization, extraction, short-form generation and structured reasoning. ([developer.apple.com][1], [machinelearning.apple.com][2]) Below is a developer-focused English-language overview—based mainly on Apple’s own announcements, docs and WWDC sessions—followed by ready-to-paste Swift code samples.

1. What Are Apple’s On-Device Foundation Models?

Apple ships two sibling LLMs: a device-scale model (~3 B params) embedded in Apple silicon and a server-scale mixture-of-experts model that runs inside Private Cloud Compute when more heft is required. ([machinelearning.apple.com][2]) The

{
"name": "NuPhy Air60 V2",
"vendorProductId": 435499605,
"macros": [
"{+KC_LSFT}{+KC_LGUI} {-KC_LSFT}{-KC_LGUI}",
"{KC_LGUI} ",
"{+KC_LSFT} ",
"",
"",
"",
@jcollingj
jcollingj / superwhisper_stats.ts
Created March 28, 2024 14:19
Get your stats out of Superwhisper
import { readdirSync, readFileSync } from "fs";
import { join } from "path";
function listContentsAndAnalyzeDurations(directoryPath: string) {
const filesAndFolders = readdirSync(directoryPath, { withFileTypes: true });
let totalRecordings = 0;
let durations_milliseconds: number[] = [];
let totalCharacters = 0;
let totalWords = 0;
@Artefact2
Artefact2 / README.md
Last active July 6, 2026 12:03
GGUF quantizations overview
@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active April 8, 2025 13:49
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
@darth-veitcher
darth-veitcher / gpt4all-mac.md
Created April 11, 2023 08:29
GPT4All on a Mac

High level instructions for getting GPT4All working on MacOS with LLaMACPP

See nomic-ai/gpt4all for canonical source.

Environment

  • This walkthrough assumes you have created a folder called ~/GPT4All. Adjust the following commands as necessary for your own environment.
  • It's highly advised that you have a sensible python virtual environment. A conda config is included below for simplicity. Install it with conda env create -f conda-macos-arm64.yaml and then use with conda activate gpt4all.
@geoffreylitt
geoffreylitt / langchain-experiment.ipynb
Created January 29, 2023 21:27
Langchain experiment
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.