Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,18 @@ Models must support **tool calling** (also called function calling) and **stream
## Configuring your provider

You configure your model provider by setting environment variables before starting {% data variables.copilot.copilot_cli_short %}.

| Environment variable | Required | Description |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change removed the blank line between the intro sentence and the table. Markdown tables need a blank line before them to render as a table — without it the table row may be absorbed into the preceding paragraph. Please restore the blank line here:

You configure your model provider by setting environment variables before starting {% data variables.copilot.copilot_cli_short %}.

| Environment variable | Required | Description |

|---|---|---|
| `COPILOT_PROVIDER_BASE_URL` | Yes | The base URL of your model provider's API endpoint. |
| `COPILOT_PROVIDER_TYPE` | No | The provider type: `openai` (default), `azure`, or `anthropic`. |
| `COPILOT_PROVIDER_API_KEY` | No | Your API key for the provider. Not required for providers that do not use authentication, such as a local Ollama instance. |
| `COPILOT_PROVIDER_BEARER_TOKEN` | No | Bearer token used for provider authentication when API-key authentication is not used. |
| `COPILOT_PROVIDER_WIRE_API` | No | Specifies the API protocol used when communicating with the provider. |
| `COPILOT_PROVIDER_AZURE_API_VERSION` | Azure only | The Azure OpenAI API version used for requests. |
| `COPILOT_PROVIDER_MODEL_ID` | Azure only | The Azure OpenAI deployment name used to route requests. |
| `COPILOT_PROVIDER_WIRE_MODEL` | Azure only | The underlying model name associated with the deployment. |
Comment on lines +54 to +55

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The descriptions for these two variables appear to be swapped relative to how the CLI actually uses them.

In the runtime, COPILOT_PROVIDER_WIRE_MODEL is the model name sent on the wire to the provider — for Azure this becomes the value in the /deployments/{model} path, i.e. the deployment name that routes the request. COPILOT_PROVIDER_MODEL_ID is the well-known model ID used to select model capabilities and token limits (both default to COPILOT_MODEL).

The CLI's own --help text describes them as:

  • COPILOT_PROVIDER_MODEL_ID: "well-known model ID used for agent configuration and token limits. Defaults to COPILOT_MODEL."
  • COPILOT_PROVIDER_WIRE_MODEL: "model name sent to the provider API for inference. Defaults to COPILOT_MODEL."

So the descriptions should be flipped:

  • COPILOT_PROVIDER_MODEL_ID → the well-known model name used to identify capabilities/token limits (e.g. gpt-4o).
  • COPILOT_PROVIDER_WIRE_MODEL → the Azure deployment name that requests are routed through.

Minor: these two variables aren't strictly "Azure only" — they apply to any BYOK provider (they default to COPILOT_MODEL), though they're most relevant for Azure where the deployment name differs from the model name. Consider "No" with an Azure note, or keeping "Azure only" if that's the intended scope for the article.

| `COPILOT_PROVIDER_MAX_PROMPT_TOKENS` | No | Maximum number of prompt tokens allowed in a request. |
| `COPILOT_PROVIDER_MAX_OUTPUT_TOKENS` | No | Maximum number of tokens generated in a response. |
| `COPILOT_MODEL` | Yes | The model identifier to use. You can also set this with the `--model` command-line flag. |

## Connecting to an OpenAI-compatible endpoint
Expand Down Expand Up @@ -81,17 +87,28 @@ Use the following steps if you are connecting to OpenAI, Ollama, vLLM, Foundry L
1. Set the environment variables for Azure OpenAI.

```shell
export COPILOT_PROVIDER_BASE_URL=https://YOUR-RESOURCE-NAME.openai.azure.com/openai/deployments/YOUR-DEPLOYMENT-NAME
export COPILOT_PROVIDER_BASE_URL=https://YOUR-RESOURCE-NAME.openai.azure.com
export COPILOT_PROVIDER_TYPE=azure
export COPILOT_PROVIDER_API_KEY=YOUR-AZURE-API-KEY
export COPILOT_PROVIDER_AZURE_API_VERSION=YOUR-AZURE-API-VERSION
export COPILOT_PROVIDER_MODEL_ID=YOUR-DEPLOYMENT-NAME
export COPILOT_PROVIDER_WIRE_MODEL=YOUR-MODEL-NAME
Comment on lines +94 to +95

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same swap as in the table above — these two values are reversed. Based on the runtime behavior, COPILOT_PROVIDER_WIRE_MODEL is what routes the Azure request (the deployment name), and COPILOT_PROVIDER_MODEL_ID is the well-known model identity used for capabilities/token limits. So this example should be:

export COPILOT_PROVIDER_MODEL_ID=YOUR-MODEL-NAME
export COPILOT_PROVIDER_WIRE_MODEL=YOUR-DEPLOYMENT-NAME

And correspondingly COPILOT_MODEL=YOUR-DEPLOYMENT-NAME — please double-check the intended value here too, since COPILOT_MODEL is the model identifier the CLI resolves against and both MODEL_ID/WIRE_MODEL fall back to it. The placeholder descriptions below (YOUR-DEPLOYMENT-NAME / YOUR-MODEL-NAME) will need to line up with whichever assignment they belong to once the swap is fixed.

export COPILOT_MODEL=YOUR-DEPLOYMENT-NAME
```

Replace the following placeholders:

* `YOUR-RESOURCE-NAME`: your Azure OpenAI resource name
* `YOUR-DEPLOYMENT-NAME`: the name of your model deployment
* `YOUR-AZURE-API-KEY`: your Azure OpenAI API key
* `YOUR-RESOURCE-NAME`: your Azure OpenAI resource name
* `YOUR-DEPLOYMENT-NAME`: the deployment name that receives requests
* `YOUR-MODEL-NAME`: the underlying model associated with the deployment (for example, `gpt-4o`)
* `YOUR-AZURE-API-VERSION`: the Azure OpenAI API version
* `YOUR-AZURE-API-KEY`: your Azure OpenAI API key
### Azure-specific environment variables

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no blank line between the placeholder bullet list above and this ### heading, so it will not render as a heading (it will be treated as part of the preceding list/paragraph). Please add a blank line before it:

    * `YOUR-AZURE-API-KEY`: your Azure OpenAI API key

### Azure-specific environment variables

Also, once the MODEL_ID / WIRE_MODEL descriptions are corrected, note that this subsection largely repeats the two rows now added to the main table above — consider whether both are needed, or keep just one to avoid the descriptions drifting out of sync.


| Variable | Description |
|---|---|
| `COPILOT_PROVIDER_MODEL_ID` | The Azure OpenAI deployment name. Azure OpenAI routes requests through deployments rather than directly through model names. |
| `COPILOT_PROVIDER_WIRE_MODEL` | The underlying model name associated with the deployment. This allows {% data variables.copilot.copilot_cli_short %} to identify model capabilities while Azure routes requests through the deployment specified by `COPILOT_PROVIDER_MODEL_ID`. |

{% data reusables.copilot.copilot-cli.start-cli %}

Expand Down Expand Up @@ -126,3 +143,4 @@ You can run {% data variables.copilot.copilot_cli_short %} in offline mode to pr
```

1. {% data reusables.copilot.copilot-cli.start-cli %}

Loading