Skip to content

Instantly share code, notes, and snippets.

View boxabirds's full-sized avatar

Julian Harris boxabirds

View GitHub Profile
@boxabirds
boxabirds / img2alt.py
Created August 6, 2024 12:15
Generate alt tags for images (using llava)
import os
import requests
from bs4 import BeautifulSoup
import argparse
import base64
import json
def download_image(url, save_path):
response = requests.get(url)
if response.status_code == 200:
@boxabirds
boxabirds / main.go
Created June 22, 2024 19:52
Whisper.cpp go demo
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
whisper "github.com/ggerganov/whisper.cpp/bindings/go"
)
@boxabirds
boxabirds / openai-fixed-seed-demo.go
Created May 28, 2024 11:15
Demo of how fixing the seed with OpenAI's API gives deterministic results.
// Demo of how you can fix the seed with OpenAI and you'll get deterministic output.
// this is only for a given system fingerprint
package main
import (
"context"
"flag"
"fmt"
"io"
"log"
@boxabirds
boxabirds / image-captioning-ollama-llava.go
Created May 26, 2024 22:08
Demo of using ollama + llava to create extremely detailed image captions from an image
// this is a demo that connects to ollama and
// Prerequisites:
// - ollama
// - open weights model "llava" 1.6 or greater
package main
import (
"bytes"
"encoding/base64"
"encoding/json"
@boxabirds
boxabirds / summarise-text-gemini.go
Created May 24, 2024 11:42
Summarise large documents in go using Google Gemini Flash
package main
import (
"context"
"flag"
"fmt"
"log"
"os"
"time"
@boxabirds
boxabirds / upscale-imgurl-claude.go
Created May 23, 2024 09:14
Sample of how you can use an LLM instead of a bunch of regexes.
package main
import (
"bufio"
"context"
"flag"
"fmt"
"log"
"os"
@boxabirds
boxabirds / summariser-ollama-openai.go
Last active May 22, 2024 11:36
Use Ollama to run an AI summariser on your machine for free
package main
import (
"context"
"flag"
"fmt"
"io"
"log"
"os"
"time"
@boxabirds
boxabirds / main.go
Created May 21, 2024 12:00
Demo of how to create a summariser using golang and Anthropic Claude.
package main
import (
"context"
"flag"
"fmt"
"io"
"log"
"os"
"time"

Objective: Create an interactive, two player, web-based game that is a hybrid of poker and chess rules. Use SVG graphics for any pieces or cards used and use popular animation and interaction libraries for visual appeal.

======================================== Task Breakdown ========================================

Task 1: Prompt: The objective has not been fully achieved yet. To break it down into the next sub-task:

Sub-task: Outline the core gameplay mechanics and rules for a two-player game that combines elements of poker and chess. Specify how turns progress, what actions players can take, the win conditions, and any unique twists that blend the two games together in an engaging way.

Prompt for subagent: Please create a detailed outline of the gameplay mechanics and rules for an original two-player game that merges elements from both poker and chess. Explain how the game is set up, what actions players can take on their turns, and how a player wins the game. Describe any unique features or twists t

Objective: Create a secure, anonymous, peer-to-peer, end-to-end encrypted web chat using svelte+typescript for the frontend and aws infrastructure for the backend using AWS CDK. An anonymous user can create a new chat url, and share it another anonymous user and they can chat directly and securely without needing a server or sign-up. The front-end UX looks like ChatGPT with a text input at bottom of screen and chat history scrolling up from bottom, with each user clearly distinguished. All code for each component provided including unit, functional and integration tests.

======================================== Task Breakdown ========================================

Task 1: Prompt: Here is the breakdown for the next sub-task:

Sub-task: Design the high-level architecture for the secure, anonymous peer-to-peer chat application.

Prompt for subagent: