百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

LLMKube

> 云原生
开源

用于在异构 GPU 群集中执行自主托管的 LLM 推理的 Kubernetes 运算器: NVIDIA CUDA、AMD Vulkan 和 Apple Silicon Metal。运行时: LLaMA.cpp、vLLM、

181 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于在异构 GPU 群集中执行自主托管的 LLM 推理的 Kubernetes 运算器: NVIDIA CUDA、AMD Vulkan 和 Apple Silicon Metal。运行时: LLaMA.cpp、vLLM、


The Problem

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): ModelRouter CRD 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.


Architecture

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.


See it in action

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.


Quick Start

bash
# 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:

bash
llmkube deploy llama-3.1-8b --gpu --gpu-count 1

No CLI? Use plain kubectl

yaml
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"
bash
kubectl apply -f model.yaml

Full setup guides: Minikube Quickstart | GKE with GPUs | Intel GPU Quickstart | DGX Spark (MicroK8s) | Air-Gapped Deployment | OpenShift


The Metal Agent

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:

  1. Watches the Kubernetes API for InferenceService resources with accelerator: metal
  2. Spawns llama-server natively on macOS with full Metal GPU access
  3. Registers endpoints back into Kubernetes so the rest of your cluster can route to it

Your 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.

bash
# On your Mac
brew install llama.cpp
llmkube-metal-agent --host-ip 

# From anywhere in the cluster
llmkube deploy llama-3.1-8b --accelerator metal

Works over LAN, Tailscale, WireGuard, or any routable network. Full Metal Agent guide →


Composition: ModelRouter

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:

  • Fail-closed for regulated data, both statically and at runtime. Apply-time validation rejects rules that would route PII / PHI to cloud-tier backends. Runtime enforcement refuses with HTTP 503 if the local pool can't serve the request, never falling through to cloud.
  • Per-rule and per-backend timeout budgets. Strict policy tiers fast-fail; lenient tiers stay patient. The proxy applies context.WithTimeout per attempt, so a slow primary doesn't eat the fallback's budget. Resolution order: rule.timeout || backend.timeout || proxy default.
  • OpenAI-compatible streaming endpoint. Plug it into LangGraph, OpenAI Agents SDK, Anthropic SDK, Cline, Aider, or any framework that speaks the OpenAI API. The agent runtime doesn't need to know it's talking to a router.

Full ModelRouter concept doc → | Sample manifest


Foreman

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.

yaml
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


How Is This Different?

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:

  • KubeAI: similar Kubernetes-operator scope. KubeAI focuses on autoscaling vLLM/Ollama on NVIDIA, intra-cluster. LLMKube adds first-class Apple Silicon Metal support, GGUF + HF runtime mixing, a model catalog CLI, and ModelRouter for policy-aware hybrid routing across local + cloud.
  • llm-d: distributed inference for very large models on NVIDIA fleets via Gateway API. Different problem space. LLMKube targets heterogeneous on-prem clusters (laptops, edge nodes, single GPUs) where llm-d's distributed-NVIDIA-first design is overkill.
  • LiteLLM: dominant cloud-provider proxy, operates outside Kubernetes policy. LLMKube doesn't replace LiteLLM — 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· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Goaiapple-siliconautoscalingedge-computing

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类云原生
定价开源

> 相关工具

K
Kubernetes
容器编排事实标准
H
Helm
Kubernetes 包管理器
S
seaweedfs
SeaweedFS is a distributed storage system for object storage (S3), file systems, and Iceberg tables,