Skip to content

Instantly share code, notes, and snippets.

@sammyjoyce
sammyjoyce / interpretability.md
Last active June 8, 2025 23:42
Explaining Mechanistic Interpretability to a Web Developer

Explaining Mechanistic Interpretability to a Web Developer

The Problem

Imagine you inherited a massive web application with no documentation, no comments, and minified code. When it makes decisions (like rejecting a user login or flagging a transaction), you have no idea why. Now imagine this is handling millions of dollars in financial decisions. That's the current state of AI models.

What We're Building

Think of it as Chrome DevTools for AI models. Just like DevTools lets you inspect network requests, see which functions are called, and debug JavaScript execution, we're building tools to inspect what happens inside AI models when they make decisions.

The Web Development Analogy

Overview and Project Purpose

asinit is a Zig-based code scaffolding and update CLI designed to generate and maintain modular project codebases. It composes multiple feature “modules” (each with templates and code modifications) into a cohesive project and later applies updates to those modules even if the user has modified the code oai_citation:0‡github.com. The CLI emphasizes deterministic, offline code generation: given the same module set, it will always produce the same project structure, and it tracks generated content so it can intelligently merge upstream changes into user-edited code oai_citation:1‡github.com oai_citation:2‡github.com. In essence, asinit acts as a **modu

@sammyjoyce
sammyjoyce / react_tool_use_plugin.lua
Last active April 11, 2025 02:31
An example of a Horsehead plugin that sets up a ReAct workflow with tool use
--------------------------------------------------------------------------------
-- init.lua for "react_tool_use_multi_model_example" Plugin
--------------------------------------------------------------------------------
-- This plugin demonstrates:
-- 1) Multiple role-specific agents using different models:
-- • Architect uses a cloud-based model (cloud_llm)
-- • Reviewer uses a thinking model (thinking_llm)
-- • Coder uses a local model (local_llm_http)
-- 2) A ReAct-style workflow where agents can natively call tools.
-- 3) A search tool that uses ripgrep ("rg") on the local machine.
@sammyjoyce
sammyjoyce / tailwind_manager.go
Created October 7, 2024 23:04
Tailwind dev manager with goroutines (Go)
package bundler
import (
"context"
"fmt"
"io"
"log"
"net/http"
"os"
"os/exec"
@sammyjoyce
sammyjoyce / repository.ts
Created April 18, 2024 13:16 — forked from cayter/LICENSE
Drizzle ORM Type-Safe Repository With PgTable
import { startSpan } from "@sentry/remix";
import type { StartSpanOptions } from "@sentry/types";
import {
type AnyColumn,
type AnyTable,
type BuildQueryResult,
type DBQueryConfig,
type DrizzleTypeError,
type Equal,
type ExtractTablesWithRelations,
import { ButtonHTMLAttributes, ReactNode } from 'react';
import * as stylex from '@stylexjs/stylex';
const baseStyles = stylex.create({
base: {
backgroundColor: "#3661DA",
border: "1px solid #3661DA",
color: "#fff",
fontWeight: 600,
fontFamily: "Inter, sans-serif",
@sammyjoyce
sammyjoyce / SST Example NextJs
Created December 1, 2023 02:43
SST v2 example: NextjsSite with custom domain and storage bindings
import { NextjsSite, StackContext, use } from "sst/constructs";
import { DNS } from "./dns";
import { Storage } from "./storage";
import { Auth } from "./auth";
import { API } from "./api";
export function Site({ stack, app }: StackContext) {
const dns = use(DNS);
const api = use(API);
const auth = use(Auth);
@sammyjoyce
sammyjoyce / SST DNS Example
Last active May 5, 2026 05:09
SST v2 example: Route53 hosted zone setup per stage
import {HostedZone} from "aws-cdk-lib/aws-route53";
import {StackContext} from "sst/constructs";
const PRODUCTION = "domain.com";
const DEV = "dev.domain.com";
export function DNS(ctx: StackContext) {
if (ctx.stack.stage === "production") {
const zone = new HostedZone(ctx.stack, "zone", {
zoneName: PRODUCTION,
@sammyjoyce
sammyjoyce / SST Email example
Created December 1, 2023 02:26
SST v2 example: SES email identity with SPF and DMARC records
import { StackContext, use } from "sst/constructs";
import { EmailIdentity, Identity } from "aws-cdk-lib/aws-ses";
import { TxtRecord } from "aws-cdk-lib/aws-route53";
import { DNS } from "./dns";
export function Email(ctx: StackContext) {
const { stage } = ctx.stack;
if (stage !== "production" && stage !== "dev") return;
const dns = use(DNS);
const email = new EmailIdentity(ctx.stack, "identity", {