Web interface for running libEnsemble agent scripts with real-time output and script viewing.
Install the required dependencies:
pip install fastapi uvicorn[standard] gradio websocketsThis is in addition to any dependencies required for running the scripts.
The following assumes an API KEY is set in the environment. The interface will pick up available models.
Start the gradio web server (from web_ui dir):
python gradio_ui.pyClick on the URL shown in the terminal to open the web interface.
- Select Agent Script: Choose which agent script to run (e.g.,
libe_agent_basic.py) - Select Scripts Directory: Choose the test directory containing scripts to process (e.g., scripts_with_errors).
- Click Run: The agent will execute and output will appear in real-time
- View Generated Scripts: Generated scripts will appear in the dropdown and can be viewed
For interactive scripts, you can enter prompts when the agent needs user input.
app.py- FastAPI WebSocket server backendgradio_ui.py- Gradio web interface frontend- Agent entry point (
ensemble_agent.py) should be in the project root (parent ofweb_ui/) - Test script directories should be in
tests/
If you prefer to run the components separately (useful for debugging):
Terminal 1 - Start the WebSocket server (from web_ui dir):
uvicorn app:app --reload --port 8000Terminal 2 - Start the Gradio interface (from web_ui dir):
python gradio_ui.py