Sometimes openai_complete fails when it tries to use socket.getaddrinfo to look up api.openai.com. He thinks that the issue is likely a threading bug in the underlying syscall because adding @functools.cache to the relevant function prevents the bug from happening.
Talked with @lslunis about this. It's probably not worth doing until we see the issue again, and I can't reproduce it locally on my MacBook.