> ## Documentation Index
> Fetch the complete documentation index at: https://concentrate.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Model Optimizer

> Find cheaper models for the jobs your agents repeat, tested on your own conversations before you switch.

The optimizer finds the jobs your agents repeat, tests cheaper models on real conversations from each job, and tells you which model does the job as well for less.

It only recommends. Nothing about your traffic changes until you change the `model` you send.

## Before you start

* **Send traffic through Concentrate.** A scan reads your requests from the last 3 days.
* **Turn on logging.** The optimizer tests models on the prompts and responses in your logs. In **Settings**, open **Logging** and turn on **Enable customer-controlled logs**. See [Zero Data Retention & Logging](https://concentrate.ai/docs/api-reference/endpoint/zero-data-retention.md).
* **In an organization, allow it.** An owner turns on **Allow the optimizer** in the organization's **Settings**.

## Run your first test

**1. Open the optimizer**

In the app, go to **Logs → Optimizer**.

**2. Scan your requests**

Choose **Scan requests**. In an organization, you can first pick which teams to include.

The scan groups your recent requests into **workflows**: the jobs your agents do again and again.

**3. Pick the workflows to test**

Workflows are listed biggest spend first, and all of them start ticked. Untick any you don't want to test.

Each row shows what testing that workflow costs. The bar at the bottom shows the total cost and time.

**4. Run the test**

Choose **Run test**. The optimizer replays a sample of each workflow's conversations on cheaper models and grades every reply.

**5. Read the results**

Each workflow ends with one of three results:

| Result | Meaning |
| - | - |
| **Switch to** a model | A cheaper model did the job as often as the one you use today. |
| **Keep** your model | No cheaper model held up, or yours is already the cheapest that does the job. |
| **No verdict** | There wasn't enough evidence to decide. Run the test again. |

Under **Evidence**, open any conversation to compare your current model's replies with the recommended model's.

**6. Make the switch**

Copy the model ID from the result and send it as `model` in that workflow's requests.

## Adjust a test

The defaults work without changes. Open a workflow before you run the test to adjust it.

> [accordion] Choose which models are tested
>
> Each workflow starts with a shortlist of models that cost less than the one it uses today. Remove any you don't want, or add any other chat model.
>
> To test only models from the maker of your current model, open the settings icon beside **Scan requests** and turn on **Only models by the same maker**.

> [accordion] Change how replies are graded
>
> Every reply, from every model, takes the same checks: that your app can read it, that it answers what was asked, and a few rules the scan writes for that workflow.
>
> * A **must pass** check fails the reply when missed. A **tracked** check is reported but doesn't fail it. You can switch a rule between the two, or remove it.
> * Add your own check: a yes/no question about the reply, a phrase it must or must not include, or a word limit.
> * Edit **Judge criteria** to describe, in your own words, what a good reply looks like.

> [accordion] Scan more or fewer requests
>
> Open the settings icon beside **Scan requests** and choose a number under **Requests to scan**. Scan more when your jobs don't repeat often. Scan fewer if the app says the scan was too large.

> [accordion] Test a single request
>
> Choose **Optimize one call**, open a row in **Logs**, then choose **Optimize this call**. The request must have succeeded.

> [accordion] Rerun a test with changes
>
> Choose **Rerun with changes** on a finished test. It reopens with the same workflows, models and checks, so you can change any of them and run it again.

## Billing

Your first scan creates an API key named **Optimizer** in **API Keys**. Scans and tests are billed to that key. The cost shown before a test is an estimate.

Pausing or revoking the key stops scans and tests until you resume it.

## If a scan finds nothing to test

The app shows the reason on the scan box. Find the message you see below.

| What the app says | What to do |
| - | - |
| No requests in the last 3 days | Send traffic through a Concentrate API key, then scan again. If you picked teams, add the teams that send traffic. |
| Prompts and responses aren't logged | Turn on **Enable customer-controlled logs** in **Settings**, send some traffic, then scan again. |
| You can't see these requests' content | Ask an admin for log access, or turn off redaction on the key. |
| No job repeats 5 times yet | Scan more requests with the settings icon beside **Scan requests**, or wait for more traffic. |
| Every request looks different | Keep each agent's system prompt the same across requests. |
| Conversations started before this scan | Scan more requests with the settings icon beside **Scan requests**. |
| Conversations rely on stored history | Send the full message history with each request instead of `previous_response_id`. |
| These requests use remote MCP servers | Scan a team whose tools run in your own code. |
| These requests aren't priced per token | Scan a team that sends text requests. Image, audio and per-call models can't be tested. |
| Failed requests can't be tested | Pick a request that succeeded from **Logs**. |
| This scan was too large | Scan fewer requests with the settings icon beside **Scan requests**. |
| Your optimizer key is paused or revoked | Resume it in **API Keys**. |
| The scan failed on our side, or We couldn't read these logs | Nothing is wrong with your traffic. Try again in a few minutes. |
