continuedev/continue · error · Error

await resp.text()

Error message

await resp.text()

What it means

Thrown by Nvidia._embed when NVIDIA's NIM embeddings API returns a non-OK status; the raw body is the message. The request sends Authorization: Bearer apiKey plus a JSON payload of the chunks, mirroring an OpenAI-style /embeddings call against build.nvidia.com.

Source

Thrown at core/llm/llms/Nvidia.ts:32

  };

  protected async _embed(chunks: string[]): Promise<number[][]> {
    const resp = await this.fetch(new URL("embeddings", this.apiBase), {
      method: "POST",
      body: JSON.stringify({
        input: chunks,
        model: this.model,
        input_type: "passage",
        truncate: "END",
      }),
      headers: {
        Authorization: `Bearer ${this.apiKey}`,
        "Content-Type": "application/json",
      },
    });

    if (!resp.ok) {
      throw new Error(await resp.text());
    }

    const data = (await resp.json()) as any;
    return data.data.map((result: { embedding: number[] }) => result.embedding);
  }
}

export default Nvidia;

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Check the body message — 401 means regenerate the nvapi key in config.json; 429 means back off or reduce batch size
  2. Confirm the exact model id from the NVIDIA build catalog
  3. If self-hosting NIM, verify the base URL and that the container is up
Defensive patterns

Strategy: retry

Validate before calling

null

Type guard

function isNvidiaQuotaError(e: unknown): boolean { return e instanceof Error && /429|rate|limit/i.test(e.message); }

Try / catch

try { await llm.embed(chunks); }
catch (e) { if (isNvidiaQuotaError(e)) { await sleep(5000); return llm.embed(chunks); } throw e; }

Prevention

When it happens

Trigger: Embedding chunks with provider nvidia and an invalid nvapi key, a model like nvidia/nv-embedqa-e5-v5 that the key can't access, or rate limiting from the NIM catalog.

Common situations: Using an expired nvapi-... key, typos in the model name, or hitting free-tier rate limits when indexing a large codebase.

Related errors


AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27). Data as JSON: /api/errors/2c48758a5c1e2fb8. Report an issue: GitHub.