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

# Choose a model per function

> Route every AI function at once with a strategy preset, pick a model for a single function by hand, and fix a function that's flagged.

One model for everything is a compromise: you either overpay on routine text or underpower your research. With per-function routing you decide for each AI-powered function in Vector — your strongest model on [competitor](/competitors/add-competitors) research, a cheaper, faster one on routine text suggestions.

Routing lives in **Settings**, on the **AI Providers** tab, under **Function routing**: one row per function — product description, competitor search, pricing scans, research, [monitoring](/monitoring/set-up-monitoring) checks and the rest — each with its own **Provider** and **Model**.

<Note>
  Routing needs a key for every provider you point functions at, not just the one you started with. See [Connect an AI provider](/getting-started/connect-a-provider).
</Note>

<Frame caption="Function routing: a Strategy preset routes every function at once, or set a row by hand">
  <img src="https://mintcdn.com/vectordocs/hMKojhc26pnkTmuV/images/ai/model-per-function-function-routing.png?fit=max&auto=format&n=hMKojhc26pnkTmuV&q=85&s=f2d3cf6452d314fcc3d1b2ed7e014559" alt="The Function routing table in Settings, with Strategy presets above it and a provider and model selector on each row" width="1663" height="690" data-path="images/ai/model-per-function-function-routing.png" />
</Frame>

## Route every function at once

Pick a **Strategy** above the table:

* **Min price** — the cheapest recommended model for each function.
* **Balanced (default)** — the best trade-off between quality and price for each function.
* **Best quality** — the most capable recommended model for each function.

A strategy only uses providers you have a key for, and never routes a function below the recommended quality bar.

To put every function on one provider instead, choose it in **Route all to…** and click **Route all**. Each function gets that provider's cheapest recommended model; functions it has no suitable model for keep their current route.

## Pick a model for one function

Choose a **Provider** and **Model** on the function's row. From the function's next run, it uses exactly what you chose; other functions aren't affected. Leave a row on **Use default** to follow the workspace default.

The price is visible as you choose: each model lists its cost per million tokens in and out, and the **in $/1M** and **out $/1M** columns repeat it for each row. A model at or above Vector's recommended quality bar carries a **★**; a model still in preview says so.

Editing a row switches the strategy to **Custom**, so your change isn't overwritten by a preset it no longer matches. Pick a preset again to reset every row.

## Choose a model for functions that search the web

Functions that need to search the web — competitor search, pricing scans, deep research, monitoring — are marked **web**. Their model list offers only models that can search, so you can't pick one that would fail at run time. Text-only functions aren't restricted.

## Keep bulk and unattended work on stable models

Preview models have no capacity guarantees: under load they can answer that the model is experiencing high demand and fail the run. Vector retries these failures, but a preview model still fails more often than a stable one. When a function is on a preview model, a notice above the table lists which ones.

Prefer a stable model for anything that runs in bulk — research across many features — or unattended, like scheduled monitoring.

## Fix a flagged function

A row is flagged when it points at something that won't work. What happens when the function runs depends on the problem:

| Problem                                                                                     | What happens                                                                                   |
| ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| A model that's been retired, or that lacks something the function needs, such as web search | The function is blocked: nothing runs until you pick another model                             |
| A provider you have no key for, or whose key you switched off                               | The function runs on your best other provider with a key. It's blocked only if there isn't one |

Pick another model on the row, or add or switch on the key, to clear the flag.

If a provider's key is set but the provider isn't working, Vector doesn't change routing for you — reroute the affected functions or fix the provider.

Whichever provider and model actually ran a function is what shows in your [usage log](/ai/ai-usage).

## Where to go next

<Columns cols={2}>
  <Card title="AI usage and cost" icon="arrow-left" href="/ai/ai-usage">
    Seeing what your choices cost.
  </Card>

  <Card title="Connect web scrapers" icon="arrow-right" href="/ai/web-scrapers">
    Choosing how pages get collected.
  </Card>
</Columns>
