Skip to content

Instantly share code, notes, and snippets.

View kwindla's full-sized avatar

Kwindla Hultman Kramer kwindla

View GitHub Profile
@kwindla
kwindla / gemini-lights-repro.py
Created December 15, 2024 03:32
Gemini Multimodal Live compositional function calling test
# usage: gemini-lights-repro.py --initial-message "Make a pretty sequence with the lights. Turn them on and off a few times. Pick nice colors."
import argparse
import asyncio
import base64
import json
import os
import pyaudio
import re
import shutil
@kwindla
kwindla / gemini-talk.py
Created December 11, 2024 16:45
Gemini Multimodal Live API minimal client (use headphones)
# installation:
#
# python3.12 -m venv venv
# source venv/bin/activate
#
# pip install pyaudio websockets
# usage:
#
# export GEMINI_API_KEY=...
@kwindla
kwindla / talk.py
Created October 7, 2024 01:59
command-line openai realtime
import asyncio
import base64
import json
import os
import pyaudio
import shutil
import websockets
class AudioStreamer:
@kwindla
kwindla / runner.py
Created August 4, 2024 17:16
RTVI bot helper runner - 2024-08-04
#
# Copyright (c) 2024, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#
import aiohttp
import argparse
import os
@kwindla
kwindla / rtvi-bot-20240804.py
Created August 4, 2024 17:14
RTVI simple bot example, 2024-08-04
import aiohttp
import asyncio
import os
import sys
from pipecat.frames.frames import EndFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.pipeline.runner import PipelineRunner
from pipecat.processors.frameworks.rtvi import (
@kwindla
kwindla / khk-sonnet-3.5-ice-cream.py
Created June 21, 2024 00:59
Anthropic Claude Sonnet 3.5 inventing new ice cream flavors (Pipecat voice bot)
import asyncio
import aiohttp
import os
import sys
from pipecat.frames.frames import LLMMessagesFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.llm_response import (
@kwindla
kwindla / khk-llama-3-70B.yml
Last active May 28, 2024 04:30
Llama-3-70B config (works on one GPU no deepspeed; OOMs on multiple GPUs during merge)
base_model: meta-llama/Meta-Llama-3-70B
# deepspeed: /workspace/axolotl/deepspeed_configs/zero3_bf16.json
load_in_8bit: false
load_in_4bit: true
strict: false
datasets:
# This will be the path used for the data when it is saved to the Volume in the cloud.
- path: data.jsonl
@kwindla
kwindla / khk-llama-3-70B.yml
Created May 27, 2024 22:54
Llama-3-70B config (OOM) - 2
base_model: meta-llama/Meta-Llama-3-70B
deepspeed: /workspace/axolotl/deepspeed_configs/zero3_bf16.json
load_in_8bit: true
load_in_4bit: false
strict: false
datasets:
# This will be the path used for the data when it is saved to the Volume in the cloud.
- path: data.jsonl
@kwindla
kwindla / khk-llama-3-70B.yml
Created May 27, 2024 21:56
Llama-3-70B config (OOM)
base_model: meta-llama/Meta-Llama-3-70B
deepspeed: /workspace/axolotl/deepspeed_configs/zero3_bf16.json
load_in_8bit: false
load_in_4bit: true
strict: false
datasets:
# This will be the path used for the data when it is saved to the Volume in the cloud.
- path: data.jsonl
@kwindla
kwindla / benchmark-llama3-ttfb.py
Created April 19, 2024 19:41
Groq Llama-3 Time To First Byte
import os
import json
import time
import statistics
from groq import Groq
# Set the Groq API key and the number of inferences to run
GROQ_API_KEY = os.environ.get("GROQ_API_KEY")
NUM_INFERENCES = 10