用于在异构 GPU 群集中执行自主托管的 LLM 推理的 Kubernetes 运算器: NVIDIA CUDA、AMD Vulkan 和 Apple Silicon Metal。运行时: LLaMA.cpp、vLLM、
用于在异构 GPU 群集中执行自主托管的 LLM 推理的 Kubernetes 运算器: NVIDIA CUDA、AMD Vulkan 和 Apple Silicon Metal。运行时: LLaMA.cpp、vLLM、
You want to run LLMs on your own infrastructure. Maybe it's for data privacy, cost control, air-gapped compliance, or you just don't want to send every request to OpenAI.
So you set up llama.cpp. It works great on one machine. Then you need to scale it, monitor it, manage model versions, handle GPU scheduling across nodes, expose an API, and somehow make your Mac's Metal GPU and your Linux server's NVIDIA cards work together. And the moment you want any of that traffic to sometimes hand off to Claude or GPT, you're building another routing layer.
Suddenly you're building an entire platform instead of shipping your product.
LLMKube is a Kubernetes operator that turns LLM deployment into a two-line YAML problem. Define a Model and an InferenceService, and the operator handles downloading, caching, GPU scheduling, health checks, scaling, and exposing an OpenAI-compatible API. Add a ModelRouter on top and the same cluster does policy-aware routing between your local models and external providers (Anthropic / OpenAI / LiteLLM) with fail-closed semantics for regulated data.
0.8.0 (2026-05-28): Foreman ships as an opt-in add-on. A Kubernetes-native control plane that dispatches coder, verifier, and reviewer agents across a heterogeneous fleet of locally-hosted LLM nodes. Foreman authored its own debut PRs against this repository (#508, #588). Plus Intel oneAPI / SYCL GPU support from a first-time contributor. See Foreman below or the live Foreman docs for the full reference.
0.7.8 (2026-05-13):
ModelRouterCRD ships: cross-engine routing with per-rule and per-backend timeout budgets, half-open circuit breaker, runtime fail-closed for PII/PHI rules, configurable response-header timeout, cloud-tier connection hygiene. See Composition: ModelRouter below.
Two cooperating processes. An in-cluster controller owns Kubernetes-side desired state. An out-of-cluster metal-agent (optional, only needed for Apple Silicon hosts) owns OS-level process supervision and registers Endpoints back into the cluster.
…Same operator manages Linux/GPU pods and Apple Silicon hosts; both surface as InferenceService objects to kubectl.
Setup guide for the metal-agent on Apple Silicon: deployment/macos/README.md.
Live asciinema cast on llmkube.com/docs/getting-started: deploy a model on a kind cluster, stream tokens from the OpenAI-compatible endpoint, and run the built-in throughput benchmark in under a minute.
# Install the CLI
brew install defilantech/tap/llmkube
# Install the operator on any K8s cluster
helm repo add llmkube https://defilantech.github.io/LLMKube
helm install llmkube llmkube/llmkube --namespace llmkube-system --create-namespace
# Deploy a model (one command, uses catalog-tested defaults)
llmkube deploy phi-4-mini
# Query it (OpenAI-compatible)
kubectl port-forward svc/phi-4-mini 8080:8080 &
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"Hello!"}],"max_tokens":100}'That's it. The operator downloads the model, creates the deployment, sets up the service, and exposes an OpenAI-compatible API. Works with the OpenAI Python/Node/Go SDKs, LangChain, and LlamaIndex out of the box.
Want GPU acceleration? Add --gpu:
llmkube deploy llama-3.1-8b --gpu --gpu-count 1No CLI? Use plain kubectl
apiVersion: inference.llmkube.dev/v1alpha1
kind: Model
metadata:
name: tinyllama
spec:
source: https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf
format: gguf
---
apiVersion: inference.llmkube.dev/v1alpha1
kind: InferenceService
metadata:
name: tinyllama
spec:
modelRef: tinyllama
replicas: 1
resources:
cpu: "500m"
memory: "1Gi"kubectl apply -f model.yamlFull setup guides: Minikube Quickstart | GKE with GPUs | Intel GPU Quickstart | DGX Spark (MicroK8s) | Air-Gapped Deployment | OpenShift
This is the thing no other Kubernetes LLM tool does.
Most Kubernetes tools run inference inside containers. That works fine on Linux with NVIDIA GPUs. But Apple Silicon's Metal GPU can't be accessed from inside a container — so every other tool either ignores Macs or forces you into slow CPU-only inference.
LLMKube's Metal Agent inverts the model. Instead of stuffing inference into a container, the Metal Agent runs as a native macOS process that:
InferenceService resources with accelerator: metalllama-server natively on macOS with full Metal GPU accessYour Mac dedicates 100% of its unified memory to inference. Kubernetes handles orchestration. The same CRD works across NVIDIA, Intel, and Apple Silicon by selecting the accelerator in the model spec.
…This means you can build a heterogeneous cluster: NVIDIA GPUs in the cloud for heavy workloads, Mac Studios on-prem for low-latency inference, all managed by the same Kubernetes operator with the same CRDs.
# On your Mac
brew install llama.cpp
llmkube-metal-agent --host-ip
# From anywhere in the cluster
llmkube deploy llama-3.1-8b --accelerator metalWorks over LAN, Tailscale, WireGuard, or any routable network. Full Metal Agent guide →
Model and InferenceService give you self-hosted inference. ModelRouter puts a policy-aware OpenAI-compatible endpoint in front of both your local InferenceServices and external providers, with budgets, classifications, and fail-closed semantics enforced at the cluster level instead of in application code.
The motivating use case: an agent running on a local model can selectively hand off specific steps to Claude or GPT without the agent code knowing or caring where the model lives, while platform policy enforces that regulated data never egresses.
…Three properties worth calling out:
context.WithTimeout per attempt, so a slow primary doesn't eat the fallback's budget. Resolution order: rule.timeout || backend.timeout || proxy default.Full ModelRouter concept doc → | Sample manifest
Model and InferenceService give you self-hosted inference. ModelRouter gives you policy-aware routing. Foreman gives you an orchestrator for agentic workloads on top of both.
Foreman is an opt-in add-on that ships its own Helm chart, its own API group (foreman.llmkube.dev), and its own controller and node-agent binaries. It introduces four CRDs (Workload, AgenticTask, Agent, FleetNode), a capability-aware scheduler, and a native Go agent loop that runs OpenAI function-calling against your local inference endpoints. The v0.1 shape is a linear pipeline: coder agent on one node produces a branch, verifier agent (gate) on another node runs make fmt vet lint test, reviewer agent(s) on a third node read the diff against the issue body and score it.
apiVersion: foreman.llmkube.dev/v1alpha1
kind: Workload
metadata:
name: fix-small-bugs
namespace: default
spec:
intent: "Fix small open issues"
repo: defilantech/LLMKube
issues: [510, 526, 449]
coderAgentRef: { name: qwen36-35b-carnice-mtp-coder }
verifierAgentRef: { name: shadowstack-gate }
reviewerAgentRefs:
- { name: qwen36-35b-a3b-reviewer }
- { name: devstral-24b-reviewer }kubectl apply and watch the fleet land DCO-signed branches on a fork. Two such branches reached this repository as upstream PRs: #508 and #588.
Foreman is meant for shops where on-prem hardware, sovereignty constraints, or sheer batch scale make the agentic-coding cloud-API model a poor fit. It is not a replacement for individual-developer tools like Cursor or aider; it is the control plane below those tools, for when you want a fleet doing the work instead of one developer.
Full Foreman docs → | Model compatibility table | Sample manifests
| LLMKube | vLLM / TGI | Ollama | KServe | LocalAI | |
|---|---|---|---|---|---|
| Kubernetes-native CRDs | Yes | No (manual Deployments) | No | Yes | No |
| Apple Silicon Metal GPU | Native (Metal Agent) | No | Local only | No | CPU only |
| NVIDIA GPU | Yes | Yes | Limited | Yes | Yes |
| AMD GPU (Vulkan, incl. Strix Halo) | Yes | No | Limited | No | Limited |
| Heterogeneous clusters (NVIDIA + Apple Silicon + AMD) | Yes | No | No | No | No |
| Hybrid local + cloud routing with policy | ModelRouter CRD |
No | No | No | No |
| Fail-closed for regulated data (PII/PHI) | Static + runtime, K8s-enforced | No | No | No | No |
| Per-rule / per-backend timeout budgets | Yes (spec.rules[].timeout) |
No | No | No | No |
| OpenAI-compatible API | Built-in | Yes | Yes | Requires config | Yes |
| Model catalog + CLI | llmkube deploy llama-3.1-8b |
Manual | ollama pull |
Manual | Manual |
| GPU queue management | Priority classes, queue position | No | No | No | No |
| Air-gap / edge ready | Yes | Possible | Possible | Yes | Yes |
| Observability | Prometheus + Grafana included | External | No | External | No |
LLMKube is for teams that want Kubernetes-managed LLM inference across heterogeneous hardware. If you just need to run a model on one machine, Ollama is simpler. If you need maximum throughput on NVIDIA-only clusters, vLLM is faster. LLMKube occupies the space where Kubernetes orchestration, multi-hardware support, and operational simplicity intersect.
Versus newer adjacent projects:
ModelRouter for policy-aware hybrid routing across local + cloud.ModelRouter composes with it: declare a provider: litellm backend pointed at a running LiteLLM proxy and the platform-level fail-closed gate sits i暂无开放 Issues,或尚未同步最近议题。