mirror of
https://github.com/trycua/lume.git
synced 2025-12-25 06:10:00 -06:00
3.6 KiB
3.6 KiB
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
pip install "cua-agent[all]"
Quick Start
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-sonnet-4-5-20250929",
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
- Supported Agents
- Supported Models
- Chat History
- Callbacks
- Custom Tools
- Custom Computer Handlers
- Prompt Caching
- Usage Tracking
- Benchmarks
License
MIT License - see LICENSE file for details.