{"record":{"id":"cc9aa95010d9feb6","repo":"chroma-core/chroma","slug":"failed-to-generate-embeddings-response-statuste-cc9aa9","errorCode":null,"errorMessage":"Failed to generate embeddings: ${response.statusText}","messagePattern":"Failed to generate embeddings: (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"clients/new-js/packages/ai-embeddings/huggingface-server/src/index.ts","lineNumber":47,"sourceCode":"\n    const apiKey =\n      args.apiKey || (this.apiKeyEnvVar && process.env[this.apiKeyEnvVar]);\n\n    this.headers = {\n      \"Content-Type\": \"application/json\",\n      Authorization: apiKey ? `Bearer ${apiKey}` : undefined,\n    };\n  }\n\n  public async generate(texts: string[]): Promise<number[][]> {\n    const response = await fetch(this.url, {\n      method: \"POST\",\n      headers: this.headers,\n      body: JSON.stringify({ inputs: texts }),\n    });\n\n    if (!response.ok) {\n      throw new Error(`Failed to generate embeddings: ${response.statusText}`);\n    }\n\n    return await response.json();\n  }\n\n  public defaultSpace(): EmbeddingFunctionSpace {\n    return \"cosine\";\n  }\n\n  public supportedSpaces(): EmbeddingFunctionSpace[] {\n    return [\"cosine\", \"l2\", \"ip\"];\n  }\n\n  public static buildFromConfig(\n    config: HuggingfaceServerConfig,\n  ): HuggingfaceServerEmbeddingFunction {\n    return new HuggingfaceServerEmbeddingFunction({\n      url: config.url,","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/new-js/packages/ai-embeddings/huggingface-server/src/index.ts#L29-L65","documentation":"Error \"Failed to generate embeddings: ${response.statusText}\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at clients/new-js/packages/ai-embeddings/huggingface-server/src/index.ts:47 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}