# Reference: server.ai

URL: https://scalws.com/docs/reference/server-ai/
Source: `docs/reference/schema` in the ScalWS repository

<h3 id="server.ai.allow_remote"><code>server.ai.allow_remote</code></h3>

| | |
|---|---|
| Syntax | `allow_remote: true \| false` |
| Default | `false` |
| Context | `server.ai` |
| Reload | needs a restart |

Allow a non-loopback endpoint (telemetry leaves the host).


<h3 id="server.ai.api_key_env"><code>server.ai.api_key_env</code></h3>

| | |
|---|---|
| Syntax | `api_key_env: <string>` |
| Default | `none` |
| Context | `server.ai` |
| Reload | needs a restart |

Environment variable holding an API key, if the endpoint needs one.


<h3 id="server.ai.ca_bundle"><code>server.ai.ca_bundle</code></h3>

| | |
|---|---|
| Syntax | `ca_bundle: <string>` |
| Default | `none` |
| Context | `server.ai` |
| Reload | needs a restart |

Extra CA (PEM) trusted for an `https://` endpoint, besides the system roots.


<h3 id="server.ai.enabled"><code>server.ai.enabled</code></h3>

| | |
|---|---|
| Syntax | `enabled: true \| false` |
| Default | `false` |
| Context | `server.ai` |
| Reload | needs a restart |

Turn the AI advisor on.


<h3 id="server.ai.endpoint"><code>server.ai.endpoint</code></h3>

| | |
|---|---|
| Syntax | `endpoint: <string>` |
| Default | `http://127.0.0.1:8080/v1/chat/completions` |
| Context | `server.ai` |
| Reload | needs a restart |

OpenAI-compatible chat-completions URL, `http://` or `https://` (`ca_bundle` for a private CA).


<h3 id="server.ai.max_queue"><code>server.ai.max_queue</code></h3>

| | |
|---|---|
| Syntax | `max_queue: <integer>` |
| Default | `4` |
| Context | `server.ai` |
| Reload | needs a restart |

Pending requests; more are refused.


<h3 id="server.ai.max_tokens"><code>server.ai.max_tokens</code></h3>

| | |
|---|---|
| Syntax | `max_tokens: <integer>` |
| Default | `800` |
| Context | `server.ai` |
| Reload | needs a restart |

Maximum length of one answer, in tokens.


<h3 id="server.ai.min_interval"><code>server.ai.min_interval</code></h3>

| | |
|---|---|
| Syntax | `min_interval: <duration> (e.g. 30s)` |
| Default | `600s` |
| Context | `server.ai` |
| Reload | needs a restart |

Minimum time between automatic requests for one application.


<h3 id="server.ai.model"><code>server.ai.model</code></h3>

| | |
|---|---|
| Syntax | `model: <string>` |
| Default | `` |
| Context | `server.ai` |
| Reload | needs a restart |

Model name as the endpoint knows it; chosen by the operator.


<h3 id="server.ai.timeout"><code>server.ai.timeout</code></h3>

| | |
|---|---|
| Syntax | `timeout: <duration> (e.g. 30s)` |
| Default | `60s` |
| Context | `server.ai` |
| Reload | needs a restart |

Time limit for one request to the model endpoint.
