self-operating-computer README

The project's README from github.com/OthersideAI/self-operating-computer. As one markdown file: README.md.

ome

Self-Operating Computer Framework

A framework to enable multimodal models to operate a computer.

Using the same inputs and outputs as a human operator, the model views the screen and decides on a series of mouse and keyboard actions to reach an objective. Released Nov 2023, the Self-Operating Computer Framework was one of the first examples of full computer-use.

Key Features

Demo

https://github.com/OthersideAI/self-operating-computer/assets/42594239/9e8abc96-c76a-46fb-9b13-03678b3c67e0

Run Self-Operating Computer

  1. Install the project
pip install self-operating-computer
  1. Run the project
operate
  1. Enter your OpenAI Key: If you don't have one, you can obtain an OpenAI key here. If you need you change your key at a later point, run vim .env to open the .env and replace the old key.
  1. Give Terminal app the required permissions: As a last step, the Terminal app will ask for permission for "Screen Recording" and "Accessibility" in the "Security & Privacy" page of Mac's "System Preferences".

Using operate Modes

OpenAI models

The default model for the project is gpt-4o which you can use by simply typing operate. To try running OpenAI's new o1 model, use the command below.

operate -m o1-with-ocr

To experiment with OpenAI's latest gpt-4.1 model, run:

operate -m gpt-4.1-with-ocr

Multimodal Models -m

Try Google's gemini-pro-vision by following the instructions below. Start operate with the Gemini model

operate -m gemini-pro-vision

Enter your Google AI Studio API key when terminal prompts you for it If you don't have one, you can obtain a key here after setting up your Google AI Studio account. You may also need authorize credentials for a desktop application. It took me a bit of time to get it working, if anyone knows a simpler way, please make a PR.

Try Claude -m claude-3

Use Claude 3 with Vision to see how it stacks up to GPT-4-Vision at operating a computer. Navigate to the Claude dashboard to get an API key and run the command below to try it.

operate -m claude-3

Try qwen -m qwen-vl

Use Qwen-vl with Vision to see how it stacks up to GPT-4-Vision at operating a computer. Navigate to the Qwen dashboard to get an API key and run the command below to try it.

operate -m qwen-vl

Try LLaVa Hosted Through Ollama -m llava

If you wish to experiment with the Self-Operating Computer Framework using LLaVA on your own machine, you can with Ollama!
Note: Ollama currently only supports MacOS and Linux. Windows now in Preview

First, install Ollama on your machine from https://ollama.ai/download.

Once Ollama is installed, pull the LLaVA model:

ollama pull llava

This will download the model on your machine which takes approximately 5 GB of storage.

When Ollama has finished pulling LLaVA, start the server:

ollama serve

That's it! Now start operate and select the LLaVA model:

operate -m llava

Important: Error rates when using LLaVA are very high. This is simply intended to be a base to build off of as local multimodal models improve over time.

Learn more about Ollama at its GitHub Repository

Voice Mode --voice

The framework supports voice inputs for the objective. Try voice by following the instructions below. Clone the repo to a directory on your computer:

git clone https://github.com/OthersideAI/self-operating-computer.git

Cd into directory:

cd self-operating-computer

Install the additional requirements-audio.txt

pip install -r requirements-audio.txt

Install device requirements For mac users:

brew install portaudio

For Linux users:

sudo apt install portaudio19-dev python3-pyaudio

Run with voice mode

operate --voice

Optical Character Recognition Mode -m gpt-4-with-ocr

The Self-Operating Computer Framework now integrates Optical Character Recognition (OCR) capabilities with the gpt-4-with-ocr mode. This mode gives GPT-4 a hash map of clickable elements by coordinates. GPT-4 can decide to click elements by text and then the code references the hash map to get the coordinates for that element GPT-4 wanted to click.

Based on recent tests, OCR performs better than som and vanilla GPT-4 so we made it the default for the project. To use the OCR mode you can simply write:

operate or operate -m gpt-4-with-ocr will also work.

Set-of-Mark Prompting -m gpt-4-with-som

The Self-Operating Computer Framework now supports Set-of-Mark (SoM) Prompting with the gpt-4-with-som command. This new visual prompting method enhances the visual grounding capabilities of large multimodal models.

Learn more about SoM Prompting in the detailed arXiv paper: here.

For this initial version, a simple YOLOv8 model is trained for button detection, and the best.pt file is included under model/weights/. Users are encouraged to swap in their best.pt file to evaluate performance improvements. If your model outperforms the existing one, please contribute by creating a pull request (PR).

Start operate with the SoM model

operate -m gpt-4-with-som

Contributions are Welcomed!:

If you want to contribute yourself, see CONTRIBUTING.md.

Feedback

For any input on improving this project, feel free to reach out to Josh on Twitter.

Join Our Discord Community

For real-time discussions and community support, join our Discord server.

Follow HyperWriteAI for More Updates

Stay updated with the latest developments:

Compatibility

OpenAI Rate Limiting Note

The gpt-4o model is required. To unlock access to this model, your account needs to spend at least $5 in API credits. Pre-paying for these credits will unlock access if you haven't already spent the minimum $5.
Learn more here

self-operating-computer (OthersideAI/self-operating-computer)

Searching Database…

这是什么东西?一个能让多模态 AI 模型操作你电脑的框架:它会看屏幕画面,然后发出鼠标和键盘操作来完成你交给它的目标。属于最早一批完整的电脑操作项目之一(2023 年 11 月)。
那它到底是怎么控制电脑的——是一个单独的应用吗?不是,它是一个 Python 框架,在终端里用 'operate' 命令运行。它会根据屏幕上看到的内容,直接控制你真实的鼠标和键盘。
我怎么把它跑起来?先安装这个 Python 包,然后运行 'operate' 并粘贴你的 OpenAI API 密钥(密钥会存到一个 .env 文件里,以后可以自己改)。在 macOS 上,还需要在系统偏好设置里给终端授予屏幕录制和辅助功能权限。
它能用哪些 AI 模型——是不是只能用 OpenAI 的密钥?不是,它支持多种多模态模型:GPT-4o、GPT-4.1、o1、Gemini Pro Vision、Claude 3、Qwen-VL,以及通过 Ollama 运行的 LLaVa。提示输入哪家的 API 密钥,就填哪家的;默认用的是 GPT-4o。
OpenAI 的模式用起来之前有什么坑吗?有,它依赖的视觉模型有门槛:你的 OpenAI 账户必须累计消费过至少 5 美元的 API 额度,所以哪怕只是想快速试一下,也可能得先充值这个最低金额。
它能在 Windows 上用吗,还是只支持 Mac?三大桌面系统都支持:Mac OS、Windows 和 Linux,不过 Linux 上需要装一个 X server。通过 Ollama 跑本地模型的方式只覆盖 macOS 和 Linux。
我能用本地模型来跑、不走云端 API 吗?可以,用 LLaVA 模式:安装 Ollama,下载 LLaVA 模型(大约 5 GB),启动 Ollama 服务,然后运行 'operate -m llava'。不过要提醒一句:目前出错率非常高,README 也说这只是个基础,等本地模型进步后再往上搭。
它怎么知道该点哪里?默认模式 gpt-4-with-ocr 会把可点击元素及其坐标的哈希表给到 GPT-4,这样它能根据文字选中目标,再由代码解析出具体坐标。近期的测试显示 OCR 的效果超过了 Set-of-Mark 和原生 GPT-4,所以它才被设为默认。
这个项目里的 Set-of-Mark 提示是什么?就是 -m gpt-4-with-som 模式:一种视觉提示技术,用来提升模型的视觉定位能力。标记由一个专门训练做按钮检测的 YOLOv8 模型提供,权重文件 best.pt 放在 model/weights/ 目录下,你可以换成自己训练的。
我能用语音给它下达目标吗?可以,加上 --voice 参数运行就行。语音功能在克隆仓库后还需要额外配置:安装 requirements-audio.txt 以及对应设备的依赖(Mac 和 Linux 各有单独的步骤)。
Size
12.6 MB
Stars
10.3K
Age
2y
Commits · 90 Days