> For the complete documentation index, see [llms.txt](https://docs.tabnine.com/main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tabnine.com/main/getting-started/tabnine-cli/features/model-selection.md).

# Model Selection

{% hint style="warning" %}
**Tabnine CLI is in maintenance mode.** As of 6.6, we have stopped active development. It will receive only critical updates through December 31, 2026. After that, we will fully deprecate it. We are transitioning CLI users to [Tabnine Plugin for OpenCode](/main/getting-started/tabnine-plugin-for-opencode.md).
{% endhint %}

Choose which AI model powers your Tabnine CLI interactions.

### Opening the Model Dialog

```bash
/model
```

This opens an interactive dialog showing available models.

### Available Models

Tabnine CLI uses the same models described on the [AI Models](/main/welcome/readme/ai-models.md) page.

### Changing Models

#### Via `/model` Command

{% stepper %}
{% step %}
**Open the model dialog**

Run:

```bash
/model
```

This opens the interactive model selection dialog.
{% endstep %}

{% step %}
**Navigate**

Use the arrow keys or `J` / `K` to move through available models.
{% endstep %}

{% step %}
**Select**

Press `Enter` to select the highlighted model.
{% endstep %}

{% step %}
**Immediate effect**

Model changes take effect immediately after selection.
{% endstep %}
{% endstepper %}

#### Via `/model set` (Non-Interactive)

You can also change the model without opening the dialog:

```bash
/model set <model-name>
```

This sets the model for the current session only. To persist the change across sessions, add the `--persist` flag:

```bash
/model set <model-name> --persist
```

#### Via `--model` Flag

Specify the model when launching Tabnine CLI:

```bash
tabnine --model <model-name>
```

The `-m` short form also works:

```bash
tabnine -m <model-name>
```

#### Via Environment Variable

Set the `TABNINE_MODEL` environment variable before launching:

```bash
TABNINE_MODEL=<model-name> tabnine
```

### Model Selection Precedence

When multiple sources specify a model, the following precedence applies (highest to lowest):

1. `--model` command-line flag (or `-m`)
2. `TABNINE_MODEL` environment variable
3. `model.name` in `settings.json`
4. Default model from Tabnine service

### Model Information

View current session statistics (including token usage):

```bash
/stats
```

View current model and context usage in the footer (shown if enabled in settings).

#### Token Limits

Tabnine CLI automatically manages token limits based on the selected model.

### Fallback Behavior

If your selected model is unavailable, Tabnine CLI may:

1. Prompt you to select another model
2. Automatically fall back to a default model (depending on settings)

### Model Persistence

Your model selection is saved and persists across sessions when using:

* `/model set <model-name> --persist` — writes `model.name` to `settings.json`
* The interactive `/model` dialog — persists your selection automatically

Persistent selections are stored in `.tabnine/agent/settings.json`.

### Fast Model Configuration

You can configure a lightweight model to handle background CLI tasks, reducing latency for operations the user never directly sees. To configure a fast model, add `"fastModel": "<model-name>"` to your `settings.json` or use the `/model fast` slash command in the CLI.

The following tasks are routed to the fast model when one is configured:

* Session summary
* Shell output summary
* Tool output summary
* Edit corrector
* Fast ack helper
* Loop detection (primary pass)
* LLM edit fixer

Loop detection double-check and next-speaker checker remain on the main model, as they require higher-confidence reasoning. When no fast model is configured, all tasks use the main model. The fast model setting is provider-agnostic and works with any model the backend supports.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tabnine.com/main/getting-started/tabnine-cli/features/model-selection.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
