Hacker News 发布:Cua(YC S25)——面向计算机使用代理的开源 Docker 容器
Launch HN: Cua (YC X25) – Open-Source Docker Container for Computer-Use Agents

原始链接: https://github.com/trycua/cua

c/ua(发音为“koo-ah”)是一个框架,使AI代理能够在高性能、隔离的虚拟容器内控制完整的操作系统。它利用Lume CLI和苹果的Virtualization.Framework,在苹果芯片上实现了接近原生速度(高达97%),支持macOS和Linux环境。 主要特性包括: * **高性能虚拟化:** 在苹果芯片上创建和运行接近原生速度的虚拟机。 * **计算机使用接口:** 允许AI代理与虚拟机交互,自动化浏览、编码和应用程序使用等任务。 * **安全与隔离:** 在隔离的虚拟机中运行代理,防止访问主机系统。 * **灵活性:** 支持macOS和Linux环境。 * **可重复性:** 能够创建一致且确定的环境。 * **大型语言模型集成:** 内置支持各种大型语言模型提供商(例如,OpenAI,Anthropic)。 c/ua 需要一台搭载苹果芯片和macOS 15+系统的Mac电脑。安装过程包括安装Lume CLI和Python库。用户可以选择仅使用Lume CLI、完整的代理功能或从源代码构建。该项目鼓励贡献,并提供Discord社区以寻求支持。它是一个根据MIT许可证发布的开源项目。

由Francesco和Alessandro(YC X25)推出的Cua是一个开源的Docker风格容器运行时,允许AI代理在轻量级、隔离的虚拟机中运行完整的操作系统。这个框架基于苹果的Virtualization.Framework构建,确保安全并防止对用户主系统的干扰。Cua允许代理与应用程序交互,读取屏幕内容,并像人类一样执行操作,所有这些都在一个安全的沙盒中进行。 用户可以使用它来自动化各种任务,例如绕过web应用程序加密,自动化Tableau仪表板,驱动Photoshop进行批量编辑,以及从遗留应用程序中提取数据。Cua采用100% MIT许可证,并可与任何大型语言模型(LLM)一起使用。团队正在开发多虚拟机编排、Windows和Linux虚拟机支持以及情景记忆功能。一个托管的编排服务也正在开发中。他们鼓励用户反馈他们希望实现的自动化以及AI体验中容易出错的地方。

原文

TL;DR: c/ua (pronounced "koo-ah", short for Computer-Use Agent) is a framework that enables AI agents to control full operating systems within high-performance, lightweight virtual containers. It delivers up to 97% native speed on Apple Silicon and works with any vision language models.

c/ua offers two primary capabilities in a single integrated framework:

  1. High-Performance Virtualization - Create and run macOS/Linux virtual machines on Apple Silicon with near-native performance (up to 97% of native speed) using the Lume CLI with Apple's Virtualization.Framework.

  2. Computer-Use Interface & Agent - A framework that allows AI systems to observe and control these virtual environments - interacting with applications, browsing the web, writing code, and performing complex workflows.

  • Security & Isolation: Run AI agents in fully isolated virtual environments instead of giving them access to your main system
  • Performance: Near-native performance on Apple Silicon
  • Flexibility: Run macOS or Linux environments with the same framework
  • Reproducibility: Create consistent, deterministic environments for AI agent workflows
  • LLM Integration: Built-in support for connecting to various LLM providers
  • Mac with Apple Silicon (M1/M2/M3/M4 series)
  • macOS 15 (Sequoia) or newer
  • Python 3.10+ (required for the Computer, Agent, and MCP libraries). We recommend using Conda (or Anaconda) to create an ad hoc Python environment.
  • Disk space for VM images (30GB+ recommended)

Option 1: Lume CLI Only (VM Management)

If you only need the virtualization capabilities:

sudo /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"

For Lume usage instructions, refer to the Lume documentation.

Option 2: Full Computer-Use Agent Capabilities

If you want to use AI agents with virtualized environments:

  1. Install the Lume CLI:

    sudo /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"
  2. Pull the latest macOS CUA image:

    lume pull macos-sequoia-cua:latest
  3. Start Lume daemon service:

  4. Install the Python libraries:

    pip install cua-computer cua-agent[all]
  5. Use the libraries in your Python code:

    from computer import Computer
    from agent import ComputerAgent, LLM, AgentLoop, LLMProvider
    
    async with Computer(verbosity=logging.DEBUG) as macos_computer:
      agent = ComputerAgent(
          computer=macos_computer,
          loop=AgentLoop.OPENAI, # or AgentLoop.ANTHROPIC, or AgentLoop.OMNI
          model=LLM(provider=LLMProvider.OPENAI) # or LLM(provider=LLMProvider.ANTHROPIC)
      )
    
      tasks = [
          "Look for a repository named trycua/cua on GitHub.",
      ]
    
      for task in tasks:
        async for result in agent.run(task):
          print(result)

    Explore the Agent Notebook for a ready-to-run example.

  6. Optionally, you can use the Agent with a Gradio UI:

    from utils import load_dotenv_files
    load_dotenv_files()
     
    from agent.ui.gradio.app import create_gradio_ui
    
    app = create_gradio_ui()
    app.launch(share=False)

Option 3: Build from Source (Nightly)

If you want to contribute to the project or need the latest nightly features:

# Clone the repository
git clone https://github.com/trycua/cua.git
cd cua

# Open the project in VSCode
code ./vscode/py.code-workspace

# Build the project
./scripts/build.sh

See our Developer-Guide for more information.

For the best onboarding experience with the packages in this monorepo, we recommend starting with the Computer documentation to cover the core functionality of the Computer sandbox, then exploring the Agent documentation to understand Cua's AI agent capabilities, and finally working through the Notebook examples.

Demos of the Computer-Use Agent in action. Share your most impressive demos in Cua's Discord community!

MCP Server: Work with Claude Desktop and Tableau
AI-Gradio: multi-app workflow requiring browser, VS Code and terminal access
Notebook: Fix GitHub issue in Cursor
notebook-github-cursor.mp4

We welcome and greatly appreciate contributions to Cua! Whether you're improving documentation, adding new features, fixing bugs, or adding new VM images, your efforts help make lume better for everyone. For detailed instructions on how to contribute, please refer to our Contributing Guidelines.

Join our Discord community to discuss ideas or get assistance.

Cua is open-sourced under the MIT License - see the LICENSE file for details.

Microsoft's OmniParser, which is used in this project, is licensed under the Creative Commons Attribution 4.0 International License (CC-BY-4.0) - see the OmniParser LICENSE file for details.

Apple, macOS, and Apple Silicon are trademarks of Apple Inc. Ubuntu and Canonical are registered trademarks of Canonical Ltd. Microsoft is a registered trademark of Microsoft Corporation. This project is not affiliated with, endorsed by, or sponsored by Apple Inc., Canonical Ltd., or Microsoft Corporation.

Stargazers over time

联系我们 contact @ memedata.com