# Swap the brain

> Deepgram workshops › Build a voice agent › Swap the brain
> Web version: https://workshops.deepgram.com/voice-agent/choose-an-llm
> About 15 min (estimate). Optional.

Change the model that thinks, and hear what it costs.

- [Find the think block](https://workshops.deepgram.com/voice-agent/choose-an-llm/find-the-think-block.md)
- [Try another model](https://workshops.deepgram.com/voice-agent/choose-an-llm/try-another-model.md)

## Find the think block

### Find the line

**Goal:** Find the line in your code that names the model writing your agent's replies.

**You need:** the [voice-agent-workshop](https://github.com/deepgram-devs/voice-agent-workshop) project you set up in First words, with `make run 00` working.

This one runs in your own code, because the browser console doesn't expose the model. The model is the AI that writes what the agent says. The `think` block is the part of your Settings message that picks it.

**Do:** Open First words in your language and find the `think` block in the Settings message. It names a provider (the company that runs the model) and a model.

Python, in `python/missions/00-first-words/start.py`:

```python
"think": {"provider": {"type": "open_ai", "model": "gpt-4o-mini"}, "prompt": PROMPT},
```

TypeScript, in `typescript/missions/00-first-words/start.ts`:

```ts
think: { provider: { type: 'open_ai', model: 'gpt-4o-mini' }, prompt: PROMPT },
```

Java, in `java/missions/m00_first_words/Start.java`:

```java
"think", obj("provider", obj("type", "open_ai", "model", "gpt-4o-mini"), "prompt", PROMPT),
```

**You should see:** a `think` line like the one for your language, with `open_ai` as the provider type and `gpt-4o-mini` as the model. If you can't find it, check that you opened the First words file for your language.

**How it works**

The `think` block decides which model writes the agent's replies. The `listen` and `speak` blocks next to it don't change when you edit it. The voice stays the same and only the thinking does.

Deepgram provides models from OpenAI, Anthropic, and Google. Pick one by its provider `type` and its `model`, and leave `endpoint` out. The current list is in the [LLM models docs](https://developers.deepgram.com/docs/voice-agent-llm-models).

## Try another model

### Get your baseline

**Goal:** Swap the model, ask the same three questions, and say which one answered sooner.

**You need:** the voice-agent-workshop project from the last lesson, with `make run 00` working.

**Do:** Run `make run 00` as it is and ask the three questions below. You'll repeat them later. Count the silence between the end of each question and the first word of the reply.

- "What's the weather like on Mars?"
- "Give me a one-line joke."
- "Explain what a mortgage is."

**You should see:** an answer to each question, and three waits to compare later. If `make run 00` won't start, finish First words first.

### Change one line

**Do:** Swap the `think` provider for Anthropic's `claude-haiku-4-5`, run `make run 00` again, and ask the same three questions.

Python:

```python
"think": {"provider": {"type": "anthropic", "model": "claude-haiku-4-5"}, "prompt": PROMPT},
```

TypeScript:

```ts
think: { provider: { type: 'anthropic', model: 'claude-haiku-4-5' }, prompt: PROMPT },
```

Java:

```java
"think", obj("provider", obj("type", "anthropic", "model", "claude-haiku-4-5"), "prompt", PROMPT),
```

**Listen for:** the wait before the first word, and how the replies are phrased.

**You should see:** the same agent and the same voice, with the replies possibly phrased differently. If the agent won't connect after your change, check the model id (the exact model name) against the [LLM models docs](https://developers.deepgram.com/docs/voice-agent-llm-models).

### Compare the wait

**Do:** Try a bigger model from the same list, such as `gpt-4o`, with the same three questions. Is the wait longer? Does the reply sound better enough to be worth it?

**Check:** You ran two models and heard the difference.

**You should see:** three waits per model, and an answer to which model replied sooner. If you can't say yet, run the same three questions again on each model, then tap **I did this**.

**How it works**

A voice agent speaks as soon as the model sends words. Most of the silence you hear is the model's time to its first words. A bigger model often means a longer wait. Text chat hides that, and a phone call doesn't.

A stopwatch is enough here. You're comparing the wait to the first word across models, not benchmarking, so ask the same questions in the same room.

The prompt, the voice, and everything else in First words stay as they were. To adapt the agent to your own use case next, see [Adapt to your vertical](https://workshops.deepgram.com/voice-agent/adapt-to-your-use-case/adapt-to-your-vertical.md).
