Anthropic Computer Use is a beta Anthropic feature which runs a Docker image with Ubuntu and controls it. This forks allows you to run it on Mac OS.
Caution
This comes with obvious risks. The Anthropic agent can control everything on your Mac. Please be careful. Anthropic's new Claude 3.5 Sonnet model refuses to do unsafe things like purhcase items or download illegal content.
- Clone the repository and navigate to it:
git clone https://github.com/anthropics/claude-computer-use-demo
cd claude-computer-use-demo- Create and activate a virtual environment:
python3.12 -m venv venv
source venv/bin/activate- Run the setup script:
chmod +x setup.sh
./setup.sh- Install Python requirements:
pip install -r requirements.txt- In a
.envfile add:
API_PROVIDER=anthropic
ANTHROPIC_API_KEY=<key>
WIDTH=800
HEIGHT=600
DISPLAY_NUM=1
Set the screen dimensions (recommended: stay within XGA/WXGA resolution), and put in your key from Anthropic Console.
- Start the Streamlit app:
streamlit run streamlit.pyThe interface will be available at http://localhost:8501
We recommend using one of these resolutions for optimal performance:
- XGA: 1024x768 (4:3)
- WXGA: 1280x800 (16:10)
- FWXGA: 1366x768 (~16:9)
Higher resolutions will be automatically scaled down to these targets to optimize model performance. You can set the resolution using environment variables:
export WIDTH=1024
export HEIGHT=768
streamlit run streamlit.pyImportant
The Beta API used in this reference implementation is subject to change. Please refer to the API release notes for the most up-to-date information.