Skip to content

Installing and Setting Up MADA

This guide will help you install and set up MADA for basic use or for development.

For basic installation and setup, follow the instructions at the following sections:

  1. Basic Installation
  2. Environment Variable Setup

Developers, see above and also Installing Optional Dependencies

Basic Installation

  1. First, create a virtual environment:

    python -m venv mada_venv
    
  2. Activate the virtual environment:

    source mada_venv/bin/activate
    
    source mada_venv/bin/activate.csh
    
  3. Finally, install MADA with pip:

    pip install mada
    

Developer Setup

  1. First, clone the repository:

    git clone https://github.com/llnl/mada.git
    

  2. Next, move into the cloned repository:

    cd mada/
    
  3. Now, create a virtual environment:

    python -m venv mada_venv
    
  4. Activate the virtual environment:

    source mada_venv/bin/activate
    
    source mada_venv/bin/activate.csh
    
  5. Finally, install an editable version of MADA with pip and all development dependencies:

    pip install -e .[dev]
    

Environment Variable Setup

MADA requires certain environment variables to be set for API authentication and configuration. These will be used by your Model Configuration.

Variable Required Default Value Purpose
API_KEY Yes None API key for authentication
API_BASE_URL No https://api.openai.com/v1/responses API endpoint

You can set these variables from the command line with:

export API_KEY=<your_api_key_here>
export API_BASE_URL=<custom_api_url>  # Optional

For developers, you can set these variables using a .env file in the project root. Put the following in your file:

API_KEY=<your_api_key_here>
API_BASE_URL=<custom_api_url>  # Optional

Installing Optional Dependencies

There are two sets of optional dependencies that can be installed: one set for tests and the other for documentation.

These can be installed together:

pip install -e .[dev]
pip install -e .[tests,docs]

Or separately:

pip install -e .[tests]
pip install -e .[docs]