Struggling to Run Archon with Ollama

Hi All,

I keep on getting this error -

INFO:httpx:HTTP Request: GET https://vfbancmjpkohevuiefcc.supabase.co/rest/v1/site_pages?select=url&metadata->>source=eq.pydantic_ai_docs “HTTP/2 200 OK”
2025-04-16 14:10:03 13:10:03.111 reasoner run prompt=
2025-04-16 14:10:03 User AI Agent Request: fg
2025-04-16 14:10:03
2025-04-16 14:10:03 Create detailed scope …o creating this agent for the user in the scope document.
2025-04-16 14:10:03
2025-04-16 14:10:03 13:10:03.129 preparing model and tools run_step=1
2025-04-16 14:10:03 13:10:03.129 model request
2025-04-16 14:10:03 13:10:03.134 advisor_agent run prompt=fg
2025-04-16 14:10:03 13:10:03.138 preparing model and tools run_step=1
2025-04-16 14:10:03 13:10:03.138 model request
2025-04-16 14:10:03 INFO:openai._base_client:Retrying request to /chat/completions in 0.386022 seconds
2025-04-16 14:10:03 INFO:openai._base_client:Retrying request to /chat/completions in 0.467898 seconds
2025-04-16 14:10:03 INFO:openai._base_client:Retrying request to /chat/completions in 0.969164 seconds
2025-04-16 14:10:03 INFO:openai._base_client:Retrying request to /chat/completions in 0.860550 seconds
2025-04-16 14:10:04 2025-04-16 13:10:04.504 Uncaught app execution
2025-04-16 14:10:04 Traceback (most recent call last):
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py”, line 72, in map_httpcore_exceptions
2025-04-16 14:10:04 yield
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py”, line 377, in handle_async_request
2025-04-16 14:10:04 resp = await self._pool.handle_async_request(req)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py”, line 256, in handle_async_request
2025-04-16 14:10:04 raise exc from None
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py”, line 236, in handle_async_request
2025-04-16 14:10:04 response = await connection.handle_async_request(
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py”, line 101, in handle_async_request
2025-04-16 14:10:04 raise exc
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py”, line 78, in handle_async_request
2025-04-16 14:10:04 stream = await self._connect(request)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py”, line 124, in _connect
2025-04-16 14:10:04 stream = await self._network_backend.connect_tcp(**kwargs)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpcore/_backends/auto.py”, line 31, in connect_tcp
2025-04-16 14:10:04 return await self._backend.connect_tcp(
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py”, line 113, in connect_tcp
2025-04-16 14:10:04 with map_exceptions(exc_map):
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/contextlib.py”, line 158, in exit
2025-04-16 14:10:04 self.gen.throw(value)
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py”, line 14, in map_exceptions
2025-04-16 14:10:04 raise to_exc(exc) from exc
2025-04-16 14:10:04 httpcore.ConnectError: All connection attempts failed
2025-04-16 14:10:04
2025-04-16 14:10:04 The above exception was the direct cause of the following exception:
2025-04-16 14:10:04
2025-04-16 14:10:04 Traceback (most recent call last):
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/openai/_base_client.py”, line 1582, in _request
2025-04-16 14:10:04 response = await self._client.send(
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpx/_client.py”, line 1674, in send
2025-04-16 14:10:04 response = await self._send_handling_auth(
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpx/_client.py”, line 1702, in _send_handling_auth
2025-04-16 14:10:04 response = await self._send_handling_redirects(
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpx/_client.py”, line 1739, in _send_handling_redirects
2025-04-16 14:10:04 response = await self._send_single_request(request)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpx/_client.py”, line 1776, in _send_single_request
2025-04-16 14:10:04 response = await transport.handle_async_request(request)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py”, line 376, in handle_async_request
2025-04-16 14:10:04 with map_httpcore_exceptions():
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/contextlib.py”, line 158, in exit
2025-04-16 14:10:04 self.gen.throw(value)
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py”, line 89, in map_httpcore_exceptions
2025-04-16 14:10:04 raise mapped_exc(message) from exc
2025-04-16 14:10:04 httpx.ConnectError: All connection attempts failed
2025-04-16 14:10:04
2025-04-16 14:10:04 The above exception was the direct cause of the following exception:
2025-04-16 14:10:04
2025-04-16 14:10:04 Traceback (most recent call last):
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py”, line 88, in exec_func_with_error_handling
2025-04-16 14:10:04 result = func()
2025-04-16 14:10:04 ^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 579, in code_to_exec
2025-04-16 14:10:04 exec(code, module.dict)
2025-04-16 14:10:04 File “/app/streamlit_ui.py”, line 114, in
2025-04-16 14:10:04 asyncio.run(main())
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/asyncio/runners.py”, line 195, in run
2025-04-16 14:10:04 return runner.run(main)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/asyncio/runners.py”, line 118, in run
2025-04-16 14:10:04 return self._loop.run_until_complete(task)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/asyncio/base_events.py”, line 691, in run_until_complete
2025-04-16 14:10:04 return future.result()
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/app/streamlit_ui.py”, line 93, in main
2025-04-16 14:10:04 await chat_tab()
2025-04-16 14:10:04 File “/app/streamlit_pages/chat.py”, line 81, in chat_tab
2025-04-16 14:10:04 async for chunk in run_agent_with_streaming(user_input):
2025-04-16 14:10:04 File “/app/streamlit_pages/chat.py”, line 30, in run_agent_with_streaming
2025-04-16 14:10:04 async for msg in agentic_flow.astream(
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/langgraph/pregel/init.py”, line 2007, in astream
2025-04-16 14:10:04 async for _ in runner.atick(
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/langgraph/pregel/runner.py”, line 527, in atick
2025-04-16 14:10:04 _panic_or_proceed(
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/langgraph/pregel/runner.py”, line 619, in _panic_or_proceed
2025-04-16 14:10:04 raise exc
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/langgraph/pregel/retry.py”, line 128, in arun_with_retry
2025-04-16 14:10:04 return await task.proc.ainvoke(task.input, config)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/langgraph/utils/runnable.py”, line 532, in ainvoke
2025-04-16 14:10:04 input = await step.ainvoke(input, config, **kwargs)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/langgraph/utils/runnable.py”, line 320, in ainvoke
2025-04-16 14:10:04 ret = await asyncio.create_task(coro, context=context)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/app/archon/archon_graph.py”, line 140, in advisor_with_examples
2025-04-16 14:10:04 result = await advisor_agent.run(state[‘latest_user_message’], deps=deps)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/pydantic_ai/agent.py”, line 340, in run
2025-04-16 14:10:04 end_result, _ = await graph.run(
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/pydantic_graph/graph.py”, line 187, in run
2025-04-16 14:10:04 next_node = await self.next(next_node, history, state=state, deps=deps, infer_name=False)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/pydantic_graph/graph.py”, line 263, in next
2025-04-16 14:10:04 next_node = await node.run(ctx)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/pydantic_ai/_agent_graph.py”, line 254, in run
2025-04-16 14:10:04 model_response, request_usage = await agent_model.request(ctx.state.message_history, model_settings)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/pydantic_ai/models/openai.py”, line 167, in request
2025-04-16 14:10:04 response = await self._completions_create(messages, False, cast(OpenAIModelSettings, model_settings or {}))
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/pydantic_ai/models/openai.py”, line 203, in _completions_create
2025-04-16 14:10:04 return await self.client.chat.completions.create(
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/openai/resources/chat/completions.py”, line 1720, in create
2025-04-16 14:10:04 return await self._post(
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/openai/_base_client.py”, line 1849, in post
2025-04-16 14:10:04 return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/openai/_base_client.py”, line 1543, in request
2025-04-16 14:10:04 return await self._request(
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/openai/_base_client.py”, line 1606, in _request
2025-04-16 14:10:04 return await self._retry_request(
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/openai/_base_client.py”, line 1676, in _retry_request
2025-04-16 14:10:04 return await self._request(
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/openai/_base_client.py”, line 1606, in _request
2025-04-16 14:10:04 return await self._retry_request(
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/openai/_base_client.py”, line 1676, in _retry_request
2025-04-16 14:10:04 return await self._request(
2025-04-16 14:10:04 ^^^^^^^^^^^^^^^^^^^^
2025-04-16 14:10:04 File “/usr/local/lib/python3.12/site-packages/openai/_base_client.py”, line 1616, in _request
2025-04-16 14:10:04 raise APIConnectionError(request=request) from err
2025-04-16 14:10:04 openai.APIConnectionError: Connection error.
2025-04-16 14:10:04 During task with name ‘advisor_with_examples’ and id ‘610a39de-7a86-0e1e-34d6-6fa3a88ed2af’

I don’t uderstand why its coming up with an OpenAI API request as I have configured it to use Ollama