All-Hands-AI / OpenHands

🙌 OpenHands: Code Less, Make More
https://all-hands.dev
MIT License
31.38k stars 3.62k forks source link

Support for Bedrock Claude3 #1242

Closed djaym7 closed 5 months ago

djaym7 commented 5 months ago

What problem or use case are you trying to solve? Supporting bedrock models

Describe the UX of the solution you'd like aws keys input and read

Do you have thoughts on the technical implementation? from langchain.. import BedrockChat

Describe alternatives you've considered

Additional context

mahiatlinux commented 5 months ago

OpenDevin supports all LLMS that can be accesed through LiteLLM. https://docs.litellm.ai/docs/providers/bedrock And LiteLLM supports Claude 3 on Bedrock.

rbren commented 5 months ago

@djaym7 you may need to pass your AWS keys in with -e, but this is indeed supported

djaym7 commented 5 months ago
image

i'm running the command above, in the UI it shows this:

image

and in the logs it shows this :

INFO: Started server process [1] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:3000 (Press CTRL+C to quit) INFO: 240.10.0.1:48164 - "GET / HTTP/1.1" 307 Temporary Redirect INFO: ('240.10.0.1', 48172) - "WebSocket /ws?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzaWQiOiIwZTA1YTNjZi1jMGY3LTQxNDktODU2YS02MzkxODgyMDIyYTgifQ.X82Uhn-Nse6szDUDHcsZWFkiFcW9L6uRo6xHsFJI9l4" [accepted] INFO: connection open Starting loop_recv for sid: 0e05a3cf-c0f7-4149-856a-6391882022a8 INFO: 240.10.0.1:48164 - "GET /api/refresh-files HTTP/1.1" 200 OK INFO: 240.10.0.1:48154 - "GET /api/configurations HTTP/1.1" 200 OK INFO: 240.10.0.1:48154 - "GET /api/configurations HTTP/1.1" 200 OK 20:31:19 - opendevin:INFO: ssh_box.py:271 - Container stopped 20:31:19 - opendevin:WARNING: ssh_box.py:283 - Using port forwarding for Mac OS. Server started by OpenDevin will not be accessible from the host machine at the moment. See https://github.com/OpenDevin/OpenDevin/issues/897 for more information. 20:31:20 - opendevin:INFO: ssh_box.py:309 - Container started 20:31:21 - opendevin:INFO: ssh_box.py:326 - waiting for container to start: 1, container status: running 20:31:21 - opendevin:INFO: ssh_box.py:161 - Connecting to root@host.docker.internal via ssh. If you encounter any issues, you can try ssh -v -p 59533 root@host.docker.internal with the password '9b7d7f3c-3246-46d7-8f3f-664168562641' and report the issue on GitHub. 20:31:21 - opendevin:ERROR: agent.py:127 - Error creating controller: Could not establish connection to host Traceback (most recent call last): File "/app/opendevin/server/agent/agent.py", line 118, in create_controller self.controller = AgentController( ^^^^^^^^^^^^^^^^ File "/app/opendevin/controller/agent_controller.py", line 51, in init self.command_manager = CommandManager(self.id, container_image) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/opendevin/controller/command_manager.py", line 26, in init self.shell = DockerSSHBox( ^^^^^^^^^^^^^ File "/app/opendevin/sandbox/ssh_box.py", line 90, in init self.start_ssh_session() File "/app/opendevin/sandbox/ssh_box.py", line 164, in start_ssh_session self.ssh.login(hostname, username, self._ssh_password, File "/app/.venv/lib/python3.12/site-packages/pexpect/pxssh.py", line 424, in login raise ExceptionPxssh('Could not establish connection to host') pexpect.pxssh.ExceptionPxssh: Could not establish connection to host Mounting workspace directory: /home/jdesa/Agent/OpenDevin/workspace INFO: 240.10.0.1:48180 - "GET /api/messages/total HTTP/1.1" 200 OK 20:31:23 - opendevin:INFO: ssh_box.py:271 - Container stopped 20:31:23 - opendevin:WARNING: ssh_box.py:283 - Using port forwarding for Mac OS. Server started by OpenDevin will not be accessible from the host machine at the moment. See https://github.com/OpenDevin/OpenDevin/issues/897 for more information. 20:31:23 - opendevin:INFO: ssh_box.py:309 - Container started 20:31:24 - opendevin:INFO: ssh_box.py:326 - waiting for container to start: 1, container status: running 20:31:24 - opendevin:INFO: ssh_box.py:161 - Connecting to root@host.docker.internal via ssh. If you encounter any issues, you can try ssh -v -p 57227 root@host.docker.internal with the password 'a18d377b-b300-41b5-9d28-2954a08ca8c3' and report the issue on GitHub. 20:31:24 - opendevin:ERROR: agent.py:127 - Error creating controller: Could not establish connection to host Traceback (most recent call last): File "/app/opendevin/server/agent/agent.py", line 118, in create_controller self.controller = AgentController( ^^^^^^^^^^^^^^^^ File "/app/opendevin/controller/agent_controller.py", line 51, in init self.command_manager = CommandManager(self.id, container_image) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/opendevin/controller/command_manager.py", line 26, in init self.shell = DockerSSHBox( ^^^^^^^^^^^^^ File "/app/opendevin/sandbox/ssh_box.py", line 90, in init self.start_ssh_session() File "/app/opendevin/sandbox/ssh_box.py", line 164, in start_ssh_session self.ssh.login(hostname, username, self._ssh_password, File "/app/.venv/lib/python3.12/site-packages/pexpect/pxssh.py", line 424, in login raise ExceptionPxssh('Could not establish connection to host') pexpect.pxssh.ExceptionPxssh: Could not establish connection to host Mounting workspace directory: /home/jdesa/Agent/OpenDevin/workspace INFO: 240.10.0.1:48154 - "GET /api/messages/total HTTP/1.1" 200 OK

rbren commented 5 months ago

Looks like you're hitting https://github.com/OpenDevin/OpenDevin/issues/1156

Solution is now in the readme