{"record":{"id":"6984454cedc11573","repo":"continuedev/continue","slug":"await-resp-text-698445","errorCode":null,"errorMessage":"await resp.text()","messagePattern":"await resp\\.text\\(\\)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/llm/llms/HuggingFaceTEI.ts","lineNumber":66,"sourceCode":"        teiError = JSON.parse(text);\n      } catch (e) {\n        console.log(`Failed to parse TEI embed error response:\\n${text}`, e);\n      }\n      if (teiError && (teiError.error_type || teiError.error)) {\n        throw new TEIEmbedError(teiError);\n      }\n      throw new Error(text);\n    }\n    return (await resp.json()) as number[][];\n  }\n\n  async doInfoRequest(): Promise<TEIInfoResponse> {\n    // TODO - need to use custom fetch for this request?\n    const resp = await this.fetch(new URL(\"info\", this.apiBase), {\n      method: \"GET\",\n    });\n    if (!resp.ok) {\n      throw new Error(await resp.text());\n    }\n    return (await resp.json()) as TEIInfoResponse;\n  }\n\n  async rerank(query: string, chunks: Chunk[]): Promise<number[]> {\n    const headers: Record<string, string> = {\n      \"Content-Type\": \"application/json\",\n    };\n\n    if (this.apiKey) {\n      headers[\"Authorization\"] = `Bearer ${this.apiKey}`;\n    }\n\n    const resp = await this.fetch(new URL(\"rerank\", this.apiBase), {\n      method: \"POST\",\n      headers,\n      body: JSON.stringify({\n        query: query,","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/llm/llms/HuggingFaceTEI.ts#L48-L84","documentation":"Thrown by HuggingFaceTEI.doInfoRequest (called from the constructor) when GET {apiBase}/info fails with a non-OK status. The /info endpoint is queried at provider construction to learn the server's capabilities, so this error fires early — typically at config load time, before any chat or embedding call.","triggerScenarios":"Constructing the HuggingFaceTEI provider with an apiBase whose /info route returns non-2xx: wrong port, non-TEI server at that URL, or TEI requiring auth headers the request doesn't send.","commonSituations":"Pointing apiBase at a TGI/Ollama server instead of TEI, URL with a trailing path segment so /info resolves incorrectly, or firewall/auth blocking the GET.","solutions":["curl {apiBase}/info manually — expect JSON with model_id, max_client_batch_size, etc.; if not, fix the URL or server","Ensure apiBase points at the TEI server root (e.g. http://localhost:8080) not another service","If auth is required, configure headers or put the server on a trusted network"],"exampleFix":"// before\n\"apiBase\": \"http://localhost:11434\" // Ollama port\n// after\n\"apiBase\": \"http://localhost:8080\"   // TEI port","handlingStrategy":"validation","validationCode":"const r = await fetch(new URL('info', apiBase));\nif (!r.ok) throw new Error(`TEI unreachable at ${apiBase} (status ${r.status})`);","typeGuard":"const isTEIServer = async (base: string) => {\n  const r = await fetch(new URL('info', base));\n  return r.ok && !!(await r.json()).model_id;\n};","tryCatchPattern":"try { new HuggingFaceTEI(config); } catch (e) { if (e instanceof Error && e.message.includes('<')) fixApiBase(); else throw e; }","preventionTips":["Validate apiBase with a curl /info check before adding to config","Pin the TEI container version in deployment scripts"],"tags":["huggingface","tei","startup","info-endpoint","wrong-url"],"backgroundTag":"embedding-server-error","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}