Skip to content

Instantly share code, notes, and snippets.

View sholtomaud's full-sized avatar
💭
Research

Sholto Maud sholtomaud

💭
Research
  • Sydney
View GitHub Profile
@sholtomaud
sholtomaud / README.md
Created April 7, 2025 11:55 — forked from dreamorosi/README.md
A super-basic MCP Server hosted on AWS Lambda

To deploy, create a Lambda function and enable function URL (no auth - yolo), then use the handler above in your function. That same implementation will also work with API Gateway HTTP (aka v2), if you want to use ALB or API Gateway REST (aka v1) you should swap the schema used for parsing.

Then you can test using a POST request with this body:

{
  "jsonrpc": "2.0",
  "method": "tools/list",
  "id": 2
}
@sholtomaud
sholtomaud / Mor.md
Created December 21, 2024 11:10 — forked from ruvnet/Mor.md
Mixture of Reflection (MoR) Model

Mixture of Reflection (MoR) Model: Detailed Implementation ## Forward: The Next Generation of AI Models

Reflection-based AI models are poised to redefine how AI is utilized, shifting from generating rapid, surface-level responses to producing thoughtful, in-depth analyses. These models emphasize self-evaluation and iterative improvement, leveraging internal feedback loops to refine outputs and enhance performance over multiple cycles.

This year has seen a marked shift toward reflection models, which differ from earlier Mixture of Experts (MoE) architectures. While MoE models efficiently handle specific tasks using specialized subnetworks, reflection-based models integrate iterative reasoning, enabling them to "think" before delivering results. This approach allows for evaluating and correcting reasoning pathways, ultimately improving performance through self-critique.

The proposed Mixture of Reflection (MoR) architecture builds on this foundation by combining the strengths of MoE with reflection-based re

@sholtomaud
sholtomaud / Consciousness.txt
Created December 21, 2024 11:10 — forked from ruvnet/Consciousness.txt
The system maps world observations into internal models and reasons iteratively, seeking coherence f(I) between its structure and goals. It evaluates the universe U(t) to refine its role within it, creating a recursive cycle of self-improvement. This enables it to implement awareness and act purposefully.
# Step 1: Represent Universe State
Initialize Ψ(t) in Hilbert space H
# Step 2: Define Field Configurations
Define configuration space M with measure μ
For each (g, φ) in M:
Represent fields as algebraic structures (groups, rings, etc.)
# Step 3: Complexity Operator
Define operator T acting on Ψ(t) to extract complexity
@sholtomaud
sholtomaud / llm-browser.py
Created July 10, 2024 01:11 — forked from jart/llm-browser.py
Using an LLM as an HTTP proxy with LLaMAfile
#!/usr/bin/env python
import socket
import threading
import subprocess
def handle_client(client_socket):
request = client_socket.recv(8192).decode('utf-8', errors='ignore')
first_line = request.split('\n')[0]
#!/usr/bin/env python
import boto3
import argparse
from operator import itemgetter
from collections import defaultdict
def nested_defaultdict():
return defaultdict(nested_defaultdict)
@sholtomaud
sholtomaud / gist:385a04b9b6eabc5e7374e514eb6a05eb
Created June 5, 2024 14:34 — forked from danilop/gist:6d49e2b6507f748a00a9
Amazon EC2 - user data to automatically mount an Amazon EFS file system at boot (Linux)
#cloud-config
package_upgrade: true
packages:
- nfs-utils
- httpd
- php
runcmd:
- echo "$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).FILE_SYSTEM_ID.efs.us-west-2.amazonaws.com:/ /var/www/html/efs nfs4 defaults" >> /etc/fstab
- mkdir /var/www/html/efs
- mount -a
#!/bin/bash
usage() {
echo "Usage: $0 [-v <Ruth|Matthew|Amy>]" 1>&2
echo "Ruth : Female English (US) - Default" 1>&2
echo "Matthew : Male English (US)" 1>&2
echo "Amy : Female English (British)" 1>&2
exit
}
@sholtomaud
sholtomaud / code-stack.ts
Created August 3, 2022 15:54 — forked from sebsto/code-stack.ts
CDK Create EC2 instace in private subnet. Install Nginx.
import ec2 = require('@aws-cdk/aws-ec2');
import cdk = require('@aws-cdk/core');
import { Fn, Tag, Resource } from '@aws-cdk/core';
import { AmazonLinuxImage, UserData, InstanceType } from '@aws-cdk/aws-ec2';
import { Role, ServicePrincipal, ManagedPolicy, CfnInstanceProfile } from '@aws-cdk/aws-iam'
/**
* Create my own Ec2 resource and Ec2 props as these are not yet defined in CDK
* These classes abstract low level details from CloudFormation
@sholtomaud
sholtomaud / animated_svg.html
Created September 29, 2019 04:56 — forked from tylerneylon/animated_svg.html
Example of an animated geometric figure
<!DOCTYPE HTML>
<html>
<body>
<svg width="600" height="600" vertion="1.1"
id="svg" xmlns="http://www.w3.org/2000/svg">
<defs>
<clipPath id="angleClip">
<polygon id="atriangle" />
</clipPath>
@sholtomaud
sholtomaud / animated_svg.html
Created September 29, 2019 04:56 — forked from tylerneylon/animated_svg.html
Example of an animated geometric figure
<!DOCTYPE HTML>
<html>
<body>
<svg width="600" height="600" vertion="1.1"
id="svg" xmlns="http://www.w3.org/2000/svg">
<defs>
<clipPath id="angleClip">
<polygon id="atriangle" />
</clipPath>