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

# Overview

> Connect your own LLM provider to ByteRover for unlimited model access

ByteRover includes a built-in LLM with limited free usage (requires a logged-in ByteRover account). Connect your own provider to remove limits and choose any supported model — no ByteRover account needed.

When the built-in provider is active, your remaining credits show in the REPL header as a `Billing:` line and in the [web UI header](/local-web-ui/providers-and-models) as a `<N> cr` pill. If you belong to one or more paid teams, you can also pick which team to bill per project — see [Pick a billing team](#pick-a-billing-team).

<Tip>
  Prefer a visual workflow? See [Providers & Models in the web UI](/local-web-ui/providers-and-models). In the web picker, **ByteRover** is pinned at the top with a **Native** badge — selecting it opens the sign-in popup directly, with no extra confirmation step.
</Tip>

## Connect a provider

<Tabs>
  <Tab title="TUI">
    <Steps>
      <Step title="Open the provider selector">
        ```
        /providers
        ```

        ByteRover lists all providers with a short description of each (what its models are known for) and status indicators — `(Current)` for the active provider, `[Connected]` for previously connected ones.
      </Step>

      <Step title="Select and connect">
        Select an unconnected provider. Providers that support OAuth (currently OpenAI) will present a choice — **"Sign in with OAuth"** to authenticate via your browser, or **"API Key"** to enter a key manually. Other providers prompt for an API key directly. ByteRover validates credentials before saving. After connecting, a model selector opens automatically.

        <img src="https://mintcdn.com/demo-a750c123/MMiVZwz4r8rsiLRA/images/llm_providers.png?fit=max&auto=format&n=MMiVZwz4r8rsiLRA&q=85&s=ac21317733fbf1f2d399e9b836522c92" alt="Provider selector" width="700" style={{ borderRadius: '12px' }} data-path="images/llm_providers.png" />

        Picking **ByteRover** while signed in to one or more paid teams shows a billing-team picker as part of the connect flow. The team you choose is remembered for the current project; switching teams later is non-destructive. See [Pick a billing team](#pick-a-billing-team) below.
      </Step>
    </Steps>
  </Tab>

  <Tab title="CLI">
    <Steps>
      <Step title="List available providers">
        ```bash theme={null}
        brv providers list
        ```
      </Step>

      <Step title="Connect with your API key or OAuth">
        ```bash theme={null}
        brv providers connect <provider-id> --api-key <your-key>
        ```

        Optionally set the active model in the same step:

        ```bash theme={null}
        brv providers connect anthropic --api-key sk-ant-... --model claude-sonnet-4-5-20250929
        ```

        For providers that support OAuth (currently OpenAI), you can authenticate via your browser instead:

        ```bash theme={null}
        brv providers connect openai --oauth
        ```

        To switch back to the ByteRover built-in (requires `brv login` first):

        ```bash theme={null}
        brv login                          # opens your browser for OAuth
        # or on CI / SSH:
        # brv login --api-key <your-api-key>
        brv providers connect byterover

        # Pin this project to a paid team (byterover provider only):
        brv providers connect byterover --team acme
        ```

        `--team` accepts a team name or slug. It is only supported for the `byterover` provider; passing it elsewhere fails with a clear error. See [Pick a billing team](#pick-a-billing-team) below.

        If authentication or connection fails, the CLI displays the specific error — follow the instructions in the message to resolve it.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Select a model

<Tabs>
  <Tab title="TUI">
    <Steps>
      <Step title="Open the model browser">
        ```
        /model
        ```

        Models are grouped by provider, with pricing and context window size shown when available.

        <img src="https://mintcdn.com/demo-a750c123/axqpCJrOpHcLW_UR/images/showModels.png?fit=max&auto=format&n=axqpCJrOpHcLW_UR&q=85&s=e05cba8526cb1099c27d7fd2fd6460f7" alt="Model browser" width="700" style={{ borderRadius: '12px' }} data-path="images/showModels.png" />
      </Step>

      <Step title="Select a model">
        Use arrow keys to browse and press Enter to select. You can also type to filter models by name or provider.
      </Step>
    </Steps>
  </Tab>

  <Tab title="CLI">
    <Steps>
      <Step title="List available models">
        List models from all connected providers:

        ```bash theme={null}
        brv model list
        ```

        Filter to a specific provider:

        ```bash theme={null}
        brv model list --provider openrouter
        ```
      </Step>

      <Step title="Switch to a model">
        Switch to a model on the active provider:

        ```bash theme={null}
        brv model switch <model-id>
        ```

        Switch a model on a specific provider without changing the active provider:

        ```bash theme={null}
        brv model switch gpt-4.1 --provider openai
        ```
      </Step>
    </Steps>

    Show the currently active model:

    ```bash theme={null}
    brv model
    ```
  </Tab>
</Tabs>

<Note>
  Model lists are cached for 1 hour. ByteRover refreshes automatically when the cache expires.
</Note>

## Switch providers

<Tabs>
  <Tab title="TUI">
    <Steps>
      <Step title="Open the provider selector">
        ```
        /providers
        ```
      </Step>

      <Step title="Select a connected provider">
        Select any provider marked `[Connected]`. ByteRover switches without re-entering your API key.
      </Step>
    </Steps>
  </Tab>

  <Tab title="CLI">
    Switch to a provider that's already connected:

    ```bash theme={null}
    brv providers switch <provider-id>
    ```

    Show the currently active provider and model:

    ```bash theme={null}
    brv providers
    ```
  </Tab>
</Tabs>

## Pick a billing team

The built-in **ByteRover** provider charges credits against a billing team. Personal accounts on the free tier always bill to their personal allotment. If you are a member of one or more paid teams, you can choose per project which team's credits get spent.

**When the picker appears**

* TUI / web UI: as a step in the ByteRover provider-connect flow, after sign-in, only if you have at least one paid team.
* CLI: pass `--team <name>` to `brv providers connect byterover`. The flag accepts a team name or slug and is only supported for the `byterover` provider.

**What the CLI confirms**
After a successful pin, the CLI logs:

```
ByteRover usage on this project will be billed to <team>.
```

**Where credits show up**

* REPL header: `Billing: <team> (<remaining> credits, <tier>)` for paid teams, or `Billing: Personal free credits (<remaining> / <total>)` for the free tier.
* Web UI: a `<N> cr` pill next to each team row in the picker and in the page header (e.g. `12.4k cr`, `50k cr`). One decimal of precision so `12.4k` and `12.9k` stay distinguishable.

**Out of credits**

When the active team's credits hit zero:

* **CLI** — `brv curate` and `brv query` fail and a message that names every other paid team you could switch to. For free-tier accounts, the message tells you to upgrade to a paid team.
* **Web UI** — the provider picker shows an "exhausted" alert with a **Top up** button. The button opens your team's billing settings in a new tab. You can also pick another team or switch to a bring-your-own-key provider directly from the alert.

## Disconnect a provider

Disconnecting removes the stored API key and reverts to ByteRover's built-in LLM if the disconnected provider was active.

<Tabs>
  <Tab title="TUI">
    <Steps>
      <Step title="Open the provider selector">
        ```
        /providers
        ```
      </Step>

      <Step title="Select a connected provider">
        Select a connected provider to open the actions menu.
      </Step>

      <Step title="Select Disconnect">
        Choose **Disconnect** to remove the stored API key and disconnect the provider.

        <img src="https://mintcdn.com/demo-a750c123/MMiVZwz4r8rsiLRA/images/disconnect_provider.png?fit=max&auto=format&n=MMiVZwz4r8rsiLRA&q=85&s=a135f3b006035890aaa2ad5d5008a910" alt="Disconnect provider" width="700" style={{ borderRadius: '12px' }} data-path="images/disconnect_provider.png" />
      </Step>
    </Steps>
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    brv providers disconnect <provider-id>
    ```
  </Tab>
</Tabs>

## Local LLM setup

The `openai-compatible` provider connects to any OpenAI-compatible local server — Ollama, LM Studio, vLLM, or any custom endpoint. You provide the base URL when connecting.

When listing models from the endpoint, `brv providers connect` dedupes by model ID. Upstreams that return the same model under multiple aliases (for example NVIDIA NIM) show as a single row in the picker.

<Tabs>
  <Tab title="TUI">
    <Steps>
      <Step title="Serve your model">
        Make sure your local LLM server is running before connecting.
      </Step>

      <Step title="Connect the provider">
        Run `/providers` and select **OpenAI Compatible**. ByteRover prompts you to enter the base URL of your endpoint:

        ```
        /providers
        ```

        <img src="https://mintcdn.com/demo-a750c123/MMiVZwz4r8rsiLRA/images/local_llm_baseURL.png?fit=max&auto=format&n=MMiVZwz4r8rsiLRA&q=85&s=d0e3792c0185a1bd5909848f32686fe6" alt="Base URL prompt for OpenAI Compatible provider" width="700" style={{ borderRadius: '12px' }} data-path="images/local_llm_baseURL.png" />

        Enter your base URL (e.g., `http://localhost:11434/v1` for Ollama). An API key prompt follows — leave it blank if your server doesn't require one.
      </Step>

      <Step title="Select your model">
        ```
        /model
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="CLI">
    <Steps>
      <Step title="Serve your model">
        Make sure your local server is running before connecting.
      </Step>

      <Step title="Connect the provider">
        Pass your base URL with `--base-url`. API key is optional:

        ```bash theme={null}
        brv providers connect openai-compatible --base-url http://localhost:11434/v1
        ```

        With an API key (e.g., for LM Studio with auth enabled):

        ```bash theme={null}
        brv providers connect openai-compatible --base-url http://localhost:1234/v1 --api-key <your-key>
        ```
      </Step>

      <Step title="Switch to your model">
        ```bash theme={null}
        brv model switch llama3
        ```
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Supported providers

ByteRover supports **20 providers**:

| Provider               | ID                  | Default model                                       | Get API key                                                              |
| ---------------------- | ------------------- | --------------------------------------------------- | ------------------------------------------------------------------------ |
| ByteRover (built-in)   | `byterover`         | —                                                   | No API key — requires `brv login`                                        |
| OpenRouter             | `openrouter`        | `anthropic/claude-sonnet-4.5`                       | [openrouter.ai/keys](https://openrouter.ai/keys)                         |
| Anthropic              | `anthropic`         | `claude-sonnet-4-5-20250929`                        | [console.anthropic.com](https://console.anthropic.com/settings/keys)     |
| OpenAI                 | `openai`            | `gpt-4.1`                                           | [platform.openai.com](https://platform.openai.com/api-keys)              |
| Google Gemini          | `google`            | `gemini-3-flash-preview`                            | [aistudio.google.com](https://aistudio.google.com/apikey)                |
| xAI (Grok)             | `xai`               | `grok-3`                                            | [console.x.ai](https://console.x.ai)                                     |
| Groq                   | `groq`              | `openai/gpt-oss-120b`                               | [console.groq.com](https://console.groq.com/keys)                        |
| Mistral                | `mistral`           | `mistral-large-latest`                              | [console.mistral.ai](https://console.mistral.ai/api-keys)                |
| DeepInfra              | `deepinfra`         | `meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8` | [deepinfra.com](https://deepinfra.com/dash/api_keys)                     |
| Cohere                 | `cohere`            | `command-a-03-2025`                                 | [dashboard.cohere.com](https://dashboard.cohere.com/api-keys)            |
| Together AI            | `togetherai`        | `meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8` | [api.together.ai](https://api.together.ai/settings/api-keys)             |
| Perplexity             | `perplexity`        | `sonar-pro`                                         | [perplexity.ai](https://www.perplexity.ai/settings/api)                  |
| Cerebras               | `cerebras`          | `gpt-oss-120b`                                      | [cloud.cerebras.ai](https://cloud.cerebras.ai/platform)                  |
| Vercel                 | `vercel`            | `v0-1.5-md`                                         | [v0.dev](https://v0.dev/chat/settings/keys)                              |
| MiniMax                | `minimax`           | `MiniMax-M2.7`                                      | [platform.minimax.io](https://platform.minimax.io)                       |
| GLM (Z.AI)             | `glm`               | `glm-4.7`                                           | [chat.z.ai](https://chat.z.ai/)                                          |
| GLM Coding Plan (Z.AI) | `glm-coding-plan`   | `glm-4.7`                                           | [z.ai/manage-apikey/apikey-list](https://z.ai/manage-apikey/apikey-list) |
| Moonshot AI (Kimi)     | `moonshot`          | `kimi-k2.5`                                         | [platform.moonshot.ai](https://platform.moonshot.ai/console/api-keys)    |
| DeepSeek               | `deepseek`          | `deepseek-chat`                                     | [platform.deepseek.com](https://platform.deepseek.com/api_keys)          |
| OpenAI Compatible      | `openai-compatible` | `llama3`                                            | Optional (depends on endpoint)                                           |

## Recommended LLM list

The following models have been verified and are recommended for optimal performance with ByteRover:

| Provider        | Model                           |
| --------------- | ------------------------------- |
| Anthropic       | `claude-opus-4.6`               |
| Anthropic       | `claude-sonnet-4.6`             |
| Anthropic       | `claude-3.7-sonnet`             |
| Anthropic       | `claude-haiku-4.5`              |
| Anthropic       | `claude-3-haiku`                |
| Google (Gemini) | `gemini-3.1-pro-preview`        |
| Google (Gemini) | `gemini-3.1-flash-lite-preview` |
| Google (Gemini) | `gemini-3-flash-preview`        |
| OpenAI          | `gpt-5.4`                       |
| OpenAI          | `gpt-5.2`                       |
| OpenAI          | `gpt-5.1`                       |
| OpenAI          | `gpt-5.4-mini`                  |
| OpenAI          | `gpt-5`                         |
| OpenAI          | `gpt-4.5`                       |
| OpenAI          | `gpt-4.1`                       |
| OpenAI          | `gpt-4.1-nano`                  |
| OpenAI          | `gpt-4o`                        |
| OpenAI          | `gpt-4o-mini`                   |
| OpenAI          | `o3`                            |
| OpenAI          | `o3-mini`                       |
| ZAI             | `glm-5`                         |
| ZAI             | `glm-4.7`                       |
| ZAI             | `glm-4.6`                       |
| ZAI             | `glm-4.5`                       |
| ZAI             | `glm-4.5-flash`                 |

## Environment variable auto-detection

If an API key is already set in your environment, ByteRover detects it automatically — no manual entry needed when connecting.

| Provider          | Environment variable(s)                  |
| ----------------- | ---------------------------------------- |
| Anthropic         | `ANTHROPIC_API_KEY`                      |
| OpenAI            | `OPENAI_API_KEY`                         |
| OpenRouter        | `OPENROUTER_API_KEY`                     |
| Google Gemini     | `GOOGLE_API_KEY`, `GEMINI_API_KEY`       |
| xAI               | `XAI_API_KEY`                            |
| Groq              | `GROQ_API_KEY`                           |
| Mistral           | `MISTRAL_API_KEY`                        |
| DeepInfra         | `DEEPINFRA_API_KEY`                      |
| Cohere            | `COHERE_API_KEY`                         |
| Together AI       | `TOGETHER_API_KEY`, `TOGETHERAI_API_KEY` |
| Perplexity        | `PERPLEXITY_API_KEY`                     |
| Cerebras          | `CEREBRAS_API_KEY`                       |
| Vercel            | `VERCEL_API_KEY`                         |
| MiniMax           | `MINIMAX_API_KEY`                        |
| GLM               | `ZHIPU_API_KEY`                          |
| GLM Coding Plan   | `ZHIPU_API_KEY` (shared with GLM)        |
| Moonshot AI       | `MOONSHOT_API_KEY`                       |
| DeepSeek          | `DEEPSEEK_API_KEY`                       |
| OpenAI Compatible | `OPENAI_COMPATIBLE_API_KEY`              |

## Hot-swap

No restart required when switching providers or models. When you switch, ByteRover broadcasts a `provider:updated` event and agent processes pick up the new configuration at the start of their next task. If tasks are already running, the swap is deferred until all in-flight tasks complete.

Two behaviors depending on what changed:

* **Provider changed** — a new session is created. In-memory conversation history is cleared (history formats are incompatible across providers).
* **Model only changed** — the session ID is reused, but in-memory conversation history is still lost on the new session manager.

## Credential storage

API keys are stored in an **AES-256-GCM encrypted local file** — not your system keychain. Both files use `0600` permissions (owner read/write only).

| File                              | Purpose                                              |
| --------------------------------- | ---------------------------------------------------- |
| `<data-dir>/.provider-keys`       | Random 32-byte encryption key, rotated on each save  |
| `<data-dir>/provider-credentials` | AES-256-GCM encrypted JSON map of provider → API key |

OAuth tokens are stored alongside API keys in the same encrypted storage and are automatically refreshed by the daemon — no manual token management required.

Non-sensitive preferences (active provider, active model, favorites, recent models) are stored in plaintext at `<config-dir>/providers.json`.

Platform-specific paths:

| Platform | `<config-dir>`                              | `<data-dir>`                                   |
| -------- | ------------------------------------------- | ---------------------------------------------- |
| macOS    | `~/Library/Application Support/brv`         | `~/Library/Application Support/brv`            |
| Linux    | `~/.config/brv` (or `$XDG_CONFIG_HOME/brv`) | `~/.local/share/brv` (or `$XDG_DATA_HOME/brv`) |
| Windows  | `%APPDATA%/brv`                             | `%LOCALAPPDATA%/brv`                           |

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Full setup guide including provider configuration
  </Card>

  <Card title="CLI Reference" icon="terminal" href="/reference/cli-reference">
    Complete reference for all `brv providers` and `brv model` commands
  </Card>
</CardGroup>
