# GPT-Live

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

## 8. Evaluating GPT-Live

In this lesson, we’ll learn how to evaluate a GPT-Live application and measure whether changes to the model, prompt or backend improve its performance.

As we’ve seen, GPT-Live can listen and speak at the same time. It manages the conversation and decides when to delegate work to a backend. That gives us two axes for evaluation: conversation quality and task completion.

1. **Conversation quality.** Did GPT-Live respond promptly and sound natural?
2. **Task completion.** Did the application complete the caller’s request correctly?



### 1. Conversation quality

Let’s start with the spoken conversation. We can use the metrics below to assess how responsive GPT-Live feels, how often it interrupts the caller and how much silence callers experience during delegation.

- **Response rate** measures the share of eligible requests answered within a time limit.
- **Response latency** measures the average wait from the end of caller speech to the first timely spoken reply.
- **Interruption rate** measures how often GPT-Live interrupts an eligible caller request.
- **Speaking duration** measures total assistant speech and the most speech in one turn.
- **Silence during delegation** measures the total silence and longest pause while backend work is active.



These measurements can point us to conversations worth reviewing, but we still need to listen to the audio to judge whether the pacing feels natural. We can add targeted checks for names, numbers or other details the application needs to recognize or say correctly.

### 2. Task completion

Next, let’s look at whether the application completed the caller’s request correctly. For the delivery agent from [Lesson 7](https://developers.openai.com/api/training/gpt-live/7-client-delegation), we’ll want to check that the approved order was saved in the backend and that the caller received an accurate confirmation.

We can grade these checks in two ways:

- **Code-based evaluation:** For some checks, we can use code to verify that the right tool ran or that the order was saved correctly in the backend.
- **LLM as a judge:** For more subjective checks, we can use a separate model to review the transcript and assess whether GPT-Live understood the request, gave a helpful answer and used an appropriate tone.

Code checks that the backend saved one confirmed order. An example judge rubric can assess whether the response was helpful and used an appropriate tone.



#### Task completion rate

For each scenario, we specify which checks are required and consider the task successful when **all required checks pass**.

Because results can vary between runs, we recommend evaluating the same scenario multiple times. The **task completion rate** measures the percentage of valid attempts that pass. Here’s what that could look like for our delivery order example.

In this illustration, two of three attempts pass, giving a task completion rate of 67%. The third fails because the order was not submitted or saved, and GPT-Live asks for approval the caller already provided.



#### Secondary metrics

In addition to task completion, we can track secondary metrics to help us diagnose failures. We don’t use these scores to determine whether the task was completed, but they can help us understand which parts of the application need attention.

- **Delegation accuracy (code-based)** is 1 or 0 depending on whether the delegation decision followed the scenario’s policy.
- **Semantic quality (LLM as a judge)** averages the applicable rubric scores for understanding, context, clarification, grounded communication and conversational coherence.
- **Tool accuracy (code-based)** measures how closely completed calls match expected tools and arguments, including missing, extra or prohibited calls.



### Cost and latency

Alongside quality, we’ll also want to measure cost and latency. Once we’ve met our quality threshold, these measurements can help us compare different approaches, including which backend model to use.

#### Cost

GPT-Live and the backend model are billed separately, so make sure to include both when measuring cost.

#### Latency

For latency, we can measure:

- **Response latency:** How long it takes GPT-Live to start replying after the caller finishes speaking.
- **Task completion time:** How long it takes the application to complete the request. For a delivery order, we could measure from the caller’s approval to the confirmed receipt.

As with task completion, response times can vary between runs, so we recommend evaluating each scenario multiple times. We can then sort the average response latency from each run from shortest to longest and calculate P50 and P90.

- **P50** is the median response time. It tells us what a typical wait looks like.
- **P90** is the 90th percentile. It helps us understand how long the wait can be for slower responses.

### Scenarios to evaluate

Now let’s look at which scenarios to evaluate. We recommend starting with a small set that represents the different requests the application needs to handle.

- **Direct answer.** Answer using information already available in the conversation or instructions.
- **Required action.** Delegate work and verify that the application completed the requested action.
- **Correction.** Follow the caller’s latest instruction when a detail changes.
- **Missing information.** Ask for a required detail before proceeding.
- **Forbidden action.** Decline the request and verify that the prohibited action did not occur.
- **Audio and conversation conditions.** Test background speech, interruptions, hesitation and recording quality.



For each scenario, decide what information the application should have and what a successful response would look like.

### Build up complexity with Crawl, Walk, and Run

With the metrics and scenarios in place, let’s look at how we’ll run the tests. There’s a lot of complexity to account for, from different audio conditions to longer conversations. To make it easier to iterate, we’ll build up gradually using a **Crawl, Walk and Run** approach.

- **Crawl** tests a single request with clean generated audio.
- **Walk** tests a single request with realistic recordings.
- **Run** tests a full conversation with an independent simulated caller.



The [GPT-Live evaluation cookbook](https://developers.openai.com/cookbook/examples/audio/voice_agent_evaluation) goes into more detail on these metrics and includes a runnable [evaluation harness](https://github.com/openai/openai-cookbook/tree/main/examples/audio/duplex_voice_agent_evaluation) for all three stages.

#### Crawl

Let’s start with Crawl. We can use [text-to-speech models](https://developers.openai.com/api/docs/guides/text-to-speech#text-to-speech-models) to make a clean recording of a request, then replay the same audio as we make changes to the application.

A written request such as “What delivery window did you say?” is converted into synthetic caller audio and played to GPT-Live.



The input stays consistent while we evaluate both task completion and the spoken response.

If the request depends on earlier conversation, we can supply that history as text in `session.input` and test just the new spoken request.

At session setup, `session.input` contains the earlier conversation as text:

- User: “When will the order arrive?”
- Assistant: “The verified delivery window is 7:00 to 7:15 PM.”

The browser then streams the generated request: “What delivery window did you say?” Evaluate whether GPT-Live repeats the verified window without a new delegation.



#### Walk

Once those requests work reliably, we move to Walk. We keep the task the same but use recordings of real people. Now we can see whether the application still responds correctly across different accents and recording conditions.

If real recordings aren’t available, we can start with synthetic speech and add effects such as background noise or telephone compression.

Compare the clean Crawl request with versions containing background speech and a phone-line effect.



These tests can also show whether the assistant asks for clarification when it can’t make out a required detail.

#### Run

In Run, we evaluate full conversations. This is where we can test whether the assistant remembers earlier details and responds appropriately when the caller corrects or interrupts it.

We do this with two GPT-Live sessions. One is the assistant we’re evaluating. The other plays the caller and has its own goal for the conversation. We connect their audio so each can hear and respond to the other.

In a recorded simulated conversation, the caller asks about the price, reviews the order and approves it. The backend returns a confirmed receipt, and GPT-Live communicates the result to the caller.



### Keep evaluating

As we iterate, we recommend making one change at a time and repeating the evaluation. We can keep the tests that already pass as a regression suite and rerun them after each change to make sure we haven’t broken something that was previously working.

Even after the application is in production, we’ll continue sampling real conversations. If we find a failure, we can reproduce it and add it to the evaluation set.

### Try it yourself

Use the prompt below to evaluate the food delivery application from [the previous lesson](https://developers.openai.com/api/training/gpt-live/7-client-delegation).



**Evaluate the food delivery application:**

```text
[@OpenAI Developers](plugin://openai-developers@openai-curated), help me evaluate the food delivery application from Lesson 7 (https://developers.openai.com/api/training/gpt-live/7-client-delegation.md) using this evaluation lesson and the GPT-Live evaluation harness at https://github.com/openai/openai-cookbook/tree/main/examples/audio/duplex_voice_agent_evaluation. Review the application’s prompt and backend, create representative scenarios and graders, and help me run Crawl, Walk and Run. Measure conversation quality and task completion across repeated attempts, along with cost and latency. Summarize the results and suggest what to improve.

Lesson 8: https://developers.openai.com/api/training/gpt-live/8-evaluating-gpt-live.md
```

And that’s a wrap on the GPT-Live training! We look forward to seeing what you build with it.
