# Repository Briefing: run-house/kubetorch
> Source: https://repoforai.com/repo/run-house/kubetorch (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/run-house/kubetorch
- **Official Docs / Website**: https://run.house
- **Category**: LLMs & Inference (大模型与推理微调)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: B (50/100 · Maintenance 6/35 · Adoption 13/25 · Releases 11/20 · License 20/20)
- **Latest Release**: v0.5.0 (2026-02-18) — https://github.com/run-house/kubetorch/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Self-Hosted
- **Momentum**: 1,229 ★ total (+0 24h / +0 7d) · 61 forks
- **Topics**: `artificial-intelligence`, `aws`, `data-science`, `gcp`, `machine-learning`, `python`, `pytorch`, `ray`, `serverless`, `distributed`, `infrastructure`, `observability`
- **When to Use**: Best for: ML teams with an existing Kubernetes cluster that want to deploy and call Python workloads from notebooks, IDEs, or CI, using a separately chosen training or inference runtime. Skip if: You need a turnkey model server with a defined backend compatibility matrix, lack capacity to operate Kubernetes, or require every workload resource to be managed directly through GitOps manifests.

## Overview
```text
### Architecture & Core Mechanics
Kubetorch is a Python SDK backed by a Kubernetes control plane. A caller declares resources with `kt.Compute`, deploys a local function with `kt.fn(...).to(compute)`, and calls the returned handle from an IDE, notebook, CI job, or application. The function executes on the cluster without a separate local Kubetorch runtime or code serialization. Since v0.4.0, the Python client has reached the cluster through a centralized controller endpoint rather than a local kubeconfig.

The source layout separates the SDK in `python_client/`, the controller and data store in `services/`, the Helm chart in `charts/kubetorch/`, and the workload base images in `release/default_images/`. In v0.5.0, the Workload CRD provides a Kubernetes-native record for Kubetorch service metadata, including labels, paths, and images. The CRD makes those records accessible through standard tooling; it does not by itself establish how all generated resources are reconciled.

### Key Capabilities & Differentiators
The core capability is deploying and invoking Python ML code remotely, not executing model graphs inside a bundled inference engine. `kt.Compute` supplies the resource declaration: the minimal example uses `cpus=".1"`, which illustrates the API rather than a production sizing target. The remote-call workflow applies to experiments, distributed training, and inference application code. Logs, exceptions, and hardware faults are propagated back to the caller, so debugging can start in the calling Python environment.

Dynamic scaling and bin-packing address resource allocation, but their capacity and cost benefits depend on workload shape and the cluster's available nodes. There is no established compatibility matrix for model families, weight formats, or inference backends, nor a verified latency baseline. For inference, validate compatibility, startup time, batching behavior, and throughput with the runtime and image you actually plan to deploy.

### Trade-offs & Limitations
Compared with writing Kubernetes Jobs or Deployments directly, Kubetorch puts resource declarations and remote calls in the same Python workflow. That is useful when application code changes faster than infrastructure definitions. Teams that already rely on declarative manifests and GitOps should first establish which resources Kubetorch owns, which should remain in Git, and what alerts or recovery actions are needed if controller access fails.

A dedicated inference runtime solves a different problem: model execution, batching, hardware utilization, and serving behavior. Kubetorch can run Python code that uses such a runtime, but the SDK is not a substitute for it. Separately measure provisioning and image pull delays, model initialization, and steady-state request latency; gains in developer iteration do not guarantee better production tail latency. Apache-2.0 applies to the repository, not automatically to the models and other artifacts you deploy.

### Hardware & Deployment Guide
Install the Python client with `pip install "kubetorch[client]"`. On a Kubernetes cluster with Helm, deploy v0.5.0 with `helm upgrade --install kubetorch oci://ghcr.io/run-house/charts/kubetorch --version 0.5.0 -n kubetorch --create-namespace`. The OCI chart can also be pulled and unpacked before installation. That separates chart retrieval from installation but does not prove an air-gapped setup: required images and Python packages still need to be available. Confirm that clients can reach the controller and that the cluster can schedule the requested workload resources.

Release evolution matters for upgrades: v0.4.0 introduced the controller access path, v0.4.1 propagated annotations from `kt.Compute`, and v0.5.0 stores workload metadata in the Workload CRD. Before upgrading production, test client access, inspect the resulting Workload objects, and verify that expected annotations and image references are retained. Size nodes against the intended workload and concurrency rather than treating the SDK as a hardware baseline.
```

## Key Capabilities
```text
- Execution API: `kt.fn(...).to(kt.Compute(...))` deploys a local Python function and returns a callable handle for remote execution.
- Client access: The v0.4.0 controller moved Python clients to a centralized endpoint and removed their local kubeconfig requirement.
- Workload metadata: The v0.5.0 Workload CRD exposes service labels, paths, and images through standard Kubernetes tooling.
- Runtime feedback: Remote logs, exceptions, and hardware faults are surfaced to the caller.
- Self-hosted components: The repository separates the SDK, Helm chart, controller and data store sources, and workload base images.
```

## Quick Start / Clone
```bash
pip install "kubetorch[client]"
```
