. OpenHands works on GPU-based VMs as well, performance is better and faster than CPU VM on GPU VM. The installation process remains largely the same, allowing you to achieve similar functionality on a GPU-powered machine. NodeShift’s infrastructure is versatile, enabling you to choose between GPU or CPU configurations based on your specific needs and budget.
Let’s dive into the setup and installation steps to get OpenHands running efficiently on your chosen virtual machine.
Step 1: Sign Up and Set Up a NodeShift Cloud Account
- Visit the
Step 2: Create a Compute Node (CPU Virtual Machine)
NodeShift Compute Nodes offers flexible and scalable on-demand resources like NodeShift Virtual Machines which are easily deployed and come with general-purpose, CPU-powered, or storage-optimized nodes.
- Navigate to the menu on the left side.
- Select the Compute Nodes option.
- Click the Create Compute Nodes button in the Dashboard to create your first deployment.
Step 4: Choose an Image
Next, you will need to choose an image for your Virtual Machine. We will deploy the VM on Ubuntu, but you can choose according to your preference. Other options like CentOS and Debian are also available to Install OpenHands.
Step 7: Virtual Machine Successfully Deployed
You will get visual confirmation that your node is up and running.
Step 9: Install Docker
Run the following command to update your package list:
sudo apt update
Next, run the following commands to enable, start and verify docker installation:
sudo systemctl enable docker
sudo systemctl start docker
docker --version
Step 11: Run OpenHands
Execute the following command to run the OpenHands:
docker run -it --pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.13-nikolaik \
-v /var/run/docker.sock:/var/run/docker.sock \
-p 3000:3000 \
-e LOG_ALL_EVENTS=true \
--add-host host.docker.internal:host-gateway \
--name openhands-app \
docker.all-hands.dev/all-hands-ai/openhands:0.13
Step 13: Access Openhands on Browser
After installation and SSH port forwarding, access OpenHands by navigating to
Step 14: AI Provider Configuration
OpenHands supports various language models through the litellm library. By default, it uses GPT-4 from OpenAI, but you can configure it to use other models like Claude or Llama.
During this step, you will be prompted to enter:
- LLM API Key
- Model Name
- Other relevant variables
Note: If you've previously run OpenHands using Docker, some environment variables may already be set. The configuration priority is as follows:
- Environment variables
- config.toml variables
- Default variables
For a complete list of available LMs and providers, refer to the litellm documentation.
- Generate the Key:
After clicking on create, a new API key will be generated for you. Make sure to copy this key immediately as it will only be shown once.
Step 17: Enter Your API Key
- In the OpenAI configuration section, you will see a field labeled API Key.
- Paste your previously copied OpenAI API key into this field. Ensure there are no extra spaces before or after the key and save it.
Step 19: Give Prompt and Generate Output
Prompt: Build a Todo List in ReactJS
Conclusion
In this guide, we explain the OpenHands AI open-source coding tool and provide a step-by-step tutorial on installing OpenHands AI Engineer locally on a NodeShift virtual machine. You'll learn how to install the required software, set up essential tools like Docker, and build your first app with OpenHands AI.
For more information about NodeShift:
Website
Docs
LinkedIn
X
Discord
daily.dev
SOCIAL SHARE CARD GENERATOR