Skip to main content
Integrating Future AGI evaluations into your CI/CD pipeline allows you to automatically assess model performance on every pull request, ensuring consistent quality checks before code deployment.
We are deprecating the following templates: content_moderation, factual_accuracy, content_safety_violation, is_factually_consistent, and is_compliant.For new CI/CD pipelines, please use:
  • toxicity instead of content_moderation and content_safety_violation
  • groundedness instead of factual_accuracy and is_factually_consistent
  • data_privacy_compliance instead of is_compliant

Core SDK Functions

The Future AGI evaluation pipeline uses two main SDK functions. Let’s understand these step by step:

1. Initialize the Evaluator

First, create an evaluator instance with your API credentials:

2. Define Your Evaluation Data

Structure your evaluation data with the templates and inputs you want to test, for more details on how to set up evaluations refer to the evals documentation.

3. Submit Evaluation Pipeline

Submit your evaluation data for processing:
Parameters:
  • project_name: Your project identifier
  • version: Version tag for this evaluation run
  • eval_data: List of evaluation configurations

4. Retrieve Results

Get evaluation results for comparison across versions:
Parameters:
  • project_name: Your project identifier
  • versions: List of version tags to retrieve results for

Full GitHub CI/CD Implementation Example

Now let’s implement these SDK functions in a complete GitHub Actions workflow:

Prerequisites

Before setting up CI/CD evaluation, ensure you have:
  • A Future AGI account with API and secret keys
  • A GitHub repository with Actions enabled

Required GitHub Secrets

Configure the following secrets in your GitHub repository settings:

Required GitHub Variables

Set up these repository variables for configuration:

GitHub Actions Workflow File

Create .github/workflows/evaluation.yml:

Evaluation Script File

Create evaluate_pipeline.py:

Requirements File

Create requirements.txt:

Important: GitHub Permissions

Critical: You must specify the pull-requests: write permission in your GitHub Actions workflow. Without this permission, you’ll encounter GitHub API errors when the action tries to leave comments on your PR.
The workflow includes:

Workflow Behavior

On Pull Request Creation/Update

  1. Trigger: Workflow runs automatically on PR to main branch
  2. Initialize: Uses Evaluator() to set up API connection
  3. Submit: Uses evaluate_pipeline() to submit evaluation data
  4. Monitor: Polls using get_pipeline_results() for completion
  5. Report: Posts formatted comparison results as PR comment

Expected Output

The workflow will post a comment on your PR with:
  • Current version identifier
  • Metrics comparison table across versions
Evaluation CI/CD Pipeline

Troubleshooting

Common Issues

GitHub API Errors
  • Ensure pull-requests: write permission is set
  • Verify PAT_GITHUB token has appropriate repository access
Evaluation Failures
  • Check Future AGI API credentials are correctly configured
  • Verify project name and version variables are set
  • Verify evaluation data format matches your templates
Timeout Issues
  • Increase max_wait_time for complex evaluations
  • Verify network connectivity in GitHub Actions environment
This CI/CD integration ensures consistent quality checks and provides valuable insights into model performance changes with every code update.