Arcane OS Docs Development only

Reference

Arcane.localAI.ensurePlatform()

Runs the Provisioner-only post-install AI reconciliation as one exclusive operation: returns an explicitly selected, configured OpenAI state without touching Ollama, or hardware-admits, ensures, and loads the managed local model according to boot settings. Requires provisioning.manage and the provisioner app type.

  • Reference

This focused page is derived from the mechanically checked full member inventory.

Syntax

Arcane.localAI.ensurePlatform()

Parameters

None

Return value

Promise<LocalAIPlatformResult>

Description

Runs the Provisioner-only post-install AI reconciliation as one exclusive operation: returns an explicitly selected, configured OpenAI state without touching Ollama, or hardware-admits, ensures, and loads the managed local model according to boot settings. Requires provisioning.manage and the provisioner app type.

Overview

Arcane.localAI.ensurePlatform() performs the Provisioner's exclusive post-install AI reconciliation. It verifies the current provider settings, ensures or repairs the selected verified local model when needed, applies resource admission, and optionally loads it. Do not use it as an ordinary app readiness probe; use localAI.status() instead.

Parameters

The method takes no arguments. It snapshots the current AI settings and retries its plan up to three times when they change concurrently.

Return value

Every result includes a completed ArcaneOperation. The OpenAI branch reports local.available: false, reason "openai-selected", a configured fallback, and no local load. The local branch reports the selected model, alias, variant, final compatibility, bounded automatic-candidate failures, no fallback, and the managed load result.

Availability

This is a desktop Core, Provisioner-type method requiring provisioning.manage. It is an exclusive mutation and is not in the Android projection.

Errors and recovery

Provider configuration, verified-model, registry, native-admission, installation, and load failures preserve their stable Arcane codes and resolutions. ARCANE_AI_PROFILE_CHANGED means settings changed during three plans; refresh settings and let the user restart reconciliation. Arcane does not silently select OpenAI after local failure.

Streaming, cancellation, and events

Subscribe before calling if the Provisioner shows progress. The operation emits operation.started, operation.log, operation.progress, operation.completed, or operation.failed data keyed by operation ID. The wrapper uses the long-operation timeout and exposes no signal; Core does not cooperatively cancel this workflow, so page teardown is not rollback.

Example

Run this only in the admitted Provisioner flow after installation succeeds.

document.querySelector('#confirm-local-ai-reconciliation')?.addEventListener(
    'click',
    async function handleConfirmedLocalAIReconciliation() {
        const result = await globalThis.Arcane.localAI.ensurePlatform();
        if (result.local.available) {
            console.info('Local AI is ready:', result.local.model);
        } else {
            console.info('Configured provider:', result.fallback.provider);
        }
    }
);

Reference group

AI and Ollama

Repository and reviewed source access