# AI configuration reference

## AI configuration at a glance

AI configuration is the set of settings used by the AI documentation engine.
An AI provider is the service you choose for AI operations. Use AI configuration to adjust how AI
responses are generated.
**AI Configuration** is the administration area for these settings.

| If you need to… | Go to… |
| --- | --- |
| Open the settings surface and identify its areas | [Open AI settings](#open-ai-settings) |
| Choose or test the provider used for AI operations | [Choose and test an AI provider](#choose-and-test-an-ai-provider) |
   | Change response length, randomness, streaming, or automatic saving | [Adjust advanced AI settings](#adjust-advanced-ai-settings) |
| Follow the complete configuration procedure | [Configure AI](doc:configure-ai) |
| Understand the wider AI workspace | [AI Configuration overview](doc:ai-configuration-overview) |

## Before you start

The AI settings surface uses the providers returned for your environment and stores settings in
your browser.

**Prerequisites**

- Have a valid `.json` settings file ready if you plan to import settings.
- If you plan to restore settings, use a file that your browser can read.
- If you plan to change settings, note that the current values are read from the browser's
  stored settings when they are available.

When no stored settings exist, the default settings are `azure-claude`, `2000` maximum tokens,
`0.7` temperature, streaming enabled, and automatic saving enabled.

| Before you act | What it affects |
| --- | --- |
| A provider returned for your environment | The provider choices shown in the provider area |
| Provider availability | Whether **Test Connection** can be selected |
| Browser storage | Where changed settings are saved |
| A readable `.json` file | Whether **Import Settings** can read settings |

## Open AI settings

The AI settings page is the administration surface where provider, usage, request history, and
advanced settings areas are selected.

**Prerequisites**

- Open AI settings from the administration navigation.

**Steps**

1. Open AI settings from the administration navigation.
2. Select the area that matches the work you need to do.

   | If you need to… | Select… |
   | --- | --- |
   | Choose or test a provider | **Providers** |
   | Review current-month AI usage | **Usage** |
   | Review request history | **History** |
   | Change advanced settings | **Settings** |

**Result:** The selected settings area is displayed.

If the route displays `404`, the AI settings surface has not opened.

## Understand the settings surface

The settings surface groups provider choices separately from advanced response and storage
controls.

| Area | What it contains |
| --- | --- |
| **Providers** | One provider radio control for each provider returned by the environment, its display name, availability status, and **Test Connection** |
| **Settings** | **Max Tokens**, **Temperature**, **Enable Streaming**, **Auto-Save Settings**, **Export Settings**, **Import Settings**, and **Reset to Defaults** |
| **Usage** | Current-month AI usage when that area is selected |
| **History** | AI request history when that area is selected |

The provider area appears when **Providers** is selected. The advanced settings area appears when
**Settings** is selected. The page has no separate save button for advanced settings; each change
is saved to browser storage.

The settings surface has no Prompts area. The available settings areas are **Providers**, **Usage**,
**History**, and **Settings**.

Select **Providers** to choose a provider, or select **Settings** to adjust advanced AI settings.

## Choose and test an AI provider

Use the provider area to make one returned provider the default and to test an available provider.

**Prerequisites**

- Open the **Providers** area.
- At least one provider is returned for your environment if you want to select a provider.

**Steps**

1. Review the provider names and status shown in the provider cards.

   | Provider display name | Status or action shown with it |
   | --- | --- |
   | `Azure Claude (Anthropic)` | `● Available` or `● Unavailable`; **Test Connection** |
   | `Azure OpenAI` | `● Available` or `● Unavailable`; **Test Connection** |
   | `Claude` | `● Available` or `● Unavailable`; **Test Connection** |
   | `OpenAI` | `● Available` or `● Unavailable`; **Test Connection** |

2. Select the radio control beside the provider you want to use as the default.
3. Select **Test Connection** for an available provider.

   The control reads `Testing...` while the test is running. A successful test displays
   `✓ Test Passed`; an unsuccessful test displays `✗ Test Failed`.

**Result:** The selected provider is the default for AI operations, and the provider card shows
the connection-test result when a test has been run.

If no providers are returned, the provider area displays `No AI providers configured.` and
`Please configure your environment variables.`

## Adjust advanced AI settings

Advanced AI settings control response length, response randomness, streaming, automatic saving,
and local backup and restore actions.

**Prerequisites**

- Open the **Settings** area.
- Have a readable `.json` settings file ready before importing settings.

**Steps**

1. Set **Max Tokens** with the range control.

   The permitted range is `100` to `4000`, in increments of `100`. Higher values allow longer
   responses but may cost more.

2. Set **Temperature** with the range control.

   The permitted range is `0` to `1`, in increments of `0.1`. Lower values are more deterministic;
   higher values are more creative.

3. Select or clear **Enable Streaming**.

   This controls whether AI responses stream in real time.

4. Select or clear **Auto-Save Settings**.

   This controls whether settings changes are saved automatically to local storage.

5. Choose the backup action that matches your goal.

   | If you need to… | Select… |
   | --- | --- |
   | Save the current settings to a file | **Export Settings** |
   | Load settings from a JSON file | **Import Settings**, then choose the `.json` file in the file chooser |
   | Replace the current settings with the default settings | **Reset to Defaults**, then confirm `azure-claude`, `2000` maximum tokens, `0.7` temperature, streaming enabled, and automatic saving enabled |

**Result:** The selected advanced values are applied, or the settings are exported, imported, or
reset according to the action you selected.

## Handle provider and settings branches

The provider and settings areas change their available path according to the returned provider
list, provider availability, and the action you choose.

**Steps**

1. Choose the path that matches what is on screen.

   | If you see… | Follow this path |
   | --- | --- |
   | `No AI providers configured.` | Configure the environment before selecting a provider. |
   | `● Unavailable` | Select an available provider; **Test Connection** is disabled for the unavailable provider. |
   | `Testing...` | Wait for the test result before interpreting the provider status. |
   | **Import Settings** | Choose a `.json` file when the file chooser opens. |
   | **Reset to Defaults** | Use the default settings listed in [Adjust advanced AI settings](#adjust-advanced-ai-settings). |

**Result:** You follow the branch that matches the provider or settings state shown on screen.

## Handle configuration problems

Configuration problems are shown at the point where provider loading, connection testing, or
settings-file handling stops the action.

When provider loading fails, the page displays `AI settings failed to load.` followed by the provider
error message.

| What you see | What it means | What to do |
| --- | --- | --- |
| `AI settings failed to load.` followed by the provider error message | The provider-loading error state replaced the settings page content. | Read the provider error text that follows the message. |
| `✗ Test Failed` | The provider connection test did not pass. | Review the provider's availability before trying the connection test again. |
| A message beginning `Failed to import settings:` appears. | The import action returned an error. | Check the file and try **Import Settings** again. |
| `Invalid settings file` | The selected file could not be parsed as settings. | Select a valid `.json` settings file. |
| `Failed to read file` | The file reader could not read the selected file. | Select a readable `.json` settings file. |
| `404` | The AI settings route did not open the settings surface. | Open AI settings from the administration navigation. |

**Result:** The message identifies whether the problem occurred while loading providers, testing a
provider, importing a file, or reaching the settings route.

## What to do next

After you understand the provider and advanced settings, use the configuration procedure for the
ordered setup task or return to the overview for the wider AI workspace context.

- Continue with [Configure AI](doc:configure-ai) to change the settings in order.
- Read [AI Configuration overview](doc:ai-configuration-overview) for the wider AI configuration
  and workspace context.
- Support-agent chat and agent-management controls belong to the separate support-agent surfaces.

The settings note is titled `Settings Storage`. It states that settings are stored locally in the
browser, persist across sessions, and do not sync across devices unless you export and import them
manually.
