Metadata-Version: 2.1
Name: cua-agent
Version: 0.4.33
Summary: CUA (Computer Use) Agent for AI-driven computer interaction
Author-Email: TryCua <gh@trycua.com>
Requires-Python: >=3.12
Requires-Dist: httpx>=0.27.0
Requires-Dist: aiohttp>=3.9.3
Requires-Dist: asyncio
Requires-Dist: anyio>=4.4.1
Requires-Dist: typing-extensions>=4.12.2
Requires-Dist: pydantic>=2.6.4
Requires-Dist: rich>=13.7.1
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: cua-computer<0.5.0,>=0.4.0
Requires-Dist: cua-core<0.2.0,>=0.1.8
Requires-Dist: certifi>=2024.2.2
Requires-Dist: litellm>=1.74.12
Provides-Extra: openai
Provides-Extra: anthropic
Provides-Extra: omni
Requires-Dist: cua-som<0.2.0,>=0.1.0; extra == "omni"
Provides-Extra: uitars
Provides-Extra: uitars-mlx
Requires-Dist: mlx-vlm>=0.1.27; sys_platform == "darwin" and extra == "uitars-mlx"
Provides-Extra: uitars-hf
Requires-Dist: accelerate; extra == "uitars-hf"
Requires-Dist: torch; extra == "uitars-hf"
Requires-Dist: transformers>=4.54.0; extra == "uitars-hf"
Provides-Extra: glm45v-hf
Requires-Dist: accelerate; extra == "glm45v-hf"
Requires-Dist: torch; extra == "glm45v-hf"
Requires-Dist: transformers-v4.55.0-GLM-4.5V-preview; extra == "glm45v-hf"
Provides-Extra: opencua-hf
Requires-Dist: accelerate; extra == "opencua-hf"
Requires-Dist: torch; extra == "opencua-hf"
Requires-Dist: transformers==4.53.0; extra == "opencua-hf"
Requires-Dist: tiktoken>=0.11.0; extra == "opencua-hf"
Requires-Dist: blobfile>=3.0.0; extra == "opencua-hf"
Provides-Extra: internvl-hf
Requires-Dist: accelerate; extra == "internvl-hf"
Requires-Dist: torch; extra == "internvl-hf"
Requires-Dist: transformers>=4.55.0; extra == "internvl-hf"
Requires-Dist: einops; extra == "internvl-hf"
Requires-Dist: timm; extra == "internvl-hf"
Provides-Extra: ui
Requires-Dist: gradio>=5.23.3; extra == "ui"
Requires-Dist: python-dotenv>=1.0.1; extra == "ui"
Provides-Extra: cli
Requires-Dist: yaspin>=3.1.0; extra == "cli"
Provides-Extra: hud
Requires-Dist: hud-python==0.4.52; extra == "hud"
Provides-Extra: gemini
Requires-Dist: google-genai>=1.41.0; extra == "gemini"
Provides-Extra: all
Requires-Dist: mlx-vlm>=0.1.27; sys_platform == "darwin" and extra == "all"
Requires-Dist: accelerate; extra == "all"
Requires-Dist: torch; extra == "all"
Requires-Dist: transformers>=4.55.0; extra == "all"
Requires-Dist: einops; extra == "all"
Requires-Dist: timm; extra == "all"
Requires-Dist: tiktoken>=0.11.0; extra == "all"
Requires-Dist: blobfile>=3.0.0; extra == "all"
Requires-Dist: gradio>=5.23.3; extra == "all"
Requires-Dist: python-dotenv>=1.0.1; extra == "all"
Requires-Dist: yaspin>=3.1.0; extra == "all"
Requires-Dist: hud-python==0.4.52; extra == "all"
Requires-Dist: google-genai>=1.41.0; extra == "all"
Description-Content-Type: text/markdown

<div align="center">
<h1>
  <div class="image-wrapper" style="display: inline-block;">
    <picture>
      <source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_white.png" style="display: block; margin: auto;">
      <source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_black.png" style="display: block; margin: auto;">
      <img alt="Shows my svg">
    </picture>
  </div>

  [![Python](https://img.shields.io/badge/Python-333333?logo=python&logoColor=white&labelColor=333333)](#)
  [![macOS](https://img.shields.io/badge/macOS-000000?logo=apple&logoColor=F0F0F0)](#)
  [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?&logo=discord&logoColor=white)](https://discord.com/invite/mVnXXpdE85)
  [![PyPI](https://img.shields.io/pypi/v/cua-computer?color=333333)](https://pypi.org/project/cua-computer/)
</h1>
</div>

**cua-agent** is a general Computer-Use framework with liteLLM integration for running agentic workflows on macOS, Windows, and Linux sandboxes. It provides a unified interface for computer-use agents across multiple LLM providers with advanced callback system for extensibility.

## Features

- **Safe Computer-Use/Tool-Use**: Using Computer SDK for sandboxed desktops
- **Multi-Agent Support**: Anthropic Claude, OpenAI computer-use-preview, UI-TARS, Omniparser + any LLM
- **Multi-API Support**: Take advantage of liteLLM supporting 100+ LLMs / model APIs, including local models (`huggingface-local/`, `ollama_chat/`, `mlx/`)
- **Cross-Platform**: Works on Windows, macOS, and Linux with cloud and local computer instances
- **Extensible Callbacks**: Built-in support for image retention, cache control, PII anonymization, budget limits, and trajectory tracking

## Install

```bash
pip install "cua-agent[all]"
```

## Quick Start

```python
import asyncio
import os
from agent import ComputerAgent
from computer import Computer

async def main():
    # Set up computer instance
    async with Computer(
        os_type="linux",
        provider_type="cloud",
        name=os.getenv("CUA_CONTAINER_NAME"),
        api_key=os.getenv("CUA_API_KEY")
    ) as computer:
        
        # Create agent
        agent = ComputerAgent(
            model="anthropic/claude-3-5-sonnet-20241022",
            tools=[computer],
            only_n_most_recent_images=3,
            trajectory_dir="trajectories",
            max_trajectory_budget=5.0  # $5 budget limit
        )
        
        # Run agent
        messages = [{"role": "user", "content": "Take a screenshot and tell me what you see"}]
        
        async for result in agent.run(messages):
            for item in result["output"]:
                if item["type"] == "message":
                    print(item["content"][0]["text"])

if __name__ == "__main__":
    asyncio.run(main())
```

## Docs

- [Agent Loops](https://trycua.com/docs/agent-sdk/agent-loops)
- [Supported Agents](https://trycua.com/docs/agent-sdk/supported-agents)
- [Supported Models](https://trycua.com/docs/agent-sdk/supported-models)
- [Chat History](https://trycua.com/docs/agent-sdk/chat-history)
- [Callbacks](https://trycua.com/docs/agent-sdk/callbacks)
- [Custom Tools](https://trycua.com/docs/agent-sdk/custom-tools)
- [Custom Computer Handlers](https://trycua.com/docs/agent-sdk/custom-computer-handlers)
- [Prompt Caching](https://trycua.com/docs/agent-sdk/prompt-caching)
- [Usage Tracking](https://trycua.com/docs/agent-sdk/usage-tracking)
- [Benchmarks](https://trycua.com/docs/agent-sdk/benchmarks)

## License

MIT License - see LICENSE file for details.