Skip to content

Instantly share code, notes, and snippets.

import os
os.environ["OPENAI_API_KEY"] = "XXX"
os.environ["GROQ_API_KEY"] = "YYY"
from routellm.controller import Controller
client = Controller(
routers=["mf"],
strong_model="gpt-4-1106-preview",
git clone https://github.com/stitionai/devika.git
conda create -n devika python=3.10
conda activate devika
which python
/usr/local/anaconda3/envs/devika/bin/python -m pip install -r requirements.txt
playwright install --with-deps
npm install
bun run dev
open new terminal
conda activate devika
git clone https://github.com/OpenDevin/OpenDevin.git
cd OpenDevin
conda create -n od python=3.10
conda activate od
docker ps
(optional) install docker if not already installed
docker pull ghcr.io/opendevin/sandbox
export OPENAI_API_KEY={your key}
(optional I had to install rust) curl --proto '=https' --tlsv1.2 -sSf [https://sh.rustup.rs](https://sh.rustup.rs/) | sh
(optional) restart terminal
@mberman84
mberman84 / script.py
Created December 15, 2023 16:03
Mistral API Script
import requests
url = "https://api.mistral.ai/v1/chat/completions"
token = "API_KEY"
model = "mistral-medium"
prompt = """
John and Mark are in a room with a ball, a basket and a box. John puts the ball in the box, then leaves for work. While John is away, Mark puts the ball in the basket, and then leaves for school. They both come back together later in the day, and they do not know what happened in the room after each of them left the room. Where do they think the ball is?
"""
@mberman84
mberman84 / gist:ea207e7d9e5f8c5f6a3252883ef16df3
Created November 29, 2023 15:31
AutoGen + Ollama Instructions
1. # create new .py file with code found below
2. # install ollama
3. # install model you want “ollama run mistral”
4. conda create -n autogen python=3.11
5. conda activate autogen
6. which python
7. python -m pip install pyautogen
7. ollama run mistral
8. ollama run codellama
9. # open new terminal
@mberman84
mberman84 / gist:35ea386df3e2d0054ba370d388f43710
Created November 22, 2023 17:26
Voice Cloning for Narration
git clone https://github.com/cbh123/narrator
cd narrator
conda create -n narrator python=3.11
conda activate narrator
which python
python -m pip install -r requirements.txt
export ELEVENLABS_API_KEY={key}
export OPENAI_API_KEY={key}
python capture.py
# open new terminal
@mberman84
mberman84 / main.py
Created November 10, 2023 16:17
OpenChat Code
import requests
import json
import gradio as gr
url = "http://localhost:11434/api/generate"
headers = {
'Content-Type': 'application/json',
}
# Clone the repo
git clone https://github.com/imartinez/privateGPT
cd privateGPT
# Install Python 3.11
pyenv install 3.11
pyenv local 3.11
# Install dependencies
poetry install --with ui,local
@mberman84
mberman84 / gist:34d7716e78bdfe6cff07a63f6d05298d
Created October 27, 2023 14:10
MemGPT + Open-Source Models
# spin up a runpod GPU with TextGen WebUI, no need to use openai flag
# you can also use TextGen WebUI on your local computer
git clone https://github.com/cpacker/MemGPT.git
cd MemGPT
export OPENAI_API_BASE=https://some-stuff-5000.proxy.runpod.net # using runpod
# export OPENAI_API_BASE=localhost:5000 # using local computer
BACKEND_TYPE=webui
python3 main.py --no_verify
import os
import autogen
import memgpt.autogen.memgpt_agent as memgpt_autogen
import memgpt.autogen.interface as autogen_interface
import memgpt.agent as agent
import memgpt.system as system
import memgpt.utils as utils
import memgpt.presets as presets
import memgpt.constants as constants
import memgpt.personas.personas as personas