Mintplex-Labs/anything-llm · error · Error

Docker Model Runner chat

Error message

Docker Model Runner chat: ${this.model} is not valid or defined model for chat completion!

What it means

Sentinel guard at the top of DockerModelRunnerLLM.getChatCompletion: thrown when this.model is falsy, meaning the configured Docker Model Runner model preference never resolved to a usable model identifier before a non-streaming chat completion was attempted.

Solutions

  1. Set a valid model available in Docker Model Runner.
  2. Pull the model in Docker Model Runner first.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown when the configured model is not available for chat completion.

Common situations: Model not pulled or misspelled model name.


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/1012832aefbedc1d. Report an issue: GitHub.

Appendix: source

Thrown at server/utils/AiProviders/dockerModelRunner/index.js:150

    attachments = [],
  }) {
    const prompt = {
      role: "system",
      content: `${systemPrompt}${this.#appendContext(contextTexts)}`,
    };
    return [
      prompt,
      ...formatChatHistory(chatHistory, this.#generateContent),
      {
        role: "user",
        content: this.#generateContent({ userPrompt, attachments }),
      },
    ];
  }

  async getChatCompletion(messages = null, { temperature = 0.7 }) {
    if (!this.model)
      throw new Error(
        `Docker Model Runner chat: ${this.model} is not valid or defined model for chat completion!`
      );

    const result = await LLMPerformanceMonitor.measureAsyncFunction(
      this.dmr.chat.completions.create({
        model: this.model,
        messages,
        temperature,
      })
    );

    if (
      !result.output.hasOwnProperty("choices") ||
      result.output.choices.length === 0
    )
      return null;

    return {

View on GitHub (pinned to 3aec848f28)