IndeRunApi
Methods
Section titled “Methods”checkCapabilities()
Section titled “checkCapabilities()”checkCapabilities():
Promise<ProviderCapabilitySnapshot[]>
Returns a live snapshot of every registered provider’s static descriptor and current dynamic availability, without executing a task or producing any side effects. Call this before run() when you need to show which providers/models are currently available — for example a settings screen or provider picker. Availability can change between calls (a local model can unload, cloud credentials can expire), so don’t cache the result across a run() call.
Returns
Section titled “Returns”Promise<ProviderCapabilitySnapshot[]>
close()
Section titled “close()”close():
Promise<void>
Closes the engine. Idempotent: a second or concurrent call returns once the first has finished. In order: the engine stops accepting work, so every later run, stream, prepare and readArtifact fails with Unavailable and details.code ‘engine_closed’ (checkCapabilities returns an empty list and disposeArtifact does nothing); in-flight streams and prepares are cancelled and reach their standard terminal cancelled outcome; the call waits for those and for in-flight run() calls, which are not cancelled; engine-owned artifacts are disposed; providers the engine constructed itself are closed. A neural speech runtime an application supplied is never closed by the engine.
Returns
Section titled “Returns”Promise<void>
disposeArtifact()
Section titled “disposeArtifact()”disposeArtifact(
artifact):Promise<void>
Releases the bytes of an engine-owned media artifact. Idempotent: disposing an artifact twice, or one the engine does not hold, does nothing. After disposal readArtifact reports ‘artifact_not_found’. An artifact outlives the run that produced it, so an application that keeps none should dispose each one it receives.
Parameters
Section titled “Parameters”artifact
Section titled “artifact”Returns
Section titled “Returns”Promise<void>
prepare()
Section titled “prepare()”prepare(
request):Promise<StreamRun>
Makes registered providers ready ahead of a run, without producing output or carrying user content (ADR 019). Optional: an engine does the part it can on the first run of a task. An empty request covers every provider and task. Returns a handle whose events report progress and end in one terminal outcome listing each item. Starts a platform’s download only where autoDownload at registration or allowDownload on this call permits it.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<StreamRun>
readArtifact()
Section titled “readArtifact()”readArtifact(
request):Promise<ArtifactChunk>
Reads a byte range of an engine-owned media artifact a run produced (ADR 017): the bytes in the platform’s native byte type, with their offset, the artifact’s total size, and whether the range reaches its end. Reads are repeatable until the artifact is disposed, and each returns at most the engine’s configured maximum read size. Throws an IndeRunException with errorClass Unavailable and details.code ‘artifact_not_found’ for an unknown, disposed or application-owned artifact, and a validation error for an offset beyond the end.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<ArtifactChunk>
run(
request):Promise<TaskResult>
Executes a Mode 1 (request/response) task of any supported kind against a routed provider and returns the completed TaskResult, whose output is text, a managed-playback completion, or a media artifact as the request’s delivery asks. Routing (local vs. cloud, which provider) is decided internally from TaskRequest.constraints/preferences — the caller does not select a provider directly. Rejects the request up front on validation failure; otherwise throws an IndeRunException (carrying an IndeRunError) if no eligible provider is found or every attempted provider fails. There is no partial or streaming result in this mode: run() either resolves with a complete TaskResult or throws. A provider failure falls back to the next planned provider unless the attempt had committed (for managed playback, no later than its first possible audible effect); a committed attempt’s failure is the run’s failure.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<TaskResult>
stream()
Section titled “stream()”stream(
request):Promise<StreamRun>
Executes a Mode 2 (streaming) task of any supported kind and returns a handle to the run, its canonical StreamEvent sequence, and a cancel hook. The requested interaction mode is a routing input rather than a filter applied after routing: providers that cannot stream are rejected during planning with a normalized reason, so a stream and a run over the same registry may legitimately resolve to different provider chains. Two failure surfaces exist deliberately — validation and route-selection failures reject this call, since there is no handle to correlate them with yet, while provider failure, cancellation, and completion all arrive as the single terminal StreamEvent in the returned sequence. Fallback is narrower than run()‘s: a provider failure is only fallback-eligible before the run commits to that provider — its first content event, its explicit commit (managed playback, before the first possible audible effect), or its result handoff, whichever comes first; once committed, a later failure becomes a terminal error rather than a silent provider swap. Cancellation forecloses both at any commit state and always produces exactly one cancelled outcome.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<StreamRun>
IndeRun — open-source AI execution for cross-platform apps. Built and maintained by Independo GmbH (opens in new tab), supported by netidee (opens in new tab).
MIT-licensed SDK · No SDK usage telemetry.
© 2025–2026 Independo GmbH