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
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
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
LOCAL_AI_BROWSER_ENDPOINTS | variable · value | variable LOCAL_AI_BROWSER_ENDPOINTS | — |
deriveLocalAIRequirements | function | function deriveLocalAIRequirements(preferences) | preferences |
evaluateLocalSpeechHealth | function | function evaluateLocalSpeechHealth(status) | status |
checkLocalAIReadiness | function | async 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_UNAVAILABLELOCAL_AI_READINESS_TIMEOUTLOCAL_AI_HEALTH_HTTP_ERRORLOCAL_AI_HEALTH_INVALID_RESPONSELOCAL_AI_HEALTH_INVALID_RESPONSELOCAL_AI_HEALTH_INVALID_RESPONSELOCAL_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
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);