Skip to content

Local Development Setup

Open Chat Studio uses UV and Invoke for dev automation.

Prerequisites

  • Python 3.13 (recommended)
  • Node.js >= 24.0.0
  • Docker and Docker Compose
  • Git

Installation Steps

  1. Clone the repository

    git clone https://github.com/dimagi/open-chat-studio.git
    cd open-chat-studio
    
  2. Install dependencies

    uv venv --python 3.13
    source .venv/bin/activate
    uv sync
    
  3. Run the automated setup

    inv setup-dev-env
    

    This will: - Install pre-commit hooks - Start database and Redis services - Run database migrations - Build frontend resources - Create a superuser

    Manual steps

    Install the pre-commit hooks

    prek install --install-hooks
    

    Set up database

    Start the database and redis services and run the DB migrations:

    inv up  # start the docker services
    cp .env.example .env
    ./manage.py migrate
    

    Build the front-end resources

    To build JavaScript and CSS files, first install npm packages:

    inv npm --install
    # or
    npm install
    npm run dev
    

    Note

    You should be using node >= 24.0.0. If you have nvm installed, you can run nvm use to switch to the correct version.

    To check which version you are using use node --version.

    Create a superuser

    ./manage.py createsuperuser
    
  4. Start the development server

    ./manage.py runserver
    
  5. Run Celery for background tasks

    Celery is required to handle LLM interactions. Run it using:

    inv celery
    

    For a production-like setup, use:

    inv celery --gevent
    

Next: Common Development Tasks