Prerequisites
- A Keywords AI API Key.
- Python installed (for the code examples).
Step 1: Ingest Logs
First, you need to have logs in the system to create a dataset. You can log your LLM requests using the Request Logging endpoint. Use the Log ingestion endpoint to send your LLM request data to Keywords AI.Step 2: Retrieve Logs for Dataset
Once you have logs, you might want to filter them to create a dataset. Use the Retrieve log list endpoint to find the specific logs you want to include (e.g., by time range or metadata).Step 3: Create a Dataset
Create a dataset from your logs. You can filter logs by ID, time range, or sample a percentage of them. Refer to the Create dataset endpoint for more details.Step 4: Create an Evaluator
Define how you want to evaluate your experiments. You can create an LLM-based evaluator, a code-based evaluator, or a human evaluator. See Create Evaluator for options.Step 5: Create and Run Experiment
Now, create an experiment using your dataset and evaluator. If you are running a Custom Workflow (where you process inputs yourself and submit results), follow the Experiment V2 API.- List the logs to get the inputs.
- Process the inputs with your model/logic.
- Submit the results back to the experiment.
- The evaluators will run automatically.