index.upsert() accepts any size list but throws ValueError: Cannot insert more than 1000 vectors at a time only after processing
Should either auto-batch internally or document the limit clearly in the method signature.
Good way for now -
batch_size = 1000
for i in range(0, len(vectors), batch_size):
batch = vectors[i : i + batch_size]
index.upsert(batch)
print(f"UPSERTED batch {i // batch_size + 1} — {len(batch)} vectors")
print(f"UPSERTED {len(vectors)} vectors")