{"record":{"id":"ec9552320c5e4d59","repo":"Mintplex-Labs/anything-llm","slug":"model-capabilities-for-this-model-could-not-be","errorCode":null,"errorMessage":"Model capabilities for ${this.model} could not be retrieved","messagePattern":"Model capabilities for (.+?) could not be retrieved","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"server/utils/AiProviders/omlx/index.js","lineNumber":320,"sourceCode":"  }\n\n  async getModelCapabilities() {\n    const capabilities = {\n      reasoning: false,\n      tools: true,\n      vision: false,\n      imageGeneration: false,\n    };\n    try {\n      // oMLX currently does not implement a /v1/models/{model_id} endpoint.\n      // As of now, this endpoint offers the richest metadata for models on\n      // the server\n      const { models = [] } = await this.omlx.get(\"/models/status\");\n\n      const modelData = models.find((m) => m.id === this.model);\n\n      if (!modelData) {\n        throw new Error(\n          `Model capabilities for ${this.model} could not be retrieved`\n        );\n      }\n\n      // thinking_default is currently the best flag for identifying a\n      // reasoning model. All this boolean means is \"Does this model reason by\n      // default or do I have to prompt it to reason?\". But the field will either be\n      // undefined or null for non-reasonig models.\n      capabilities.reasoning =\n        modelData.thinking_default !== null &&\n        modelData.thinking_default !== undefined;\n      capabilities.vision = modelData.model_type === \"vlm\";\n\n      // Curently cannot be determined\n      capabilities.imageGeneration = false;\n    } catch (e) {\n      this.#log(e.message);\n    }","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/AiProviders/omlx/index.js#L302-L338","documentation":"Thrown inside getModelCapabilities when this.model is not present in the /models/status response list. It is caught by the surrounding try/catch, logged via #log, and the method returns default all-false capabilities — so callers never see the throw; reasoning/vision detection silently degrades. Used to decide reasoning-tag and vision handling.","triggerScenarios":"Model id in this.model does not exactly match any m.id returned by oMLX /models/status (case sensitivity, whitespace, renamed model); /models/status returns an empty or partial list; model unloaded from the server.","commonSituations":"Case mismatch (Llama-3 vs llama-3); model renamed upstream; stale OMLX_LLM_MODEL_PREF after a server upgrade; transient empty response from /models/status.","solutions":["GET the oMLX /models/status endpoint and compare returned ids against this.model exactly.","Update OMLX_LLM_MODEL_PREF to match the server's id verbatim (case-sensitive).","Reload the model on the oMLX server if it was unloaded.","Note that this is non-fatal: chat still works, only capability detection degrades."],"exampleFix":"// before\nconst modelData = models.find((m) => m.id === this.model);\nif (!modelData) throw new Error(`Model capabilities for ${this.model} could not be retrieved`);\n\n// after - case-insensitive fallback so minor casing drift does not disable capability detection\nconst modelData = models.find((m) => m.id === this.model)\n  || models.find((m) => m.id?.toLowerCase() === this.model?.toLowerCase());\nif (!modelData) throw new Error(`Model capabilities for ${this.model} could not be retrieved`);","handlingStrategy":"validation","validationCode":"const listOmlxModels = async (client) => {\n  const { models = [] } = await client.get('/models/status');\n  return models.map((m) => m.id);\n};\nconst ids = await listOmlxModels(llm.omlx);\nif (!ids.includes(llm.model))\n  throw new Error(`OMLX model '${llm.model}' not in server list: ${ids.join(', ')}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match the model id exactly (case-sensitive) to what /models/status reports.","Treat getModelCapabilities as best-effort: chat works even when it degrades.","Reload the model on the oMLX server if it was unloaded."],"tags":["omlx","configuration","capabilities","logging"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}