chroma-core / chroma-core/chroma

[Bug]: Better error messages in cloud embedding functions

Open
#5,876 1 comment 0 reactions 1 assignee Claimed by @kylediaz View on GitHub
bug
Dominant language
Rust
Stars
29.3k
Forks
2.5k
Avg merge
1d 4h
Merged PRs (30d)
38

Description

### What happened?

When you try to use a Chroma Cloud embedding function with more than the max batch size (100), you will get this error:

```
Error: Error: Error calling Chroma Embedding API: Failed to generate embeddings.
at _ChromaCloudQwenEmbeddingFunction.generate (/Users/kylediaz/Repos/kylediaz/address-ingestion-demo/node_modules/@chroma-core/chroma-cloud-qwen/src/index.ts:130:11)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async _CollectionImpl.embed (/Users/kylediaz/Repos/kylediaz/address-ingestion-demo/node_modules/chromadb/dist/cjs/chromadb.cjs:3520:12)
at async _CollectionImpl.prepareRecords (/Users/kylediaz/Repos/kylediaz/address-ingestion-demo/node_modules/chromadb/dist/cjs/chromadb.cjs:3736:30)
at async _CollectionImpl.upsert (/Users/kylediaz/Repos/kylediaz/address-ingestion-demo/node_modules/chromadb/dist/cjs/chromadb.cjs:4017:31)
at async Promise.all (index 1)
at async main (/Users/kylediaz/Repos/kylediaz/address-ingestion-demo/src/ingest.ts:64:5)
error: script "ingest" exited with code 1
```

This error is very confusing. It doesn't say why it failed to generate embeddings. Was there something wrong with my documents? It turns out, my request was rejected because I tried to embed 300 documents (Chroma Cloud's max batch size for adding).

This error message should be more clear.

Additionally, it might be better if the cloud EF broke up its requests into 3 batches of 100 for me. This way, I can easily embed my documents 100 at a time, and then add/upsert them in batches of 300 without having to write special batching logic.

### Versions

```
"dependencies": {
"@chroma-core/chroma-cloud-qwen": "^0.1.9",
"chromadb": "^3.1.4",
},
```

### Relevant log output

```shell

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.