On this page
Overview
Inspects one exact model and runs one isolated question while preserving complete results.
- Artifact
IsolatedModelQuestionRunner.js· esm - Classification
public first party - Availability
Native bridge or injected provider - Normalization
Complete inspection/question forwarding, complete provider results, informative sentence counts, and coded malformed-result errors are normalized.
Import and lifecycle
import * as module from '/arcane/modules/IsolatedModelQuestionRunner.js';
Construction only validates and binds an injected localAI bridge. inspectModel() and runQuestion() make one Core call each; onPhase is forwarded only for that operation and the runner retains no listener.
Application-facing behavior: default/named runner, countSentences(), inspectModel(), runQuestion().
Protocol and host implementation
localAI isolated-model methods This detail does not widen the application-facing API or grant authority.
Exports, signatures, parameters, and results
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
IsolatedModelQuestionRunner | class | class IsolatedModelQuestionRunner | — |
countSentences | function | function countSentences(value) | value |
default | default · class | class IsolatedModelQuestionRunner | — |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
countSentences | exported-function | function countSentences(value) | value |
IsolatedModelQuestionRunner.inspectModel | public-member | async inspectModel(model,expectedModel,contextTokens) | model,expectedModel,contextTokens |
IsolatedModelQuestionRunner.runQuestion | public-member | async runQuestion(input={}) | input={} |
| Member | Kind | Exact public declaration | Parameter syntax |
|---|---|---|---|
IsolatedModelQuestionRunner.constructor | constructor | constructor({localAI}={}) | {localAI}={} |
IsolatedModelQuestionRunner.inspectModel | async method | async inspectModel(model,expectedModel,contextTokens) | model,expectedModel,contextTokens |
IsolatedModelQuestionRunner.runQuestion | async method | async runQuestion(input={}) | input={} |
Parameter meanings and results
countSentences(string) returns an informative punctuation-group count without limiting the answer. new Runner({localAI}) binds the selected bridge; inspectModel(model,expectedModel?,contextTokens?) forwards the complete request and accepts any positive context value. runQuestion() accepts {model,prompt,systemPrompt?,options?,expectedModel?,think?,onPhase?}, preserves the complete provider result, and adds sentenceCount.
Events, side effects, and errors
Source-literal CustomEvent dispatches
No source-literal CustomEvent dispatch is part of this artifact.
Lifecycle and event flow
- Optional onPhase(phase,event) callback from the Core operation.
Direct coded failures
This artifact directly assigns no stable coded failure.
Exported Error subclasses
This artifact exports no Error subclass.
Documented failure behavior
- INVALID_ISOLATED_MODEL_RUNNER_REQUEST
- ARCANE_ISOLATED_MODEL_API_UNAVAILABLE
- ARCANE_ISOLATED_MODEL_RESPONSE_INVALID
- TypeError for non-string countSentences().
- Underlying Core rejection is preserved.
Availability and capabilities
Native bridge or injected provider. Complete inspection/question forwarding, complete provider results, informative sentence counts, and coded malformed-result errors are normalized.
Core-only ai.inference; bound to Kempo. Question execution is exclusive, and Core cleanup remains owned by the bridge.
Contract example
import Runner from '/arcane/modules/IsolatedModelQuestionRunner.js';
async function ask({model, expectedModel, prompt, onPhase}) {
const runner = new Runner({localAI:Arcane.localAI});
await runner.inspectModel(model, expectedModel, 8192);
return runner.runQuestion({
model,
expectedModel,
prompt,
systemPrompt:'Answer only the supplied question.',
options:{num_ctx:8192, temperature:0.2},
onPhase
});
}