- Platform Experiments - Configure the experiment in LangWatch, then trigger it from CI/CD with a single line
- Experiments via SDK - Define the entire experiment in code and run it in CI/CD
Option 1: Platform Experiments
Configure your experiment once in the LangWatch Experiments via UI, then trigger it from CI/CD.Setup
-
Create your experiment in the Experiments via UI
- Add your dataset
- Configure targets (prompts, models, or API endpoints)
- Select evaluators
- Run it once to verify it works
-
Get your experiment slug from the URL:
Or open the Run Options menu in the experiment toolbar and choose Run in CI/CD for ready-to-copy snippets.
- Run from CI/CD:
- Python
- TypeScript
GitHub Actions Example
Options
Reading per-row results
run(...) waits for the run to finish and gives you the per-row results, so you can assert on them in CI or inspect them locally:
- Python
- TypeScript
Choosing what to evaluate
By default the run uses the dataset attached to the experiment. You can override the data from CI without changing the platform configuration:parameters— constant inputs merged into every row (and the single row when there is no dataset), handy for a feature flag or a model namedata— inline rows to evaluatedataset_id— a different platform dataset by id (dataanddataset_idare mutually exclusive)row_indices— a subset of dataset row indices to evaluate, instead of the whole dataset
- Python
- TypeScript
Option 2: Experiments via SDK
Define your entire experiment in code. This gives you full control and version control over your experiment configuration.Basic Example
- Python
- TypeScript
GitHub Actions Example
scripts/run_evaluation.py contains your full experiment code.
Comparing Multiple Configurations
SDK experiments shine when comparing different configurations:Results Summary
Both approaches output a CI-friendly summary:print_summary() method:
- Outputs results in a structured format
- Returns exit code 1 if any evaluations failed (unless
exit_on_failure=False) - Provides a link to view detailed results in LangWatch
CI Platform Examples
GitLab CI
- Platform Experiment
- via SDK
CircleCI
- Platform Experiment
- via SDK
Error Handling
- Python
- TypeScript
REST API (Platform Experiments)
For custom integrations, you can use the REST API directly:Start a Run
Poll for Status
Fetch Results
Next Steps
Experiments via UI
Create experiments in the platform UI
Experiments via SDK
Full guide to SDK experiments
Evaluators
Browse available evaluators
Datasets
Manage your test datasets