{"record":{"id":"cc0186143582acb9","repo":"Mintplex-Labs/anything-llm","slug":"error-message-cc0186","errorCode":null,"errorMessage":"error.message","messagePattern":"error\\.message","errorType":"exception","errorClass":"RetryError","httpStatus":null,"severity":"error","filePath":"server/utils/agents/aibitat/providers/dockerModelRunner.js","lineNumber":126,"sourceCode":"\n    try {\n      return await tooledStream(\n        this.client,\n        this.model,\n        messages,\n        functions,\n        eventHandler,\n        { provider: this }\n      );\n    } catch (error) {\n      console.error(error.message, error);\n      if (error instanceof OpenAI.AuthenticationError) throw error;\n      if (\n        error instanceof OpenAI.RateLimitError ||\n        error instanceof OpenAI.InternalServerError ||\n        error instanceof OpenAI.APIError\n      ) {\n        throw new RetryError(error.message);\n      }\n      throw error;\n    }\n  }\n\n  /**\n   * Create a non-streaming completion with tool calling support.\n   * Uses native tool calling when supported, otherwise falls back to UnTooled.\n   */\n  async complete(messages, functions = []) {\n    const useNative = await this.supportsNativeToolCalling();\n\n    if (!useNative) {\n      return await UnTooled.prototype.complete.call(\n        this,\n        messages,\n        functions,\n        this.#handleFunctionCallChat.bind(this)","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/aibitat/providers/dockerModelRunner.js#L108-L144","documentation":"Docker Model Runner provider's `stream()` classifies OpenAI SDK errors. It logs `console.error(error.message, error)` first, then re-throws AuthenticationError, wraps RateLimitError/InternalServerError/APIError as `RetryError(error.message)`, and re-throws the rest. Docker Model Runner is the local Docker Desktop LLM endpoint (typically http://localhost:12434); failures are usually local — model not pulled/loaded, Docker Desktop not running, or the local OAI-compatible socket unreachable.","triggerScenarios":"Local model not loaded (APIError / InternalServerError while it lazy-loads); Docker Desktop or the Model Runner feature not running; DOCKER_MODEL_RUNNER_BASE_PATH wrong; concurrent local requests exceed the single-model queue (RateLimitError).","commonSituations":"First request after Docker restart triggers model load and times out; requested model slug not pulled (`docker model list` shows nothing); DOCKER_MODEL_RUNNER_BASE_PATH misconfigured; resource constraints on the local box.","solutions":["Inspect the server console — the full error object is logged before rethrow.","Treat RetryError as transient (model load is lazy; a retry often succeeds once loaded).","Run `docker model list` / `docker model run` to confirm the model is present and loaded.","Confirm Docker Desktop is running with the Model Runner feature enabled and that DOCKER_MODEL_RUNNER_BASE_PATH points at the right socket (default http://localhost:12434).","Reduce concurrency against the single local model to avoid RateLimitError."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Confirm Docker Model Runner is up and the model is loaded before the first stream.\nasync function assertDockerModelRunnerReady(model) {\n  const base = process.env.DOCKER_MODEL_RUNNER_BASE_PATH || 'http://localhost:12434';\n  const res = await fetch(`${base}/v1/models`);\n  if (!res.ok) throw new Error('Docker Model Runner not reachable at ' + base);\n}","typeGuard":"function isRetryableProviderError(e) {\n  return e instanceof OpenAI.RateLimitError || e instanceof OpenAI.InternalServerError || e instanceof OpenAI.APIError;\n}","tryCatchPattern":"// Lazy model load often succeeds on retry — retry once with backoff.\ntry { return await provider.stream(messages, functions, handler); }\ncatch (e) {\n  if (e instanceof OpenAI.AuthenticationError) throw e;\n  if (e instanceof RetryError) return await backoffAndRetry();\n  throw e;\n}","preventionTips":["Read server logs — the stream path console.errors the full object.","Warm the model at startup so the first request does not race a lazy load.","Keep one in-flight request to a single local model to avoid RateLimitError.","Confirm Docker Desktop + Model Runner feature are running."],"tags":["llm-provider","docker-model-runner","local-inference","retry","streaming","openai-sdk"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}