Thanks to visit codestin.com
Credit goes to github.com

Skip to content

hopx-ai/hopx

Hopx - Cloud Sandboxes for AI Agents

PyPI version npm version License: MIT

Official SDKs for Hopx.ai - Secure, isolated cloud sandboxes that spin up in ~100ms.

🚀 What is Hopx?

Hopx provides lightweight VM sandboxes perfect for:

  • 🤖 AI Agents - Safe code execution environments for LLMs
  • 🔬 Code Execution - Run untrusted code securely
  • 🧪 Testing - Isolated environments for integration tests
  • 📊 Data Processing - Execute scripts with rich output capture

📦 Available SDKs

Python SDK

pip install hopx-ai

📖 Python Documentation

from hopx_ai import Sandbox

sandbox = Sandbox.create(template="python")
result = sandbox.run_code("print('Hello, Hopx!')")
print(result.stdout)  # "Hello, Hopx!"
sandbox.kill()

JavaScript/TypeScript SDK

npm install @hopx-ai/sdk

📖 JavaScript Documentation

import { Sandbox } from '@hopx-ai/sdk';

const sandbox = await Sandbox.create({ template: 'nodejs' });
const result = await sandbox.runCode("console.log('Hello, Hopx!')");
console.log(result.stdout);  // "Hello, Hopx!"
await sandbox.kill();

Ask DeepWiki

✨ Features

  • Fast - Sandbox creation in ~100ms
  • 🔐 Secure - Isolated VM environments
  • 🌍 Multi-language - Python, Node.js, Go, Rust, Java, and more
  • 📊 Rich Outputs - Capture charts, tables, and visualizations
  • 🗂️ File Operations - Full filesystem access
  • 🖥️ Desktop Support - VNC, mouse, keyboard control (Premium)
  • 🔧 Template Building - Create custom environments
  • 📡 Real-time - WebSocket streaming support

📚 Quick Links

🏗️ Repository Structure

hopx/
├── python/          # Python SDK
│   ├── hopx_ai/    # Source code
│   ├── examples/   # Usage examples
│   └── README.md   # Python docs
├── javascript/      # JavaScript/TypeScript SDK
│   ├── src/        # Source code
│   ├── examples/   # Usage examples
│   └── README.md   # JavaScript docs
└── cookbook/        # Advanced examples
    ├── python/
    └── javascript/

🎯 Example Use Cases

AI Code Agent

# Your AI generates code, Hopx executes it safely
sandbox = Sandbox.create(template="python")
result = sandbox.run_code(agent_generated_code)
if result.success:
    return result.stdout

Data Visualization

# Automatically capture charts
code = """
import matplotlib.pyplot as plt
plt.plot([1, 2, 3], [1, 4, 9])
plt.show()
"""
result = sandbox.run_code(code)
png_data = result.rich_outputs[0].data  # Base64 PNG

Multi-Step Workflow

const sandbox = await Sandbox.create({ template: 'nodejs' });

await sandbox.commands.run('git clone https://github.com/user/repo /app');
await sandbox.commands.run('cd /app && npm install');
const result = await sandbox.commands.run('cd /app && npm test');

console.log(result.exitCode === 0 ? '✅ PASSED' : '❌ FAILED');

🤝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Quick start:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing
  3. Make your changes
  4. Run tests: pytest (Python) or npm test (JavaScript)
  5. Submit a pull request

📄 License

MIT License - see LICENSE file for details.

🆘 Support

🔐 Security

Found a security issue? Please report it to [email protected] instead of opening a public issue.

See SECURITY.md for our security policy.


Built with ❤️ by the Hopx team

WebsiteDocumentationTwitterDiscord

About

The Cloud for AI Agents — secure, real-world environments that spin up in milliseconds.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 5