{"record":{"id":"6c57983de136ebfb","repo":"ruvnet/ruflo","slug":"model-name-not-found-available-this-m","errorCode":null,"errorMessage":"Model \"${name}\" not found. Available: ${[...this.models.keys()].join(', ')}","messagePattern":"Model \"(.+?)\" not found\\. Available: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/appliance/ruvllm-bridge.ts","lineNumber":182,"sourceCode":"        this.ruvectorCore && '@ruvector/core',\n        this.ruvectorRouter && '@ruvector/router',\n        this.ruvectorSona && '@ruvector/sona',\n        this.ggufEngine && 'gguf-engine',\n      ].filter(Boolean);\n      if (pkgs.length) console.log(`[ruvLLM] Loaded: ${pkgs.join(', ')}`);\n      console.log(`[ruvLLM] ${this.models.size} model(s) in ${this.config.modelsDir}`);\n    }\n  }\n\n  /** Return all discovered GGUF models. */\n  async listModels(): Promise<ModelInfo[]> {\n    return Array.from(this.models.values());\n  }\n\n  /** Load a model into memory (delegates to GGUF engine or @ruvector/core). */\n  async loadModel(name: string): Promise<void> {\n    const info = this.models.get(name);\n    if (!info) throw new Error(`Model \"${name}\" not found. Available: ${[...this.models.keys()].join(', ')}`);\n\n    // Prefer GGUF engine (parses header, loads via node-llama-cpp if available)\n    if (this.ggufEngine) {\n      const meta = await this.ggufEngine.loadModel(info.path);\n      if (meta.architecture) info.parameters = meta.architecture;\n      if (meta.quantization) info.quantization = meta.quantization;\n    } else if (this.ruvectorCore?.loadModel) {\n      await this.ruvectorCore.loadModel(info.path, { contextSize: this.config.contextSize });\n    }\n    info.loaded = true;\n    this.activeModel = name;\n  }\n\n  /**\n   * Generate text from a prompt. Routes through tiers:\n   * 1. Agent Booster (trivial transforms, no LLM).\n   * 2. Local GGUF model via @ruvector/core.\n   * 3. Cloud fallback (empty response -- caller handles upstream).","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/appliance/ruvllm-bridge.ts#L164-L200","documentation":"loadModel(name) looks the name up in a Map that initialize() populates by scanning modelsDir for GGUF model files. The throw embeds the list of discovered names, so the mismatch is usually visible in the message itself: the requested name is not a discovered .gguf model — either a naming mismatch or nothing was discovered at all (initialize not run / wrong directory).","triggerScenarios":"Calling `bridge.loadModel(name)` before `await bridge.initialize()` (map empty, 'Available:' lists nothing); passing a display name that differs from the discovered file name; modelsDir containing no .gguf files; modelsDir pointing at the wrong folder.","commonSituations":"User asks for 'llama3' but the file is 'llama-3-8b.Q4_K_M.gguf'; model files renamed or moved on disk; initialize() silently discovered zero models because the configured directory is empty or wrong.","solutions":["Ensure `await bridge.initialize()` has completed before calling loadModel","Inspect `await bridge.listModels()` and use an exact name from that result (the error message's Available list is the same data)","Verify the .gguf file actually exists under the configured modelsDir","If the Available list is empty, fix modelsDir (see RuvllmConfig.modelsDir is required) or download models into it"],"exampleFix":"// before\nawait bridge.loadModel('llama3'); // Model \"llama3\" not found. Available: llama-3-8b.Q4_K_M.gguf\n\n// after\nawait bridge.initialize();\nconst target = (await bridge.listModels()).find(m => m.name.startsWith('llama-3'));\nif (!target) throw new Error('No llama-3 model found — download one into modelsDir first');\nawait bridge.loadModel(target.name);","handlingStrategy":"validation","validationCode":"await bridge.initialize();\nconst available = new Set((await bridge.listModels()).map(m => m.name));\nif (!available.has(requestedName)) {\n  throw new Error(`Unknown model \"${requestedName}\". Known: ${[...available].join(', ')}`);\n}\nawait bridge.loadModel(requestedName);","typeGuard":null,"tryCatchPattern":"try {\n  await bridge.loadModel(name);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('not found. Available:')) {\n    // initialize() may not have run, or the name is stale — re-list and pick an exact match\n    const models = await bridge.listModels();\n    const match = models.find(m => m.name.includes(name));\n    if (!match) throw e;\n    await bridge.loadModel(match.name);\n  } else {\n    throw e;\n  }\n}","preventionTips":["Always await initialize() and drive model selection from listModels() output rather than hardcoded names","Log discovered models at startup so an empty modelsDir is caught immediately","Match on file names (e.g. llama-3-8b.Q4_K_M.gguf), not marketing names"],"tags":["ruvllm-bridge","model-loading","not-found","gguf"],"backgroundTag":"resource-not-found","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}