On this page
Overview
Applies and reads non-persistent per-user AI preference overrides.
- Artifact
AIPreferenceRuntime.js· esm - Classification
public first party - Availability
Cross-host - Normalization
Normalized six-slot preference state.
Import and lifecycle
import * as module from '/arcane/modules/AIPreferenceRuntime.js';
Stores an optional six-slot override in a WeakMap keyed by the user object; it never persists or mutates the user entity.
Application-facing behavior: setAIPreferenceRuntimeOverride(), getAIPreferencesForRuntime().
Protocol and host implementation
In-process only This detail does not widen the application-facing API or grant authority.
Exports, signatures, parameters, and results
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
setAIPreferenceRuntimeOverride | function | function setAIPreferenceRuntimeOverride(user,preferences) | user,preferences |
getAIPreferencesForRuntime | function | function getAIPreferencesForRuntime(user) | user |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
setAIPreferenceRuntimeOverride | exported-function | function setAIPreferenceRuntimeOverride(user,preferences) | user,preferences |
getAIPreferencesForRuntime | exported-function | function getAIPreferencesForRuntime(user) | user |
Parameter meanings and results
setAIPreferenceRuntimeOverride(user, tupleOrNull) freezes and returns a six-entry snapshot or removes it. getAIPreferencesForRuntime(user) returns the override or user.preferredModels.
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
This artifact directly assigns no stable coded failure.
Exported Error subclasses
This artifact exports no Error subclass.
Documented failure behavior
- TypeError for a missing owner or a non-six-entry tuple
Availability and capabilities
Cross-host. Normalized six-slot preference state.
Feeds runtime provider and model selection without choosing or admitting a Core model.
Contract example
import {setAIPreferenceRuntimeOverride, getAIPreferencesForRuntime} from '/arcane/modules/AIPreferenceRuntime.js';
const user={
preferredModels:[
'TWIN','LOCAL_SPEACH','LOCAL_SPEACH',
'openai-gpt-oss-120b','kokoro','whisper-small'
]
};
setAIPreferenceRuntimeOverride(user,[
'OLLAMA','LOCAL_SPEACH','LOCAL_SPEACH','llama3.2:latest','local','local'
]);
console.log(getAIPreferencesForRuntime(user));
Related reference
No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.