> For the complete documentation index, see [llms.txt](https://docs.testvibe.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.testvibe.com/self-hosting/ai-models.md).

# AI Models

AI test generation and the assistant need a model to run. On a self-hosted instance you choose **where that model lives**: a hosted provider you supply a key for, or your own model running inside (or beside) the stack.

{% hint style="info" %}
AI only powers **generation** and the **assistant**. Everything else — authoring, running tests, results, load testing — works without any AI configured. If you don't set up a model, generation is simply unavailable.
{% endhint %}

## Option 1 — Hosted Keys (Claude or OpenAI)

Provide your own **Anthropic** or **OpenAI** API key. The app calls that provider directly for generation and vision features. This is the simplest option and gives the strongest results, but it does send generation prompts to that provider.

## Option 2 — Bring Your Own Model (Local)

For a fully private or air-gapped instance, point TestVibe at **your own OpenAI-compatible endpoint** — Ollama, vLLM, LM Studio, or similar. Nothing leaves your network. You configure:

* The **endpoint URL** of your inference server.
* The **model ids** it serves — these become the choices in the app's AI Model picker.
* Optionally an **API token**, a label, and a flag if the model is multimodal (for vision/visual-compare).

The bundle can even run a local model **as part of the stack** (an optional inference sidecar), so the whole thing is self-contained.

{% hint style="warning" %}
**The model must support tool/function calling.** TestVibe generates tests by having the model call browser tools step by step. A model without tool-calling support will stall during generation. Choose a tool-calling-capable model (for example a recent coding model that advertises `tools`), and a GPU is strongly recommended for acceptable speed.
{% endhint %}

## Which Should I Use?

|              | Hosted keys                | Local model                      |
| ------------ | -------------------------- | -------------------------------- |
| Setup effort | Lowest — just a key        | Higher — run an inference server |
| Privacy      | Prompts go to the provider | Stays entirely in your network   |
| Quality      | Strongest                  | Depends on the model you run     |
| Air-gapped   | No                         | Yes                              |
| Hardware     | None                       | GPU strongly recommended         |

Pick hosted keys for the easiest path and best quality; pick a local model when prompts must never leave your network.

## Related Help

* [Configuration](/self-hosting/configuration.md)
* [How AI generation works](/ai-generation/how-ai-generation-works.md)
* [Choose an agent and model](/ai-generation/choose-agent-and-model.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.testvibe.com/self-hosting/ai-models.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
