ruvnet/ruflo · error · Error

Model "${name}" not found. Available: ${[...this.models.keys

Error message

Model "${name}" not found. Available: ${[...this.models.keys()].join(', ')}

What it means

Thrown by loadModel when the requested model name is not in this.models (the map populated during initialize()'s scan of modelsDir). The message lists the available model names so the caller can see what was discovered. This is a lookup failure on the in-memory registry, not a filesystem error.

Source

Thrown at v3/@claude-flow/cli/src/appliance/ruvllm-bridge.ts:182

        this.ruvectorCore && '@ruvector/core',
        this.ruvectorRouter && '@ruvector/router',
        this.ruvectorSona && '@ruvector/sona',
        this.ggufEngine && 'gguf-engine',
      ].filter(Boolean);
      if (pkgs.length) console.log(`[ruvLLM] Loaded: ${pkgs.join(', ')}`);
      console.log(`[ruvLLM] ${this.models.size} model(s) in ${this.config.modelsDir}`);
    }
  }

  /** Return all discovered GGUF models. */
  async listModels(): Promise<ModelInfo[]> {
    return Array.from(this.models.values());
  }

  /** Load a model into memory (delegates to GGUF engine or @ruvector/core). */
  async loadModel(name: string): Promise<void> {
    const info = this.models.get(name);
    if (!info) throw new Error(`Model "${name}" not found. Available: ${[...this.models.keys()].join(', ')}`);

    // Prefer GGUF engine (parses header, loads via node-llama-cpp if available)
    if (this.ggufEngine) {
      const meta = await this.ggufEngine.loadModel(info.path);
      if (meta.architecture) info.parameters = meta.architecture;
      if (meta.quantization) info.quantization = meta.quantization;
    } else if (this.ruvectorCore?.loadModel) {
      await this.ruvectorCore.loadModel(info.path, { contextSize: this.config.contextSize });
    }
    info.loaded = true;
    this.activeModel = name;
  }

  /**
   * Generate text from a prompt. Routes through tiers:
   * 1. Agent Booster (trivial transforms, no LLM).
   * 2. Local GGUF model via @ruvector/core.
   * 3. Cloud fallback (empty response -- caller handles upstream).

View on GitHub (pinned to 6b01dc5a68)

Solutions

  1. Call listModels() (or read the error's Available list) and use an exact name from the result.
  2. Ensure initialize() has completed before loadModel — the map is populated during the scan.
  3. Place the GGUF file inside the configured modelsDir with a recognized extension and re-run initialize().
  4. Check name casing and whitespace; model names are usually derived from filenames.

Example fix

// before
await bridge.loadModel('llama');

// after
const models = await bridge.listModels();
const target = models.find(m => m.name.toLowerCase().includes('llama'));
if (!target) throw new Error(`no llama model; have: ${models.map(m => m.name).join(', ')}`);
await bridge.loadModel(target.name);
Defensive patterns

Strategy: validation

Validate before calling

const models = await bridge.listModels();
const names = models.map(m => m.name);
if (!names.includes(requestedName)) {
  throw new Error(`unknown model '${requestedName}'; available: ${names.join(', ')}`);
}
await bridge.loadModel(requestedName);

Type guard

function isKnownModel(name: string, known: string[]): boolean {
  return known.includes(name);
}

Try / catch

try {
  await bridge.loadModel(name);
} catch (e) {
  if (e instanceof Error && /not found/.test(e.message)) {
    const list = (await bridge.listModels()).map(m => m.name).join(', ');
    throw new Error(`model '${name}' not found; available: ${list}`);
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling loadModel('foo') where 'foo' was not found by the directory scan — wrong name/case, the file is not in modelsDir, the scan has not run (initialize() not awaited), or the model file extension is not recognized by the scanner.

Common situations: Typos or case mismatches in the model name; the model lives outside modelsDir; initialize() was skipped so the map is empty; the scan filters by extension and the file is not a .gguf. The error message's 'Available: ...' list is the key diagnostic.

Related errors


AI-assisted analysis of ruvnet/ruflo@6b01dc5a68 (2026-08-12). Data as JSON: /api/errors/6c57983de136ebfb. Report an issue: GitHub.