Running Ax generated code from Command Line

This guide provides step-by-step instructions for executing your downloaded Swarm codebase.


Prerequisites

  • • Python installed on your system
  • • Downloaded Swarm codebase
  • • OpenAI API key
  • • Required environment variables (if any)

Steps

Extract the Codebase

  1. 1. Locate your downloaded Swarm zip file
  2. 2. Unzip the file to your desired location
  3. 3. Navigate to the extracted directory

Configure OpenAI API Key (Required)

  • • Open run.py file in a text editor
  • • Locate the environment variable section
  • • Set your OpenAI API key:
OPENAI_API_KEY = "your-api-key-here"
⚠️

Never commit your API key to version control or share it publicly

Set Additional Environment Variables (Optional)

If your Swarm's Routines require specific environment variables

Export them in your terminal:

export VARIABLE_NAME=value

Execute the Swarm

Open terminal in the extracted directory

Run the following command:

python run.py

Troubleshooting

  • • Ensure all environment variables are correctly set
  • • Verify Python is in your system PATH
  • • Check console output for any error messages

Important Notes

ℹ️

Key Points to Remember:

  • • Keep your API keys secure and never share them
  • • Some Routines may require additional setup based on their specific requirements
  • • Refer to individual Routine documentation for specific configuration needs