I have a serverless streaming service I've written that is invoking an LLM service running on my computer. I'm using a subdomain redirect -> nginx -> ollama service to run this. It will work the first time, but then if I run the service again right after, it always times out. Then works again after a minute. Rinse/repeat.
It works 100% of the time on my local machine. The service is fast and returns responses quickly. How can I diagnose the error and fix? Really could use some help figuring this out, as the Vercel logs only say "[POST] /api/generate reason=EDGE_FUNCTION_INVOCATION_TIMEOUT, status=504, user_error=true"