Metadata-Version: 2.4
Name: forgevm
Version: 0.1.2
Summary: Python SDK for ForgeVM — self-hosted microVM sandboxes for LLMs
Author: DohaerisAI
License: MIT
Project-URL: Homepage, https://github.com/DohaerisAI/forgevm
Project-URL: Repository, https://github.com/DohaerisAI/forgevm
Project-URL: Documentation, https://github.com/DohaerisAI/forgevm#use-with-python
Project-URL: Issues, https://github.com/DohaerisAI/forgevm/issues
Keywords: forgevm,sandbox,microvm,llm,code-execution,firecracker,ai-agent
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Emulators
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-httpx>=0.30.0; extra == "dev"

# ForgeVM Python SDK

Python client for [ForgeVM](https://github.com/DohaerisAI/forgevm) -- self-hosted compute sandboxes for LLMs.

## Install

```bash
pip install forgevm
```

## Quick Start

```python
from forgevm import Client

client = Client("http://localhost:7423")

# Spawn a sandbox
sandbox = client.spawn(image="alpine:latest")

# Execute commands
result = sandbox.exec("echo hello")
print(result.stdout)  # "hello\n"

# File operations
sandbox.write_file("/tmp/hello.txt", "Hello, world!")
content = sandbox.read_file("/tmp/hello.txt")

# Extend TTL
sandbox.extend_ttl("30m")

# Auto-cleanup with context manager
with client.spawn(image="python:3.12") as sb:
    sb.exec("python3 -c 'print(1+1)'")
# sandbox destroyed automatically

# Streaming output
for chunk in sandbox.exec_stream("ping -c 3 localhost"):
    print(chunk.data, end="")

sandbox.destroy()
```

## Async Support

```python
from forgevm import AsyncClient

async with AsyncClient("http://localhost:7423") as client:
    sandbox = await client.spawn(image="alpine:latest")
    result = await sandbox.exec("echo hello")
    await sandbox.destroy()
```

## License

MIT
