A GitHub Action for triggering and monitoring Arato AI builds
Create .github/workflows/arato-build.yml in your repository:
name: Arato Build
on:
workflow_dispatch:
inputs:
experiments:
description: 'Experiments to build (for example my-notebook-id')
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Arato Build
uses: AratoAi/arato-github-actions@v0.0.X
with:
experiments: ${{ inputs.experiments }}
api_keys: |
{
"openai_api_key": "${{ secrets.OPENAI_API_KEY }}",
"anthropic_api_key": "${{ secrets.ANTHROPIC_API_KEY }}"
}
arato_api_key: ${{ secrets.ARATO_API_KEY }}Add these secrets to your repository (Settings β Secrets β Actions): In this example we're using OpenAI and Anthropic but you can use whatever vendor you want
| Secret Name | Description | Example |
|---|---|---|
ARATO_API_KEY |
Your Arato API key | ar-1234567890abcdef... |
OPENAI_API_KEY |
OpenAI API key (if used) | sk-1234567890abcdef... |
ANTHROPIC_API_KEY |
Anthropic API key (if used) | ant-1234567890abcdef... |
- Go to Actions tab in your repository
- Select "Arato Build" workflow
- Click "Run workflow"
- Enter your experiment ID (e.g.,
my-notebook/my-experimentormy-notebook) - Click "Run workflow"
| Parameter | Required | Default | Description |
|---|---|---|---|
experiments |
β Yes | - | Single experiment string or an array of experiments |
api_keys |
β Yes | - | JSON object with your AI model API keys |
api_base_url |
β No | https://api.arato.ai |
Arato API endpoint |
arato_api_key |
β Yes | - | Your Arato API key (starts with "ar-") |
threshold |
β No | - | JSON object with performance thresholds for automatic validation |
| Output | Type | Description |
|---|---|---|
success |
boolean | Whether all builds completed successfully and passed thresholds |
completed_count |
number | Number of successful experiments |
failed_count |
number | Number of failed experiments |
results_summary |
JSON | Detailed build results including threshold validation |
threshold_failures |
JSON | Array of threshold validation failures (if any) |
with:
experiments: ['customer-support']
api_keys: '{"openai_api_key": "${{ secrets.OPENAI_API_KEY }}"}'with:
experiments: '["exp1", "exp2", "exp3"]'
api_keys: |
{
"openai_api_key": "${{ secrets.OPENAI_API_KEY }}",
"anthropic_api_key": "${{ secrets.ANTHROPIC_API_KEY }}"
}jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Arato Build
id: arato-build
uses: AratoAi/arato-github-actions@v0.0.1
with:
experiments: '${{ inputs.experiments }}'
api_keys: '${{ inputs.api_keys }}'
arato_api_key: ${{ secrets.ARATO_API_KEY }}
- name: Send notification
if: always()
run: |
if [[ "${{ steps.arato-build.outputs.success }}" == "true" ]]; then
echo "β
All ${{ steps.arato-build.outputs.completed_count }} experiments completed!"
else
echo "β Build failed. ${{ steps.arato-build.outputs.failed_count }} experiments failed."
fiwith:
experiments: '["quality-check", "performance-test"]'
api_keys: |
{
"openai_api_key": "${{ secrets.OPENAI_API_KEY }}",
"anthropic_api_key": "${{ secrets.ANTHROPIC_API_KEY }}"
}
arato_api_key: ${{ secrets.ARATO_API_KEY }}
threshold: |
{
"eval_pass_rate": 0.8,
"cost": 0.01,
"latency": 3000,
"tokens": 100,
"semantic_similarity": 0.7
}- name: Production Quality Gate
uses: AratoAi/arato-github-actions@v0.0.1
with:
experiments: ${{ inputs.production_experiments }}
api_keys: ${{ secrets.API_KEYS }}
arato_api_key: ${{ secrets.ARATO_API_KEY }}
threshold: |
{
"eval_pass_rate": 0.95,
"cost": 0.005,
"latency": 2000,
"semantic_similarity": 0.85
}The action supports automatic validation of experiment results against configurable performance thresholds. When thresholds are provided, builds will fail if any metrics don't meet your requirements.
| Threshold | Description | Failure Condition |
|---|---|---|
eval_pass_rate |
Minimum evaluation pass rate (0.0-1.0) | Any validation type below threshold |
cost |
Maximum cost per experiment | Cost exceeds threshold (skipped if 0) |
latency |
Maximum time-to-first-token (ms) | Latency exceeds threshold |
tokens |
Maximum token count | Token count exceeds threshold |
semantic_similarity |
Minimum similarity score (-1.0-1.0) | Similarity below threshold (skipped if -1) |
threshold: |
{
"eval_pass_rate": 0.8,
"cost": 0.01,
"latency": 3000,
"tokens": 100,
"semantic_similarity": 0.7
}For detailed examples and best practices, see examples/threshold-validation.md.
Problem: Your api_keys parameter is not valid JSON.
Solution: Ensure proper JSON formatting:
# β
Correct
api_keys: '{"openai_api_key": "sk-..."}'
# β Wrong
api_keys: '{openai_api_key: sk-...}'Problem: Invalid or missing Arato API key.
Solution:
- Check your
ARATO_API_KEYsecret is set correctly - Ensure the key starts with
ar- - Verify the key hasn't expired
Problem: The build API didn't return any experiment IDs.
Solution:
- Check your experiment IDs are in format
notebook-id/experiment-idornotebook-id - Verify the experiments exist in your Arato workspace
- Check the build API response for errors
Problem: Your threshold parameter is not valid JSON.
Solution: Ensure proper JSON formatting:
# β
Correct
threshold: '{"eval_pass_rate": 0.8, "cost": 0.01}'
# β Wrong
threshold: '{eval_pass_rate: 0.8, cost: 0.01}'Problem: One or more performance metrics don't meet your thresholds.
Solution:
- Check the detailed failure report in the build summary
- Review individual experiment results
- Adjust thresholds if they're too strict for your use case
- Investigate performance issues in failing experiments
- Check the logs - GitHub Actions provides detailed execution logs
- Verify inputs - Ensure all required parameters are provided correctly
- Check Arato status - Verify your experiments in the Arato UI
Check the examples/ directory for complete workflow templates:
- Basic Usage - Simple single experiment builds
- Multiple Experiments - Building multiple experiments in parallel
- Threshold Validation - Performance thresholds and quality gates
- π Documentation - Check this README and examples
- π Issues - Report bugs in the Issues tab
- π§ Contact - Reach out to the Arato team
Made with β€οΈ by Arato for AI builders