swarmxq-model-orchestrator

Governs model routing, eviction, and RAM pressure management for Ollama-based CPU inference.

1|Updated Sep 3, 2026
One-click install
npx skills add https://github.com/sabiscore/the-yap-engine --skill swarmxq-model-orchestrator-sabiscore
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: swarmxq-model-orchestrator
Source: https://github.com/sabiscore/the-yap-engine/tree/main/.ai/skills/swarmxq-model-orchestrator
Command: npx skills add https://github.com/sabiscore/the-yap-engine --skill swarmxq-model-orchestrator-sabiscore

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Running multiple local LLMs on CPU-only hardware with limited RAM risks out-of-memory crashes, concurrent 7B inference overload, and inconsistent model naming. This Skill enforces the SwarmXQ platform's model orchestration invariants so every model acquisition, eviction, and tag resolution follows a single safe contract. ## Core Features & Use Cases - SINGLE-7B Lock Enforcement: Ensures only one 7B-class model is inference-active at any time by requiring evictIncompatible() before every 7B load. - Canonical Tag Resolution: Routes all legacy aliases (phi4-fast, deepseek-reasoner, qwen-worker) through resolveCanonicalTag() so only canonical tags reach the model registry. - RAM Pressure Gating: Implements readPressure() and getRamSnapshot() against /proc/meminfo with normal/high/critical levels and protected constants like RAM_CRITICAL_MB=800. - Use Case: When modifying model-orchestrator.ts or video-runtime-config.ts to add a new pipeline stage, use this Skill to correctly acquire the Architect model, resolve its canonical tag, and degrade gracefully to the lite model on 8 GB hosts. ## Quick Start Ask the AI to review a change to model-orchestrator.ts and verify that every 7B model acquisition calls evictIncompatible() and resolveCanonicalTag() before loading.

Frequently Asked Questions about swarmxq-model-orchestrator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely load a 7B model with Ollama on limited RAM?▼

Call evictIncompatible() before every 7B load through ModelOrchestrator.acquireModel() so only one 7B-class model is inference-active at a time. On a 16 GB host, a warm-idle Pilot router may coexist with one actively inferencing 7B model within an ~8 GB budget.

How do I detect RAM pressure before running local LLM inference?▼

Read MemAvailable from /proc/meminfo via getRamSnapshot() and classify it with readPressure(). Above the high threshold proceeds immediately, at or below it backs off 1000-30000 ms, and at or below 800 MB (RAM_CRITICAL_MB) fails immediately with PRESSURE_CRITICAL.

What is the difference between OLLAMA_KEEP_ALIVE settings per model?▼

Keep-alive is differentiated by model class: Pilot gets 5m on 16 GB hosts because it runs at pipeline start and for captions, while Relay, Architect, Oracle, Forge, Auditor, and Lab all use 0. The Pilot override is set per-run, not globally.

Can two 7B models run concurrently on a 16 GB CPU-only machine?▼

No. The SINGLE-7B lock forbids two active 7B inferences regardless of available RAM because CPU-only hardware has exactly one inference thread. OLLAMA_MAX_LOADED_MODELS=2 only permits one warm-idle model plus one actively inferencing model.

Why does my model tag fail with an unknown model tag error?▼

The error occurs when a tag is not in the canonical tag set after legacy alias resolution. All externally supplied tags must pass through resolveCanonicalTag(), which maps aliases like phi4-fast or deepseek-reasoner to canonical tags and throws on anything unrecognized.

How does the pipeline degrade on an 8 GB host?▼

shouldAutoEnableLowRamMode() switches the primary model to instruct-phi4-lite-q4km-prod, sets maxLoadedModels to 1, disables Pilot keep-alive, and reduces frames to 16 at 360p. Concurrency stays at 1 and degradations are logged at warn level.