Original title: Can’t connect to Ollama hosted locally from python script

I am building ETL using LLM to extract some information. I have ollama installed locally. I am on Macbook M4 Max. I don’t understand why I have this error from my worker. ads-worker-1 | 2025-08-28 15:05:54,983 - INFO - Got the db connection: <connection object at 0xffff76241300; dsn: ‘user=wtat_user password=xxx dbname=wtat_db host=postgres port=5432 options=’-c search_path=wtat’’, closed: 0> ads-worker-1 | 2025-08-28 15:05:54,986 - INFO - Marked the extraction from 83e9b92b-9bc7-4b7e-bf95-d511c239cf79 PENDING ads-worker-1 | 2025-08-28 15:05:54,986 - INFO - Extract profiles from ads #1 ads-worker-1 | 2025-08-28 15:05:54,986 - INFO - [{‘ad_id’: ‘83e9b92b-9bc7-4b7e-bf95-d511c239cf79’, ‘publication_date’: ‘2021-12-26 00:00:00’, ‘publication_text’: “DJO 1\nSalut le terre. Suis un homme de 35ans, originaire de l’Ouest Cameroun, sans enfants et résident au Canada. J’ai 1.85m pour 85kg. Suis étudiant en génie mais avec un emploi stable. Mes proches me décrivent comme quelqu’un d’attention

Read the original question here