Skip to content

Instantly share code, notes, and snippets.

@mberman84
mberman84 / gist:d40d3e5c0e649d26dcd3dd0163e9d8d0
Created August 15, 2023 14:42
Generative Agents Installation
# must have conda installed
git clone https://github.com/joonspk-research/generative_agents.git
cd generative_agents
# open visual studio code, open gen agents folder
# within vscode, go to reverie/backend_server
# create new file utils.py
# copy/paste contents from github (below)
###
# Copy and paste your OpenAI API Key
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 / 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',
}
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
import autogen
config_list = [
{
'model': 'gpt-4',
'api_key': 'API_KEY'
}
]
llm_config={
@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
@mberman84
mberman84 / gist:f092a28e4151dd5cecebfc58ac1cbc0e
Last active May 6, 2024 19:34
Steps to install Textgen WebUI
# this tutorial assumes conda and git are both installed on your computer
conda create -n tg python=3.10.9
conda activate tg
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
git clone https://github.com/oobabooga/text-generation-webui.git
cd text-generation-webui
pip install -r requirements.txt
# GPU only:
# 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
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
@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