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

# Chat with Flow

> Configure the built-in LLM required for chatting with deployed flows and other platform AI features.

## Overview

The **Chat with Flow** feature lets users interact with a deployed flow through a conversational chat interface directly in the platform UI. It is also used internally for other platform AI features such as generating automation descriptions and improving Studio prompts.

This feature requires a built-in LLM to be configured via Helm chart values. Without it, users will see a generic error message when attempting to chat with a flow:

> *"Sorry, I'm having trouble answering your question. Please try again later."*

<Note>
  This is separate from Studio V2, which has its own setup process. See the [Studio V2 guide](/features/studio-v2) for that configuration.
</Note>

## Prerequisites

* CrewAI Platform is deployed and running
* An API key for a supported LLM provider (**OpenAI** or **Anthropic**)

## Configuration

Three Helm chart values control the built-in LLM. Two are non-sensitive environment variables and one is a secret:

### Environment Variables (non-sensitive)

Set these under `env` in your `values.yaml`:

```yaml theme={null}
env:
  # Built-in LLM configuration
  # Used for chatting with flows, generating automation descriptions,
  # improving Studio prompts, etc.
  BUILT_IN_LLM_MODEL: "gpt-4.1-mini"        # Model name
  BUILT_IN_LLM_PROVIDER: "openai"            # "openai" or "anthropic"
```

| Variable                | Description                                                                                 | Default        | Required |
| ----------------------- | ------------------------------------------------------------------------------------------- | -------------- | -------- |
| `BUILT_IN_LLM_PROVIDER` | LLM provider to use. Supported values: `openai`, `anthropic`.                               | `openai`       | Yes      |
| `BUILT_IN_LLM_MODEL`    | Model identifier for the chosen provider (e.g. `gpt-4.1-mini`, `claude-sonnet-4-20250514`). | `gpt-4.1-mini` | Yes      |

### Secrets (sensitive)

Set this under `secrets` in your `values.yaml`:

```yaml theme={null}
secrets:
  BUILT_IN_LLM_API_KEY: "sk-..."   # Your LLM provider API key
```

| Variable               | Description                              | Required |
| ---------------------- | ---------------------------------------- | -------- |
| `BUILT_IN_LLM_API_KEY` | API key for the configured LLM provider. | **Yes**  |

<Warning>
  If `BUILT_IN_LLM_API_KEY` is not set or is invalid, all Chat with Flow attempts will fail. A 401 error in the logs typically means the API key is missing, expired, or incorrect.
</Warning>

## Apply the Configuration

After updating your `values.yaml`, upgrade the Helm release:

```bash theme={null}
helm upgrade crewai <chart-path> -f values.yaml -n <namespace>
```

No rake tasks or manual setup steps are required — the platform picks up the environment variables on restart.

## Verify

1. Deploy a flow (or use an existing deployed flow)
2. Click **Chat with this crew** from the deployment dashboard
3. Send a test message (e.g., "Hi")
4. You should receive a response from the flow instead of an error

## Troubleshooting

| Symptom                                             | Likely Cause                                     | Fix                                                                           |
| --------------------------------------------------- | ------------------------------------------------ | ----------------------------------------------------------------------------- |
| "Sorry, I'm having trouble answering your question" | `BUILT_IN_LLM_API_KEY` not set or invalid        | Set a valid API key in `secrets.BUILT_IN_LLM_API_KEY` and upgrade the release |
| 401 Unauthorized in logs                            | Expired or incorrect API key                     | Rotate the API key with your LLM provider and update the secret               |
| Chat option not visible                             | Flow is not deployed or not in "Online" status   | Check the deployment dashboard — the flow must be **Online**                  |
| Model not found errors                              | `BUILT_IN_LLM_MODEL` set to an unsupported model | Use a valid model name for the configured provider                            |
