run-house/kubetorch
A Python SDK and Kubernetes controller for deploying and calling remote ML workloads
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & 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.
kt.fn(...).to(kt.Compute(...)) deploys a local Python function and returns a callable handle for remote execution.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.
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.
Quick Start & Installation
pip install "kubetorch[client]"
Comparison vs. Top LLMs & Inference Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| kubetorch ★ | 1.2k | — | Python | Apache-2.0 | A Python SDK and Kubernetes controller for deploying and calling remote ML workl |
| keras | 64.5k | +24 | Python | Apache-2.0 | Multi-backend Python SDK for building, training, and running deep learning model |
| pytorch-lightning | 31.5k | +31 | Python | Apache-2.0 | PyTorch training with a managed Trainer and Fabric for custom distributed loops |
| ludwig | 11.8k | +6 | Python | Apache-2.0 | YAML-first framework for fine-tuning, training, and serving LLMs and multimodal |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/run-house/kubetorch.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about kubetorch
How does a local Python script invoke a function on the cluster?
kt.Compute, then deploy a Python function with kt.fn(...).to(compute). Call the returned handle from your Python environment to run the function on Kubernetes. The client talks to the cluster through the controller endpoint rather than requiring a local kubeconfig. The transport and authentication protocol are not specified here.How much GPU memory and platform capacity should we budget?
Can we self-host Kubetorch for commercial workloads?
When should we choose Kubetorch over native Kubernetes or a model-serving runtime?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy