💡
Check out Open in Colab for a quick tutorial

Train, deploy, and evaluate Social AI agents with Sotopia

Features

Installation

This package supports Python 3.10 and above. There are two ways to setup the package: automatic installation with an interactive installer and manual installation from source.

Interactive Installer

pip install sotopia
sotopia install
export REDIS_OM_URL="redis://localhost:6379"

Or if you want to install from source

Clone the repo and install the package

git clone git@github.com:sotopia-lab/sotopia.git;
pip install -e .

Set up Redis stack

Redis stack is a required dependency for using Sotopia. There are two ways to set up Redis stack:

sotopia install

or manual setup:

Quick Start

You can view an episode demo with default parameters with the following:

import asyncio
from sotopia.samplers import UniformSampler
from sotopia.server import run_async_server
 
asyncio.run(
    run_async_server(
        model_dict={
            "env": "gpt-4",
            "agent1": "gpt-4o-mini",
            "agent2": "gpt-4o-mini",
        },
        sampler=UniformSampler(),
    )
)

or if you have cloned the repo, run

python examples/minimalist_demo.py