I would just refactor your code as I mentioned. No idea why it works in the notebook and not fastapi, but it will be even faster without the index store (you'll notice the index store is largely empty anyways)
vector_store = QdrantVectorStore(
collection_name=<collection_name>,
client=q_client,
parallel=4
)
index = VectorStoreIndex.from_vector_store(vector_store)