Arcane OS Docs Development only

Reference

Arcane.localAI.setParallelRequests()

Solves one app-owned verified model/context's maximum directly from native model and memory/resource evidence without a product ceiling, clamps a positive request to that result (0 requests the maximum), and changes the machine-wide managed Ollama setting only when needed. A tentative change uses one fresh stopped-service snapshot before the final value is written, then Core ensures, loads, and confirms the exact model. A restart unloads resident models. Automatic mutation currently requires the dedicated ai.runtime.manage capability on Microsoft NT desktop Core and operating-system authorization; Linux returns administrator-managed systemd guidance, and Android user-managed loopback sessions do not invoke it.

  • Reference

This focused page is derived from the mechanically checked full member inventory.

Syntax

Arcane.localAI.setParallelRequests(request)

Parameters

request: LocalAIParallelRequestsRequest

Return value

Promise<LocalAIParallelRequestsResult>

Description

Solves one app-owned verified model/context's maximum directly from native model and memory/resource evidence without a product ceiling, clamps a positive request to that result (0 requests the maximum), and changes the machine-wide managed Ollama setting only when needed. A tentative change uses one fresh stopped-service snapshot before the final value is written, then Core ensures, loads, and confirms the exact model. A restart unloads resident models. Automatic mutation currently requires the dedicated ai.runtime.manage capability on Microsoft NT desktop Core and operating-system authorization; Linux returns administrator-managed systemd guidance, and Android user-managed loopback sessions do not invoke it.

Overview

Arcane.localAI.setParallelRequests(request) calculates and applies the machine-wide Ollama parallel-request count for one exact app-owned verified model. It can restart Ollama, evict all resident models, and terminate in-flight local inference. Use it only in the sole registered application-owned administrative flow with clear impact disclosure.

Parameters

request is exactly {model, parallelRequests, contextTokens?}. model is an app-owned verified identifier. parallelRequests is a nonnegative safe integer: 0 requests the maximum currently admitted; a positive request is a ceiling that Arcane can clamp down. contextTokens is a positive safe integer when present and otherwise uses the verified Modelfile value. Native model metadata, not an Arcane product ceiling, governs the maximum context.

Return value

The schema-version 1 receipt reports requested, previous, maximum allowed, allowed, and effective parallelism; context and native-context evidence; clamping, change, restart, health, and load state; evicted models; final admission; and a completed operation. Treat capacity evidence as a current snapshot, not a future performance promise.

Availability

This is a privileged, exclusive desktop Core method for the sole registered owning application identity, requiring ai.runtime.manage. Microsoft NT applies the setting. Linux returns a 501 manual-systemd error, and Android does not expose the method.

Errors and recovery

Input, app-owned-model, verified-policy, admission, capacity, unsupported, apply, health, load, and rollback errors are actionable by stable code. Arcane attempts to restore the prior count when loading fails after a change. After any uncertain completion, refresh status and service settings before another mutation.

Streaming, cancellation, and events

The method emits standard operation events but no provider chunks. It has a long renderer timeout and no signal, and Core does not cooperatively cancel the workflow. A timeout or page close can occur while the service transaction continues.

Example

This no-change-oriented example requests the currently active count for a verified runnable model; it can still perform verification and loading.

document.querySelector('#confirm-parallel-request-change')?.addEventListener(
    'click',
    async function handleConfirmedParallelRequestChange() {
        const arcane = globalThis.Arcane;
        const status = await arcane.localAI.status();
        const model = status.models.ollama.find(
            function findVerifiedRunnableModel(candidate) {
                return candidate.verified === true && candidate.runnable === true;
            }
        );
        if (!model) return;

        const result = await arcane.localAI.setParallelRequests({
            model: model.id,
            parallelRequests: status.ollama.activeParallelRequests
        });
        console.info(result.effectiveParallelRequests);
    }
);

Reference group

AI and Ollama

Repository and reviewed source access