Skip to main content

Galileo Luna-2 Integration Examples

This directory contains examples demonstrating Agent Control integration with Galileo’s Luna-2 Protect service for real-time toxicity detection and content moderation.

Luna-2 Demo (luna2_demo.py)

Demonstrates using the Luna-2 evaluator with a CENTRAL stage for toxicity detection.

Prerequisites

  1. Galileo API Key: Get yours from Galileo Console
  2. Galileo Project: Create a project and stage in the Galileo Console
  3. Agent Control: Install with Luna-2 support

Setup

What it Does

The demo tests various inputs against a pre-configured toxicity detection stage:
  • ✅ Safe greetings and questions pass through
  • 🚫 Toxic content gets blocked
  • 📊 Toxicity scores are displayed for each input
  • 🔗 Trace IDs link to detailed analysis in Galileo Console

Central vs Local Stages

  • Central Stage (used in this demo): Rulesets and policies are pre-configured on the Galileo server. Simply reference the stage by name.
  • Local Stage: Define rulesets at runtime in your code (see evaluator documentation).

Expected Output

Troubleshooting

  • “GALILEO_API_KEY environment variable is required”: Export your API key
  • “Project not found”: Set GALILEO_PROJECT_NAME to match your Galileo project
  • “Stage not found”: Set GALILEO_STAGE_NAME to match a stage in your project
  • Import errors: Ensure you installed with [galileo] extra: pip install agent-control-evaluators[galileo]

Documentation

Source Code

View the complete example with all scripts and setup instructions: Galileo Luna-2 Integration Example