Using open interpreter with Ollama on a different machine
Describe the bug
I am trying to use OI with Ollama running on a different computer. I am using the command:
interpreter -y --context_window 1000 --api_base http://192.168.2.162:11434/api/generate --api_key "fake_key" --model ollama/llama2
but it mostly gives garbage and is not useful.
Reproduce
Access Ollama on a different computer is broken.
Expected behavior
Right now, OI assumes locally running ollama, which may not always be possible. OI should be able to access remote ollama instance.
Screenshots
No response
Open Interpreter version
0.2.4
Python version
3.10.12
Operating System name and version
Ubuntu
Additional context
No response
maybe you need use --api_base http://192.168.2.162:11434/v1 or --api_base http://192.168.2.162:11434
same as above...
interpreter --api_base "http://your_ollama_server:11434/v1" --model ollama_model_name
##Example
interpreter --api_base "http://192.168.0.10:11434/v1" --model llama3:instruct
#1032
$ interpreter -y --context_window 1000 --api_base "http://192.168.2.162:11434" --model ollama/codestral:22b-v0.1-f16 --api_key "fake_key"
[Errno 2] No such file or directory: 'ollama'
▌ Ollama not found
Please download Ollama from ollama.com to use codestral:22b-v0.1-f16.
I get the same error with --api_base "http://192.168.2.162:11434/v1"
If I remove ollama from the mode, I get a very different error.
$ interpreter -y --context_window 1000 --api_base http://192.168.2.162:11434/v1 --model llama3 --api_key "fake_key"
> list the files in the current folder
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yield
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
raise exc from None
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
response = connection.handle_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 99, in handle_request
raise exc
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 76, in handle_request
stream = self._connect(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 122, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp
with map_exceptions(exc_map):
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 962, in _request
response = self._client.send(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 914, in send
response = self._send_handling_auth(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 736, in completion
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 655, in completion
return self.streaming(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 833, in streaming
response = openai_client.chat.completions.create(**data, timeout=timeout)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_utils/_utils.py", line 277, in wrapper
return func(*args, **kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 640, in create
return self._post(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1250, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 931, in request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 996, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/main.py", line 1112, in completion
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/main.py", line 1085, in completion
response = openai_chat_completions.completion(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 744, in completion
raise OpenAIError(status_code=500, message=traceback.format_exc())
litellm.llms.openai.OpenAIError: Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yield
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
raise exc from None
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
response = connection.handle_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 99, in handle_request
raise exc
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 76, in handle_request
stream = self._connect(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 122, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp
with map_exceptions(exc_map):
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 962, in _request
response = self._client.send(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 914, in send
response = self._send_handling_auth(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 736, in completion
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 655, in completion
return self.streaming(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 833, in streaming
response = openai_client.chat.completions.create(**data, timeout=timeout)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_utils/_utils.py", line 277, in wrapper
return func(*args, **kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 640, in create
return self._post(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1250, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 931, in request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 996, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/llm/llm.py", line 370, in fixed_litellm_completions
yield from litellm.completion(**params)
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 3472, in wrapper
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 3363, in wrapper
result = original_function(*args, **kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/main.py", line 2480, in completion
raise exception_type(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 9927, in exception_type
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 8561, in exception_type
raise APIError(
litellm.exceptions.APIError: APIError: OpenAIException - Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yield
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
raise exc from None
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
response = connection.handle_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 99, in handle_request
raise exc
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 76, in handle_request
stream = self._connect(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 122, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp
with map_exceptions(exc_map):
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 962, in _request
response = self._client.send(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 914, in send
response = self._send_handling_auth(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 736, in completion
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 655, in completion
return self.streaming(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 833, in streaming
response = openai_client.chat.completions.create(**data, timeout=timeout)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_utils/_utils.py", line 277, in wrapper
return func(*args, **kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 640, in create
return self._post(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1250, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 931, in request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 996, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/respond.py", line 79, in respond
for chunk in interpreter.llm.run(messages_for_llm):
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/llm/llm.py", line 275, in run
yield from run_text_llm(self, params)
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/llm/run_text_llm.py", line 20, in run_text_llm
for chunk in llm.completions(**params):
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/llm/llm.py", line 373, in fixed_litellm_completions
raise first_error
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/llm/llm.py", line 354, in fixed_litellm_completions
yield from litellm.completion(**params)
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 3472, in wrapper
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 3363, in wrapper
result = original_function(*args, **kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/main.py", line 2480, in completion
raise exception_type(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 9927, in exception_type
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 8561, in exception_type
raise APIError(
litellm.exceptions.APIError: APIError: OpenAIException - Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yield
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
raise exc from None
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
response = connection.handle_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 99, in handle_request
raise exc
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 76, in handle_request
stream = self._connect(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 122, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp
with map_exceptions(exc_map):
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 962, in _request
response = self._client.send(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 914, in send
response = self._send_handling_auth(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 736, in completion
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 655, in completion
return self.streaming(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 833, in streaming
response = openai_client.chat.completions.create(**data, timeout=timeout)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_utils/_utils.py", line 277, in wrapper
return func(*args, **kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 640, in create
return self._post(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1250, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 931, in request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 996, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/arsaboo/.local/bin/interpreter", line 8, in <module>
sys.exit(main())
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/terminal_interface/start_terminal_interface.py", line 520, in main
start_terminal_interface(interpreter)
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/terminal_interface/start_terminal_interface.py", line 486, in start_terminal_interface
interpreter.chat()
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/core.py", line 202, in chat
for _ in self._streaming_chat(message=message, display=display):
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/core.py", line 234, in _streaming_chat
yield from terminal_interface(self, message)
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/terminal_interface/terminal_interface.py", line 140, in terminal_interface
for chunk in interpreter.chat(message, display=False, stream=True):
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/core.py", line 273, in _streaming_chat
yield from self._respond_and_store()
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/core.py", line 323, in _respond_and_store
for chunk in respond(self):
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/respond.py", line 102, in respond
raise Exception(
Exception: Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yield
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
raise exc from None
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
response = connection.handle_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 99, in handle_request
raise exc
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 76, in handle_request
stream = self._connect(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 122, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp
with map_exceptions(exc_map):
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 962, in _request
response = self._client.send(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 914, in send
response = self._send_handling_auth(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 736, in completion
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 655, in completion
return self.streaming(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 833, in streaming
response = openai_client.chat.completions.create(**data, timeout=timeout)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_utils/_utils.py", line 277, in wrapper
return func(*args, **kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 640, in create
return self._post(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1250, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 931, in request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 996, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/main.py", line 1112, in completion
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/main.py", line 1085, in completion
response = openai_chat_completions.completion(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 744, in completion
raise OpenAIError(status_code=500, message=traceback.format_exc())
litellm.llms.openai.OpenAIError: Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yield
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
raise exc from None
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
response = connection.handle_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 99, in handle_request
raise exc
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 76, in handle_request
stream = self._connect(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 122, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp
with map_exceptions(exc_map):
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 962, in _request
response = self._client.send(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 914, in send
response = self._send_handling_auth(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 736, in completion
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 655, in completion
return self.streaming(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 833, in streaming
response = openai_client.chat.completions.create(**data, timeout=timeout)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_utils/_utils.py", line 277, in wrapper
return func(*args, **kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 640, in create
return self._post(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1250, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 931, in request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 996, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/llm/llm.py", line 370, in fixed_litellm_completions
yield from litellm.completion(**params)
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 3472, in wrapper
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 3363, in wrapper
result = original_function(*args, **kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/main.py", line 2480, in completion
raise exception_type(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 9927, in exception_type
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 8561, in exception_type
raise APIError(
litellm.exceptions.APIError: APIError: OpenAIException - Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yield
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
raise exc from None
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
response = connection.handle_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 99, in handle_request
raise exc
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 76, in handle_request
stream = self._connect(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 122, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp
with map_exceptions(exc_map):
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 962, in _request
response = self._client.send(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 914, in send
response = self._send_handling_auth(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 736, in completion
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 655, in completion
return self.streaming(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 833, in streaming
response = openai_client.chat.completions.create(**data, timeout=timeout)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_utils/_utils.py", line 277, in wrapper
return func(*args, **kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 640, in create
return self._post(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1250, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 931, in request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 996, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/respond.py", line 79, in respond
for chunk in interpreter.llm.run(messages_for_llm):
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/llm/llm.py", line 275, in run
yield from run_text_llm(self, params)
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/llm/run_text_llm.py", line 20, in run_text_llm
for chunk in llm.completions(**params):
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/llm/llm.py", line 373, in fixed_litellm_completions
raise first_error
File "/home/arsaboo/.local/lib/python3.10/site-packages/interpreter/core/llm/llm.py", line 354, in fixed_litellm_completions
yield from litellm.completion(**params)
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 3472, in wrapper
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 3363, in wrapper
result = original_function(*args, **kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/main.py", line 2480, in completion
raise exception_type(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 9927, in exception_type
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/utils.py", line 8561, in exception_type
raise APIError(
litellm.exceptions.APIError: APIError: OpenAIException - Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yield
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
raise exc from None
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
response = connection.handle_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 99, in handle_request
raise exc
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 76, in handle_request
stream = self._connect(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 122, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp
with map_exceptions(exc_map):
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 962, in _request
response = self._client.send(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 914, in send
response = self._send_handling_auth(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/arsaboo/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 736, in completion
raise e
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 655, in completion
return self.streaming(
File "/home/arsaboo/.local/lib/python3.10/site-packages/litellm/llms/openai.py", line 833, in streaming
response = openai_client.chat.completions.create(**data, timeout=timeout)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_utils/_utils.py", line 277, in wrapper
return func(*args, **kwargs)
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 640, in create
return self._post(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1250, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 931, in request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 986, in _request
return self._retry_request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 1063, in _retry_request
return self._request(
File "/home/arsaboo/.local/lib/python3.10/site-packages/openai/_base_client.py", line 996, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
There might be an issue with your API key(s).
To reset your API key (we'll use OPENAI_API_KEY for this example, but you may need to reset your ANTHROPIC_API_KEY, HUGGINGFACE_API_KEY, etc):
Mac/Linux: 'export OPENAI_API_KEY=your-key-here'. Update your ~/.zshrc on MacOS or ~/.bashrc on Linux with the new key if it has already been persisted there.,
Windows: 'setx OPENAI_API_KEY your-key-here' then restart terminal.
Just to confirm that Ollama is working and that model is available, the following works:
curl http://192.168.2.162:11434/api/chat -d '{
"model": "codestral:22b-v0.1-f16",
"messages": [
{
"role": "user",
"content": "why is the sky blue?"
}
]
}'
I don't believe /v1 is needed anymore, neither is the api key.
新版的,命令行下无法访问ollama
在python中调用又没有问题:
不错,终于正常了,功能回来了。:)