Metadata-Version: 2.4
Name: kubetorch
Version: 0.2.0
Summary: Kubetorch: A Kubernetes-native framework for distributed PyTorch workloads
License: Apache 2.0
Author: Runhouse Team
Requires-Python: >=3.9,<=3.13
Classifier: License :: OSI Approved :: Apache Software License
Classifier: License :: Other/Proprietary 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 :: Python Modules
Classifier: Topic :: System :: Distributed Computing
Provides-Extra: client
Provides-Extra: docs
Provides-Extra: otel
Provides-Extra: server
Requires-Dist: fastapi ; extra == "server"
Requires-Dist: httpx (>=0.28.0,<0.29.0)
Requires-Dist: jinja2 (>=3.0)
Requires-Dist: kubernetes (>=20.0.0,!=32.0.0)
Requires-Dist: myst-parser ; extra == "docs"
Requires-Dist: opentelemetry-api ; extra == "otel"
Requires-Dist: opentelemetry-distro ; extra == "otel"
Requires-Dist: opentelemetry-exporter-otlp ; extra == "otel"
Requires-Dist: opentelemetry-exporter-prometheus ; extra == "otel"
Requires-Dist: opentelemetry-instrumentation ; extra == "otel"
Requires-Dist: opentelemetry-instrumentation-fastapi ; extra == "otel"
Requires-Dist: opentelemetry-instrumentation-logging ; extra == "otel"
Requires-Dist: opentelemetry-instrumentation-requests ; extra == "otel"
Requires-Dist: opentelemetry-sdk ; extra == "otel"
Requires-Dist: prometheus-api-client ; extra == "client"
Requires-Dist: prometheus-client ; extra == "otel"
Requires-Dist: pydantic (>=2.5.0)
Requires-Dist: python-json-logger ; extra == "server"
Requires-Dist: pyyaml (>=6.0,<7.0)
Requires-Dist: requests (>=2.32.0,<3.0.0)
Requires-Dist: rich ; extra == "client"
Requires-Dist: sphinx ; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints ; extra == "docs"
Requires-Dist: sphinx-book-theme ; extra == "docs"
Requires-Dist: typer ; extra == "client"
Requires-Dist: uvicorn[standard] ; extra == "server"
Requires-Dist: web-pdb ; extra == "server"
Requires-Dist: websockets (>=15.0,<16.0)
Project-URL: Documentation, https://www.run.house/kubetorch/introduction
Project-URL: Homepage, https://run.house
Project-URL: Repository, https://github.com/run-house/kubetorch
Description-Content-Type: text/markdown

# 📦Kubetorch🔥

**A Python interface for running ML workloads on Kubernetes**

Kubetorch enables you to run any Python code on Kubernetes at any scale by specifying required resources, distribution, and scaling directly in code. It provides caching and hot redeployment for 1-2 second iteration cycles, handles hardware faults and preemptions programmatically, and orchestrates complex, heterogeneous workloads with built-in observability and fault tolerance.

## Hello World

```python
from kubetorch import fn

def hello_world():
    return "Hello from Kubetorch!"

if __name__ == "__main__":
    # Define your compute
    compute = kt.Compute(cpus=".1")

    # Send local function to freshly launched remote compute
    remote_hello = kt.fn(hello_world).to(compute)

    # Runs remotely on your Kubernetes cluster
    result = hello_world()
    print(result)  # "Hello from Kubetorch!"
```

## What Kubetorch Enables

- **100x faster iteration** from 10+ minutes to 1-3 seconds for complex ML applications like RL and distributed training
- **50%+ compute cost savings** through intelligent resource allocation, bin-packing, and dynamic scaling
- **95% fewer production faults** with built-in fault handling with programmatic error recovery and resource adjustment

## Installation

### 1. Python Client

```bash
pip install "kubetorch[client]"
```

### 2. Kubernetes Deployment (Helm)

```bash
# Option 1: Install directly from OCI registry
helm upgrade --install kubetorch oci://ghcr.io/run-house/charts/kubetorch \
  --version 0.2.0 -n kubetorch --create-namespace

# Option 2: Download chart locally first
helm pull oci://ghcr.io/run-house/charts/kubetorch --version 0.2.0 --untar
helm upgrade --install kubetorch ./kubetorch -n kubetorch --create-namespace
```

For detailed setup instructions, see our [Installation Guide](https://www.run.house/kubetorch/installation).


## Learn More

- **[Documentation](https://www.run.house/kubetorch/introduction)** - API Reference, concepts, and guides
- **[Examples](https://www.run.house/kubetorch/examples)** - Real-world usage patterns and tutorials
- **[Join our Slack](https://join.slack.com/t/kubetorch/shared_invite/zt-3g76q5i4j-uP60AdydxnAmjGVAQhtALA)** - Connect with the community and get support

---

[Apache 2.0 License](LICENSE)

**🏃‍♀️ Built by [Runhouse](https://www.run.house) 🏠**

