Mintplex-Labs/anything-llm · warning · Error

Model capabilities for ${this.model} could not be retrieved

Error message

Model capabilities for ${this.model} could not be retrieved

What it means

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.

Source

Thrown at server/utils/AiProviders/omlx/index.js:320

  }

  async getModelCapabilities() {
    const capabilities = {
      reasoning: false,
      tools: true,
      vision: false,
      imageGeneration: false,
    };
    try {
      // oMLX currently does not implement a /v1/models/{model_id} endpoint.
      // As of now, this endpoint offers the richest metadata for models on
      // the server
      const { models = [] } = await this.omlx.get("/models/status");

      const modelData = models.find((m) => m.id === this.model);

      if (!modelData) {
        throw new Error(
          `Model capabilities for ${this.model} could not be retrieved`
        );
      }

      // thinking_default is currently the best flag for identifying a
      // reasoning model. All this boolean means is "Does this model reason by
      // default or do I have to prompt it to reason?". But the field will either be
      // undefined or null for non-reasonig models.
      capabilities.reasoning =
        modelData.thinking_default !== null &&
        modelData.thinking_default !== undefined;
      capabilities.vision = modelData.model_type === "vlm";

      // Curently cannot be determined
      capabilities.imageGeneration = false;
    } catch (e) {
      this.#log(e.message);
    }

View on GitHub (pinned to 526360e320)

Solutions

  1. GET the oMLX /models/status endpoint and compare returned ids against this.model exactly.
  2. Update OMLX_LLM_MODEL_PREF to match the server's id verbatim (case-sensitive).
  3. Reload the model on the oMLX server if it was unloaded.
  4. Note that this is non-fatal: chat still works, only capability detection degrades.

Example fix

// before
const modelData = models.find((m) => m.id === this.model);
if (!modelData) throw new Error(`Model capabilities for ${this.model} could not be retrieved`);

// after - case-insensitive fallback so minor casing drift does not disable capability detection
const modelData = models.find((m) => m.id === this.model)
  || models.find((m) => m.id?.toLowerCase() === this.model?.toLowerCase());
if (!modelData) throw new Error(`Model capabilities for ${this.model} could not be retrieved`);
Defensive patterns

Strategy: validation

Validate before calling

const listOmlxModels = async (client) => {
  const { models = [] } = await client.get('/models/status');
  return models.map((m) => m.id);
};
const ids = await listOmlxModels(llm.omlx);
if (!ids.includes(llm.model))
  throw new Error(`OMLX model '${llm.model}' not in server list: ${ids.join(', ')}`);

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/ec9552320c5e4d59. Report an issue: GitHub.