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

# Mirror models and providers

> Switch Mirror CLI's model and reasoning effort, add models to the picker, and connect other providers or a local endpoint

Mirror uses Reflection and `Beam-501B-A23B` unless you choose otherwise. You can switch models during a session, change how much the model reasons, and point Mirror at another provider or a model you host yourself.

<Note>
  In preview, Mirror CLI is expected to work well with other models, but it hasn't been tested extensively with them. Report problems or feedback with `/feedback`.
</Note>

## Switch models

Run `/model` to open the picker. It lists Reflection, the other supported providers, and any models you've added to [`models.json`](#add-models-to-the-picker). Choosing a provider opens a second list of that provider's models when Mirror can fetch one, or selects its default model otherwise.

You can also name the model or provider directly:

```text theme={null}
/model Beam-501B-A23B
/model reflection
```

The choice applies to the current workspace only. Mirror remembers your choice, so the workspace uses it the next time you open it, and new workspaces start with the model of the workspace you created them from. Run `/status` to check which model is active.

## Set reasoning effort

Reasoning effort controls how much the model thinks before it answers. Higher effort helps with difficult debugging and design work but takes longer. Lower effort is quicker for routine edits.

Run `/reasoning` to choose a level, or pass one directly:

```text theme={null}
/reasoning high
```

The levels are `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`, and Mirror starts at `xhigh`. **Provider default** (`none`) sends no effort setting at all and leaves the choice to the provider. Models don't all support every level; see [reasoning](/reasoning) for Reflection models.

Like the model, each workspace remembers its reasoning effort.

## Choose at launch

To use a particular model or effort for one launch, pass them as flags. They don't change your saved selection:

```bash theme={null}
mirror --model Beam-501B-A23B --reasoning-effort high
```

Without flags, Mirror starts with the first of these that applies:

1. The model you last used in this workspace.
2. The model you last selected anywhere.
3. The first entry in `models.json`.
4. Reflection and `Beam-501B-A23B`.

If you've used another provider and want Reflection again, run `/model reflection`. Mirror remembers it from then on. `mirror --api reflection` selects Reflection for one launch only.

## Use another provider

Mirror works with several model APIs. Each needs its own API key, read from an environment variable. Exporting a key doesn't select the provider; choose it with `/model` or `--api`.

| Provider | `--api` value | API key |
| - | - | - |
| Reflection | `reflection` | `REFLECTION_API_KEY`, or the key saved when you first connected |
| OpenRouter | `openrouter` | `OPENROUTER_API_KEY` |
| OpenAI | `openai-responses` | `OPENAI_API_KEY` |
| Anthropic | `anthropic-messages` | `ANTHROPIC_API_KEY` |
| ChatGPT plan | `openai-codex-responses` | A Codex sign-in. Run `codex login --device-auth` first. |
| Any OpenAI-compatible Chat Completions endpoint | `openai-chat-completions` | `OPENROUTER_API_KEY`, if the endpoint needs one |

For example, to start with Anthropic:

```bash theme={null}
export ANTHROPIC_API_KEY="..."
mirror --api anthropic-messages
```

Passing `--api` without `--model` selects that provider's default model. You can pass a key with `--api-key` instead of an environment variable, but it then appears in your shell history.

### Reflection sign-in

`/login` checks whether Mirror has a Reflection API key and opens the **Connect to Reflection** prompt if it doesn't. `/logout` deletes the key saved in `~/.mirror/reflection_api_key` and, if `REFLECTION_API_KEY` isn't set, opens the prompt again so you can enter a different key. Mirror saves a key you enter without checking it, so use `/logout` to replace a mistyped one. `/logout` doesn't affect `REFLECTION_API_KEY`, which takes precedence over the saved key whenever it's set.

## Use a local or self-hosted model

Point Mirror at any server that implements OpenAI Chat Completions, such as a local inference server, with `--base-url` and the model ID the server expects:

```bash theme={null}
mirror --api openai-chat-completions \
  --base-url http://127.0.0.1:8000/v1 \
  --model your-model-name
```

No API key is needed if the endpoint doesn't require one. If it does, set `OPENROUTER_API_KEY` or pass `--api-key`.

You can also set the endpoint through the environment: `OPENROUTER_BASE_URL` for Chat Completions, `OPENAI_BASE_URL` for OpenAI, and `ANTHROPIC_BASE_URL` for Anthropic.

<Note>
  If `OPENROUTER_BASE_URL` is set and you don't pass `--api`, Mirror uses Chat Completions with that endpoint instead of Reflection. Unset it, or pass `--api reflection`, to use Reflection.
</Note>

The `reflection` provider always uses Reflection's endpoint and doesn't accept another base URL.

## Add models to the picker

To keep models you use often in the `/model` picker, list them in `~/.mirror/models.json`. Each entry needs an `id` (the model ID sent to the provider) and a `label` (the name shown in the picker), and can set a `description`, an `api`, and a `base_url`:

```json theme={null}
[
  {
    "id": "Beam-501B-A23B",
    "label": "Beam",
    "api": "reflection"
  },
  {
    "id": "your-model-name",
    "label": "Local model",
    "description": "Inference server on this machine",
    "api": "openai-chat-completions",
    "base_url": "http://127.0.0.1:8000/v1"
  }
]
```

Selecting an entry applies its provider and endpoint along with the model, and `--api` or `--base-url` on the command line override them. Keep API keys in environment variables, not in this file.

To use a different file, set `MIRROR_MODELS_CONFIG` to its path.

## Long conversations

When a conversation approaches the model's context window, Mirror summarizes older history so the agent can keep working. These launch options adjust that behavior:

| Option | Effect |
| - | - |
| `--context-window <tokens>` | Override the context length Mirror assumes. Use it for a local model whose limit Mirror can't detect. |
| `--compaction-threshold <tokens>` | Summarize history once a prompt reaches this many tokens, instead of at 90% of the context window. |
| `--compaction-model <id>` | Use a different model to write the summaries. |

The settings line shows how much of the context window the conversation uses, and `/context` breaks down the system prompt and tools.
