Skip to content

Instantly share code, notes, and snippets.

View ShayneP's full-sized avatar

Shayne Parlo ShayneP

View GitHub Profile
{
"keys": [
{
"kty": "RSA",
"n": "w0W06shNeWOW7NhJqUfJyMDAeHrtr6G-OSP06P21isv3pVP7n8WdLlNKhQn8ZUL81ANzd-GYxvuMXXeKHz2t1lT7IE05Y7mkUmEH8c1I_lLyhBp9QegjEyTqsjT3qSh2hrUoGLkPCyvFv9ObB1XgUf0ZnD-JLhel0Kn7X6l3oYkh13njRbIlhKjyl9J7vXUXNsNjfhCmNF2N1peFLv8nj67dkjt6pLoGgHH06VFiAKFg3Xp6NdC4v3ZppNxXNBJQA9GmZvIzWDWYW4gJj_pkRAjHF3S51Ya-Sc71t-QliB2N5Zy7G9rrMe7V71v_94_98VrXT7YIowqNqHz2Px6I4Q",
"e": "AQAB",
"kid": "livekit-agent-1"
}
]
}
@ShayneP
ShayneP / universal_pi_zero_translator.py
Created April 3, 2025 20:47
Universal Translator running on Pi Zero 2
# Real-time translator that uses Gladia to transcribe and translate any language to English
# It displays the translated text on a Pirate Audio display on a Raspberry Pi Zero 2 W
from pathlib import Path
from dotenv import load_dotenv
from livekit.agents import JobContext, WorkerOptions, cli
from livekit.agents.voice import Agent, AgentSession
from livekit.plugins import gladia
from PIL import Image
@ShayneP
ShayneP / basic_agent.py
Created January 28, 2025 20:41
LiveKit, DeepSeek, and Groq
import asyncio
import logging
import os
import aiohttp
from typing import Annotated
from dotenv import load_dotenv
from livekit import rtc
from livekit.agents import (
AutoSubscribe,
JobContext,
@ShayneP
ShayneP / basic_agent.py
Created January 15, 2025 20:08
Basic LiveKit Agent
from dotenv import load_dotenv
from livekit.agents import (
AutoSubscribe,
JobContext,
JobProcess,
WorkerOptions,
cli,
llm,
)
from livekit.agents.pipeline import VoicePipelineAgent
@ShayneP
ShayneP / main.py
Created October 16, 2024 18:05
Connecting to a LiveKit room with audio from the terminal
import asyncio
import logging
import os
from dotenv import load_dotenv
from livekit import rtc, api
import sounddevice as sd
import numpy as np
import signal
import queue
@ShayneP
ShayneP / store_response.py
Created October 7, 2024 14:07
Store response from OpenAI API for eval & training
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "what's the capital of the USA?"
}
@ShayneP
ShayneP / create_fine_tuned_model.py
Created October 7, 2024 14:06
Create fine tuned model
from openai import OpenAI
client = OpenAI()
client.fine_tuning.jobs.create(
training_file="mydata",
model="gpt-4o-mini-2024-07-18"
)
@ShayneP
ShayneP / upload_training.py
Last active October 7, 2024 18:52
Upload training JSON file
from openai import OpenAI
client = OpenAI()
client.files.create(
file=open("mydata.jsonl", "rb"),
purpose="fine-tune"
)
client.fine_tuning.jobs.create(
training_file="mydata",
@ShayneP
ShayneP / vision_fine_tune.json
Created October 7, 2024 14:03
Sample of vision fine tune for OpenAI
{
"messages": [
{ "role": "system", "content": "You are an assistant that identifies uncommon cheeses." },
{ "role": "user", "content": "What is this cheese?" },
{ "role": "user", "content": [
{
"type": "image_url",
"image_url": {
"url": "<https://upload.wikimedia.org/wikipedia/commons/3/36/Danbo_Cheese.jpg>"
}
@ShayneP
ShayneP / realtime_agent.py
Last active October 8, 2024 02:39
A simple implementation of a Realtime Agent using LiveKit.
from __future__ import annotations
import logging
from livekit import rtc
from livekit.agents import (
AutoSubscribe,
JobContext,
WorkerOptions,
cli,
llm,
)