# Manage AI language models

AI models power neural **grammar correction (GEC)** and **text autocomplete**. You can install them during setup or turn them on/off later.

### GEC models: behavior and trade-offs

GEC models generate suggestions from context, not from deterministic rules.

Common trade-offs:

* Output can change after small edits in the sentence.
* Suggestions don’t map to stable “rule IDs”.
  * You can’t reliably ignore “one rule”.
* Dialect nuances are not guaranteed.
  * A single model can be used across dialects.
* Suggestion “types” are imperfect.
  * The UI may classify an AI suggestion as spelling or grammar heuristically.
* AI uses more CPU/RAM and can add latency.
  * Check [Hardware requirements](/v6.12.0/deployment/installation-requirements/hardware-requirements.md).

Try the behavior in a public [demo](https://demos.webspellchecker.com/).

### Available AI models

| Model                | Version | Downloaded by default |
| -------------------- | ------- | --------------------- |
| English GEC          | v2.5.0  | Yes                   |
| English Autocomplete | v1.0.0  | Yes                   |
| German GEC           | v1.0.0  | No                    |
| Spanish GEC          | v3.0.0  | No                    |

### Install / download models

AI model selection is part of the installation flow. Follow the OS-specific guides for the exact step.

* Linux: [Automated installation on Linux](/v6.12.0/deployment/installation/linux/automated-installation-on-linux.md) (`ai_models`)
* Windows: [Install on Windows with IIS](/v6.12.0/deployment/installation/windows/install-on-windows-with-iis.md) (AI models step)

If the server has no outbound internet during installation, install resources from an offline package.

Use: [Manually downloading resources (offline installation)](/v6.12.0/deployment/installation/manually-downloading-resources-offline-installation.md)

### Verify model files are present

AppServer loads model configs from:

* `AppServer/grammar/neural/<lang>/`
* `AppServer/autocomplete/neural/<lang>/`

If a model is missing, you’ll see errors like:

```
Failed to load config for model 'en'. The model is disabled until the application is restarted. Failed to open AI config file: '<Installation_path>/AppServer/grammar/neural/en/config.json'. Reason: file doesn't exist.
```

See fixes and more log examples in: [Troubleshooting AI model downloads and configuration](/v6.12.0/deployment/configuration/ai-engine-setup/troubleshooting-ai-model-downloads-and-configuration.md)

### Enable or disable AI after installation

There are two controls in `AppServerX.xml`:

1. `<AIModels>` controls what models AppServer can load.
2. `<Language ...>` config controls where models are used.

You should update **both**:

* Disable AI **usage** in `<Language ...>` (check kits + autocomplete).
* Disable the AI **model** in `<AIModels>`.

If you break that dependency, you may see: `Unknown AI model id 'en'.`

#### Safest way to disable AI (without breaking languages)

{% stepper %}
{% step %}

#### Back up your configuration

Create a copy of `AppServerX.xml` before changes.
{% endstep %}

{% step %}

#### Disable AI usage in language config

For each affected `<Language ...>` in `AppServerX.xml`:

* Disable all enabled check kits that include AI.
  * Typical marker: `<Neural Enabled="true" .../>`
* Make a non-AI check kit the default.
  * Example: `lt_hs`

To disable autocomplete, disable the `<Autocomplete ...>` block:

```xml
<Autocomplete Enabled="false">
  <Locale>en</Locale>
</Autocomplete>
```

{% endstep %}

{% step %}

#### Disable the model in `<AIModels>`

Set `Enabled="false"` for every AI model you want to disable.

This step is required. Language config changes alone can still leave AI models enabled and warming up.

If you also want to free disk space, remove model directories after restart and verification.
{% endstep %}

{% step %}

#### Restart AppServer and check logs

Restart AppServer to apply changes in `AppServerX.xml`.

To restart: [stop](https://docs.wproofreader.com/v6.12.0/deployment/configuration/ai-engine-setup/pages/IA2KNQLXDh85TwDivL4y#mainappservercommands-stopappserverwindowslinux2.stopappserver) the application, then [start](https://docs.wproofreader.com/v6.12.0/deployment/configuration/ai-engine-setup/pages/IA2KNQLXDh85TwDivL4y#mainappservercommands-startappserverwindowslinux1.startappserver) it again.

Use [Main AppServer commands](/v6.12.0/deployment/configuration/application-server/main-appserver-commands.md).

Verify the model is disabled using [status API](/v6.12.0/api-reference/auxiliary-api-commands/status-api.md).

Confirm logs have no AI-related errors.
{% endstep %}
{% endstepper %}

<details>

<summary>Example: AIModels section in AppServerX.xml</summary>

```xml
<AIModels>
	<Model Enabled="true" Lang="en" ModelName="en" Type="grammar" WarmUpId="en_US" SessionsNumber="1" ProbabilityThreshold="0.808" AligningLemmasFilePath="en/en_lemmatization_lookup.txt"/>
	<Model Enabled="false" Lang="de" ModelName="de" Type="grammar" WarmUpId="de_DE" SessionsNumber="1"/>
	<Model Enabled="false" Lang="es" ModelName="de_es" Type="grammar" WarmUpId="es_ES" SessionsNumber="1"/>
	<Model Enabled="true" Lang="en" ModelName="en" Type="autocomplete" WarmUpId="en_US" ProbabilityThreshold="0.15" MaxInputSize="200" SessionsNumber="1"/>
</AIModels>
```

{% hint style="warning" %}
Disable a model in `<AIModels>` only after you disabled all usages in `<Language ...>`. Otherwise AppServer can fail requests with encoder/config errors.
{% endhint %}

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wproofreader.com/v6.12.0/deployment/configuration/ai-engine-setup/manage-ai-language-models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
