Capability first · transport second

LocalAIReadiness.js

Derives selected AI requirements and returns a complete readiness/recovery report across browser, desktop, and Android modes.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
On this page

Overview

Derives selected AI requirements and returns a complete readiness/recovery report across browser, desktop, and Android modes.

  • Artifact
    LocalAIReadiness.js · esm
  • Classification
    public first party
  • Availability
    Browser/native hybrid
  • Normalization
    Fully normalized report and stable error codes; browsers never probe Ollama.

Import and lifecycle

JavaScript
import * as module from '/arcane/modules/LocalAIReadiness.js';

Pure helpers have no effects. checkLocalAIReadiness() performs only selected-service probes; native mode may make one recovery attempt and one re-probe. Browser mode never probes Ollama, and Android user-managed-loopback never invokes lifecycle recovery.

Application-facing behavior: Endpoint constant plus requirements, speech-health, and readiness helpers.

Protocol and host implementation

Arcane.localAI, Arcane.speech, complete browser speech health This detail does not widen the application-facing API or grant authority.

Exports, signatures, parameters, and results

BindingFormDeclaration or signatureParameter syntax
LOCAL_AI_BROWSER_ENDPOINTSvariable · valuevariable LOCAL_AI_BROWSER_ENDPOINTS
deriveLocalAIRequirementsfunctionfunction deriveLocalAIRequirements(preferences)preferences
evaluateLocalSpeechHealthfunctionfunction evaluateLocalSpeechHealth(status)status
checkLocalAIReadinessfunctionasync function checkLocalAIReadiness({ preferences, runtime, arcane=globalThis.Arcane, fetchImpl=globalThis.fetch, recover, timeoutMs }={}){ preferences, runtime, arcane=globalThis.Arcane, fetchImpl=globalThis.fetch, recover, timeoutMs }={}

Parameter meanings and results

LOCAL_AI_BROWSER_ENDPOINTS exposes the speech-health URL. deriveLocalAIRequirements(exact six-string tuple [llmProvider,sttProvider,ttsProvider,llmModel,ttsModel,sttModel]) returns complete llm/stt/tts requirements. evaluateLocalSpeechHealth(status) returns complete role health. checkLocalAIReadiness({preferences,runtime?,arcane?,fetchImpl?,recover?,timeoutMs?}) resolves complete {ready,mode,requirements,slots,services,unavailableSlots,recovery,guidance}.

Events, side effects, and errors

Source-literal CustomEvent dispatches

No source-literal CustomEvent dispatch is part of this artifact.

Lifecycle and event flow

This artifact has no additional documented lifecycle event flow.

Direct coded failures

  • BROWSER_FETCH_UNAVAILABLE
  • LOCAL_AI_READINESS_TIMEOUT
  • LOCAL_AI_HEALTH_HTTP_ERROR
  • LOCAL_AI_HEALTH_INVALID_RESPONSE
  • LOCAL_AI_HEALTH_INVALID_RESPONSE
  • LOCAL_AI_HEALTH_INVALID_RESPONSE
  • LOCAL_AI_HEALTH_INVALID_RESPONSE

Exported Error subclasses

This artifact exports no Error subclass.

Documented failure behavior

  • TypeError or RangeError for invalid tuple/runtime/recover/timeout.
  • Probe failures normally become complete slot/service errorCode fields, including LOCAL_AI_READINESS_TIMEOUT.

Availability and capabilities

Browser/native hybrid. Fully normalized report and stable error codes; browsers never probe Ollama.

Native localai.status, localai.services.recover, and speech.status use ai.inference; recovery is Boss/Precrisis-only and privileged. Browser mode uses no Core authority.

Contract example

JavaScript
import {checkLocalAIReadiness} from '/arcane/modules/LocalAIReadiness.js';

const report = await checkLocalAIReadiness({
    preferences:[
        'TWIN','LOCAL_SPEACH','LOCAL_SPEACH','openai-gpt-oss-120b',
        'kokoro','whisper-small'
    ],
    runtime:'browser'
});
console.log(report.ready, report.slots);