Skip to content

Instantly share code, notes, and snippets.

View boxabirds's full-sized avatar

Julian Harris boxabirds

View GitHub Profile
@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:

@boxabirds
boxabirds / gist:019fd81234e4c85791e92259797cfa14
Created February 16, 2024 12:30
Testing ifioravanti/lwm
Runnig on ollama 0.1.25 / web-ui v1.0.0-alpha.100 / ubuntu 22.04
Feb 16 12:27:52 gruntus ollama[57441]: {"timestamp":1708086472,"level":"ERROR","function":"load_model","line":378,"message":"unable to load model","model":"/usr/share/ollama/.ollama/models/blobs/sha256:883e646838a09df3315b167aac81293affbf48dbccf927eb144191dc9c959942"}
Feb 16 12:27:52 gruntus ollama[57441]: time=2024-02-16T12:27:52.809Z level=WARN source=llm.go:162 msg="Failed to load dynamic library /tmp/ollama2601240208/cpu_avx2/libext_server.so error loading model /usr/share/ollama/.ollama/models/blobs/sha256:883e646838a09df3315b167aac81293affbf48dbccf927eb144191dc9c959"
Feb 16 12:27:52 gruntus ollama[57441]: [GIN] 2024/02/16 - 12:27:52 | 500 | 203.311184ms | 127.0.0.1 | POST "/api/chat"
Feb 16 12:27:53 gruntus ollama[57441]: time=2024-02-16T12:27:53.013Z level=INFO source=cpu_common.go:11 msg="CPU has AVX2"
Feb 16 12:27:53 gruntus ollama[57441]: time=2024-02-16T12:27:53.013Z level=INFO source=gpu.go:146 msg="CUDA Compute Capabi