<ac:layout><ac:layout-section ac:type="single"><ac:layout-cell><p>Reference for configuring the Local AI endpoint, master enable, tool-category bits, and pointing at alternative LLM endpoints (cloud or alternate local).</p><p><ac:link><ri:page ri:content-title="AI Integration" /></ac:link> → <ac:link><ri:page ri:content-title="Local AI" /></ac:link> → Configuration (10.1.5 draft)</p><hr /></ac:layout-cell></ac:layout-section><ac:layout-section ac:type="single"><ac:layout-cell><ac:structured-macro ac:name="info" ac:schema-version="1"><ac:rich-text-body><p><strong>10.1.5 draft.</strong> This page documents Local AI configuration as it ships in FrameworX 10.1.5. Content may change before GA.</p></ac:rich-text-body></ac:structured-macro><h2>Where the configuration lives</h2><p>Local AI reads its full configuration from three columns on the existing <code>SolutionSettings</code> table. No new tables, no new columns — one solution has one Local AI configuration.</p><table><tbody><tr><th><p>Column</p></th><th><p>Type</p></th><th><p>Role</p></th><th><p>Default</p></th></tr><tr><td><p><code>ModelEnabled</code></p></td><td><p>Boolean</p></td><td><p>Master kill-switch for ALL Local AI features in this solution. When <code>false</code>, every <code>ChatRequest</code> action and every <code>TK.AIExecute</code> call short-circuits with <code>status="disabled"</code>.</p></td><td><p><code>false</code> — off until customer opts in</p></td></tr><tr><td><p><code>ModelSettings</code></p></td><td><p>String (JSON blob)</p></td><td><p>Five-key endpoint configuration: <code>URL</code>, <code>Name</code>, <code>Authorization</code>, <code>Headers</code>, <code>Info</code>.</p></td><td><p><code>NULL</code> — defaults apply (local Ollama + <code>qwen2.5:7b-instruct</code>)</p></td></tr><tr><td><p><code>ModelOptions</code></p></td><td><p>Int (bitmask)</p></td><td><p>Master tool-surface bit and per-category tool-enable sub-bits. Same bitmask the AI Runtime Connector reads.</p></td><td><p><code>0</code> — no tools exposed; <code>ChatRequest</code> returns <code>disabled</code> until master bit is set</p></td></tr></tbody></table><h2>Editing in the Designer</h2><p>The Local AI configuration is edited from the <strong>Local AI</strong> tile on the Data Servers page (sibling of the OPC UA, DataHub, MQTT Broker, and MCP for Runtime tiles).</p><ul><li><strong>Enable Local AI</strong> checkbox — toggles <code>ModelEnabled</code>. Master kill-switch.</li><li><strong>Status</strong> indicator — reachability probe against the configured endpoint URL. Cached for 30 seconds.</li><li><strong>Endpoint URL</strong> — read-only display of the resolved URL.</li><li><strong>Settings</strong> link — opens the structured 5-field editor for <code>ModelSettings</code>.</li><li><strong>Model name</strong> — read-only display of the configured <code>Name</code> field.</li></ul><h2>The <code>ModelSettings</code> JSON</h2><p>Five fields, all defensive — an empty/missing/malformed <code>ModelSettings</code> column transparently resolves to defaults. Unknown extra keys are preserved across edit cycles, so future revisions stay forward-compatible.</p><ac:structured-macro ac:name="code" ac:schema-version="1"><ac:parameter ac:name="language">json</ac:parameter><ac:plain-text-body>BODY1</ac:plain-text-body></ac:structured-macro><table><tbody><tr><th><p>Key</p></th><th><p>Default</p></th><th><p>Notes</p></th></tr><tr><td><p><code>URL</code></p></td><td><p><code>http://localhost:11434/v1/chat/completions</code></p></td><td><p>Must speak OpenAI-compatible chat-completions JSON. Local Ollama, LM Studio (in OpenAI mode), vLLM, llama.cpp’s server, or any cloud endpoint that conforms.</p></td></tr><tr><td><p><code>Name</code></p></td><td><p><code>qwen2.5:7b-instruct</code></p></td><td><p>Goes into the POST body’s <code>"model"</code> field. Must match a model the configured endpoint can serve.</p></td></tr><tr><td><p><code>Authorization</code></p></td><td><p><code>None</code></p></td><td><p>Multi-line wire format. Line 1 = scheme (<code>None</code> / <code>BearerToken</code> / <code>BasicAuth</code> / <code>CustomAuth</code>); subsequent lines carry the value. Accepts <code>/secret:<Name></code> tokens for SecuritySecrets resolution. See <em>SecuritySecrets Authentication for Local AI</em>.</p></td></tr><tr><td><p><code>Headers</code></p></td><td><p>empty</p></td><td><p>Multi-line <code>key: value</code> per line. Same format the WebData connector uses for custom HTTP headers. Accepts <code>/secret:<Name></code> tokens.</p></td></tr><tr><td><p><code>Info</code></p></td><td><p>self-documenting block</p></td><td><p>Free-text description visible to anyone editing the configuration. Distinct from <code>SolutionSettings.Description</code>.</p></td></tr></tbody></table><p>The configuration is parsed defensively on every Local AI call — the parse cost is negligible compared with the LLM round-trip, and there is no caching layer to invalidate when the JSON changes.</p><h2>The <code>ModelOptions</code> bitmask</h2><p>An integer column carrying independent enable bits. The bitmask is shared with the AI Runtime Connector and the AI Designer connector — the same bits gate the same tool categories regardless of which transport the LLM uses to call them.</p><table><tbody><tr><th><p>Bit</p></th><th><p>Name</p></th><th><p>Effect when ON</p></th></tr><tr><td><p><code>0x02</code></p></td><td><p><code>EnableRuntimeMCP</code> (master)</p></td><td><p>Master enable for the AI tool surface. Required for the <code>ChatRequest</code> action to call any tools. When OFF, <code>ChatRequest</code> returns <code>status="disabled"</code>. <code>TK.AIExecute</code> is unaffected by this bit (atomic calls have no tools).</p></td></tr><tr><td><p><code>0x04</code></p></td><td><p><code>EnableUnsTools</code></p></td><td><p>The LLM may read tag values, browse the namespace, and search the UNS during a chat turn.</p></td></tr><tr><td><p><code>0x08</code></p></td><td><p><code>EnableAlarmTools</code></p></td><td><p>The LLM may read active alarms and query the alarm history.</p></td></tr><tr><td><p><code>0x10</code></p></td><td><p><code>EnableHistorianTools</code></p></td><td><p>The LLM may query historian time-series data.</p></td></tr><tr><td><p><code>0x20</code></p></td><td><p><code>EnableCustomTools</code></p></td><td><p>The LLM may call solution-authored MCP Tool class methods.</p></td></tr><tr><td><p><code>0x40</code></p></td><td><p><code>EnableDesignerMCP</code></p></td><td><p>Reserved for the AI Designer connector. Do not reuse for Local AI features.</p></td></tr><tr><td><p><code>0x80</code></p></td><td><p><code>EnableChatHistory</code></p></td><td><p>Per-Display-panel transcript cache participates in <code>ChatRequest</code> calls. Default <strong>ON</strong> in new 10.1.5 solutions. <code>TK.AIExecute</code> always bypasses the cache regardless of this bit.</p></td></tr></tbody></table><p>The five tool-category bits (<code>0x04</code>–<code>0x20</code>) are AND-gated against the master bit. A category bit ON without the master bit ON leaves the category effectively OFF.</p><h2>Master gate order</h2><p>Both consumer paths apply the gates in a fixed order:</p><ol><li><strong><code>ModelEnabled</code></strong> — if <code>false</code>, return <code>status="disabled"</code> immediately. No HTTP traffic. <code>latencyMs = 0</code>.</li><li><strong><code>ModelOptions</code> bit <code>0x02</code></strong> — <code>ChatRequest</code> only: if the master tool-surface bit is OFF, return <code>status="disabled"</code>. <code>TK.AIExecute</code> skips this gate (no tools to expose).</li><li><strong>Per-category bits</strong> — <code>ChatRequest</code> only: AND-ed against the master bit when assembling the tool catalog the LLM sees during a chat turn.</li></ol><h2>Pointing at a different LLM endpoint</h2><p>Replace the <code>URL</code> and <code>Name</code> fields. Any OpenAI-compatible chat-completions endpoint works.</p><h3>Local Ollama (default)</h3><ac:structured-macro ac:name="code" ac:schema-version="1"><ac:parameter ac:name="language">json</ac:parameter><ac:plain-text-body>BODY2</ac:plain-text-body></ac:structured-macro><h3>Remote Ollama on a GPU server</h3><ac:structured-macro ac:name="code" ac:schema-version="1"><ac:parameter ac:name="language">json</ac:parameter><ac:plain-text-body>BODY3</ac:plain-text-body></ac:structured-macro><p>The remote Ollama must be started with <code>OLLAMA_HOST=0.0.0.0:11434</code> and the firewall opened on TCP 11434.</p><h3>OpenAI-compatible cloud endpoint with Bearer token</h3><ac:structured-macro ac:name="code" ac:schema-version="1"><ac:parameter ac:name="language">json</ac:parameter><ac:plain-text-body>BODY4</ac:plain-text-body></ac:structured-macro><p>The <code>/secret:CloudLLMApiKey</code> token resolves at call time from the SecuritySecrets vault — the actual API key never appears in the configuration. See <em>SecuritySecrets Authentication for Local AI</em>.</p><h3>Endpoint with extra HTTP headers</h3><p>Some providers require extra request headers (organization ID, project ID, region). Add them via the <code>Headers</code> field, one <code>Key: Value</code> pair per line:</p><ac:structured-macro ac:name="code" ac:schema-version="1"><ac:parameter ac:name="language">json</ac:parameter><ac:plain-text-body>BODY5</ac:plain-text-body></ac:structured-macro><p>Header values also accept <code>/secret:<Name></code> tokens.</p><h2>Configuration safety nets</h2><p>The platform applies several safety nets to prevent silent misconfiguration:</p><ul><li><strong>Defensive defaults.</strong> Empty / null / malformed <code>ModelSettings</code> falls back to the recommended local Ollama defaults. A solution with a corrupted JSON blob still works against the local default.</li><li><strong>Status probe.</strong> The Local AI tile in the Designer probes the resolved URL on a 30-second cache, surfacing a red indicator when the endpoint is unreachable. Use it before deploying.</li><li><strong>Master kill-switch precedes everything.</strong> A solution can be staged with full configuration and shipped with <code>ModelEnabled = false</code>. No LLM traffic flows until the customer toggles it ON.</li><li><strong>Off-server short-circuit.</strong> Secret resolution is a server-side operation. Calls reaching Local AI from a thin-client context cannot resolve secrets and fall through to a normal HTTP error reply — no silent unauthenticated POST.</li></ul><h2>What this page does NOT cover</h2><ul><li><strong>Bringing up Local AI on a fresh machine.</strong> See <ac:link><ri:page ri:content-title="Local AI - First Install Walkthrough (10.1.5 draft)" /></ac:link>.</li><li><strong>SecuritySecrets reference syntax and examples.</strong> See <em>SecuritySecrets Authentication for Local AI</em>.</li><li><strong>Reply envelope shape and status semantics.</strong> See <em>Local AI Reply Envelope Schema</em>.</li><li><strong>The <code>ChatRequest</code> Display action.</strong> See <em>ChatRequest Action Reference</em>.</li><li><strong>The <code>TK.AIExecute</code> script API.</strong> See <em>TK.AIExecute API Reference</em>.</li></ul><hr /><h4><span style="color: rgb(94,108,132);">In this section...</span></h4><p><ac:structured-macro ac:name="pagetree" ac:schema-version="1"><ac:parameter ac:name="root"><ac:link><ri:page ri:content-title="@parent" /></ac:link></ac:parameter></ac:structured-macro></p></ac:layout-cell></ac:layout-section></ac:layout>