In general if your resource runs out of memory, you can try either scaling up the resource to a higher cluster tier, or scaling down the index parameters (e.g., for HNSW you can reduce m or efConstruction and this will reduce the memory footprint of the index. However, you may lose some accuracy in doing so.)
For more than ~10k 1536-dimensional vectors, I wouldn't recommend anything lower than M40. Also, if you scale up to an M40 or above you'll be able to create an HNSW index. HNSW should offer you better latency, throughput, and accuracy compared to IVF at the scale you have.
For example, I was able to have >1M vectors on an M50 without issue using HNSW.