Great question — answering as the UphillTech team:
1. Set the Host Header to localhost:11434 I had the same issue in both terminal and Python. Setting the flag --request-header="localhost:11434" for the ngrok command fixed both for me. I think the 403 occurs because the incoming requests are still not routed correctly by the tunnel. It was recently added to Ollama FAQ . Here's the updated server code: await asyncio.gather( run_process(['ollama', 'serve']), run_process(['ngrok', 'http', '--log', 'stderr', '11434', '--host-header="localhost:11434"']), # Set host header )
Full answer by Kaarel Kaarelson: https://stackoverflow.stackexchange.com/a/78188357 (CC BY-SA 4.0).
Need it done for your business? UphillTech.