Introduction
This lab guides you through Claude 3.5 Sonnet's computer interaction capabilities using the Anthropic Computer Use Demo. Through hands-on exercises with Anthropic's official demo environment, you'll experience how Claude's Computer Use features enable real-world computing tasks - from managing applications and installing software to monitoring system resources. This practical tutorial showcases Claude's advanced computer interaction abilities, demonstrating how Anthropic's AI technology can understand and execute complex system operations while maintaining security and safety protocols.
Updated
Try the Anthropic Computer Use Demo instantly, no installation required.
If you want to deploy the demo step by step, follow the instructions below.
Preview
Setting Up Your API Key
First, we need to set up the Anthropic API key to allow Claude to authenticate.
- Export your Anthropic API key as an environment variable:
export ANTHROPIC_API_KEY=your_api_key_here
Replace your_api_key_here
with your actual Anthropic API key.
Note 1: If you don't have an Anthropic API key, you can request one by following the instructions in the Anthropic API Key Guide.
Note 2: LabEx VM does not save your API key, and the environment will be deleted after use.
Running the Demo Container
Now, let's start the Computer Use Demo container with the necessary configurations.
- Run the Docker container:
docker run \
-e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
-v $HOME/.anthropic:/home/computeruse/.anthropic \
-p 5900:5900 \
-p 8501:8501 \
-p 6080:6080 \
-p 8080:8080 \
-e WIDTH=1024 \
-e HEIGHT=768 \
-it ghcr.io/anthropics/anthropic-quickstarts:computer-use-demo-latest
You can copy the command above and use the right-click menu in the terminal to paste it.
- Wait for the container to initialize (1~3 minutes). You'll see several startup messages in your terminal.
When the container is ready, you'll see the message: Computer Use Demo is ready!
Accessing the Demo Interface
Let's open the demo interface in Firefox and start interacting with Claude.
- Open a new terminal window to run the following command:
firefox http://localhost:8080
Or, you can click the Firefox icon on the desktop to open the browser. Then, enter the following URL in the address bar: http://localhost:8080
.
This will open the combined interface that shows both the chat and desktop view.
- Wait for the interface to load completely. You should see a chat panel and a virtual desktop view.
Trying Out Computer Interaction
Let's test Claude's computer interaction capabilities with a practical example.
- In the chat interface, enter the following request:
Open a terminal, install htop and open it.
- Watch as Claude automatically:
- Opens a terminal
- Uses apt-get to install htop
- Launches htop in the terminal
- Observe htop's system monitor interface in the desktop view.
- You can prompt Claude to perform other tasks or explore the system using the chat interface. Try asking Claude to open applications, run commands, or provide information about the system.
Note: LabEx VM will automatically destroy the environment after the countdown timer ends (top-right corner).
Summary
In this lab, you've learned how to:
- Configure the necessary API key for Claude
- Launch the Computer Use Demo container
- Access the demo interface through a web browser
- Interact with Claude to perform real computer tasks
You've seen how Claude can understand and execute computer commands, install software, and interact with applications. This demonstrates the potential of AI systems to assist with practical computing tasks while maintaining appropriate safety measures.
Remember that this is a beta feature, and Claude will always prioritize safe and responsible computer interaction. Feel free to explore more commands and interactions, but be mindful of the system's safety boundaries and limitations.
๐ Practice Now: Getting Started with Claude's Computer Use Demo
Want to Learn More?
- ๐ณ Learn the latest Docker Skill Trees
- ๐ Read More Docker Tutorials
- ๐ฌ Join our Discord or tweet us @WeAreLabEx
Top comments (0)