# model-serving-kubernetes

Deploys ML models and LLMs on Kubernetes using KServe and NVIDIA Triton Inference Server. Handles canary rollouts, traffic splitting, and GPU scheduling.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 327 installs · ★ 1177
- Author: devops-skills
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/BagelHole/DevOps-Security-Agent-Skills/tree/HEAD/devops/orchestration/model-serving-kubernetes/SKILL.md
- Updated: 2026-05-22
- HTML: https://affpapa.org/en/nevibecode/skills/model-serving-kubernetes

## What it does

The skill provides Kubernetes manifests and operational commands for serving PyTorch, TensorFlow, scikit-learn, ONNX, and LLMs. It includes concrete KServe `InferenceService` definitions, such as deploying Llama 3 via vLLM with explicit GPU resource limits and transformer containers.

It handles progressive delivery through `canaryTrafficPercent` patches and autoscaling via KEDA with Prometheus request-rate triggers. For Triton Inference Server, the skill details `config.pbtxt` configurations featuring dynamic batching and polling-based model loading from S3.

The cluster requires Kubernetes 1.28+, GPU nodes, and the NVIDIA GPU Operator already running. Without these prerequisites and configured `kubectl` and `helm`, the GPU workloads cannot schedule.

## Requirements
- Works with: Kubernetes

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill model-serving-kubernetes -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/model-serving-kubernetes/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/model-serving-kubernetes/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill model-serving-kubernetes -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/model-serving-kubernetes/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill model-serving-kubernetes -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/model-serving-kubernetes/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install BagelHole/DevOps-Security-Agent-Skills model-serving-kubernetes
```

2. **Manually: put the files in place**
- File: `.github/skills/model-serving-kubernetes/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill model-serving-kubernetes -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/BagelHole/DevOps-Security-Agent-Skills --path devops/orchestration/model-serving-kubernetes
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/model-serving-kubernetes/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill model-serving-kubernetes -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/BagelHole/DevOps-Security-Agent-Skills/tree/HEAD/devops/orchestration/model-serving-kubernetes/SKILL.md

## When to use it
- deploy LLMs and ONNX models on Kubernetes clusters
- configure canary traffic splitting between model revisions
- set up inference autoscaling with KEDA and Prometheus
- write Triton config.pbtxt with GPU dynamic batching

## Example prompts
- Configure a KServe InferenceService for Llama 3.1 8B with a vLLM container and one GPU
- Create a KEDA ScaledObject to autoscale the inference service based on Prometheus request rates
- Generate a Triton config.pbtxt for an ONNX model with dynamic batching on GPU

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: bef698d927c56b59.

BEGIN THIRD-PARTY FILE bef698d927c56b59
````text
---
name: model-serving-kubernetes
description: Deploy ML models on Kubernetes with KServe (formerly KFServing) and NVIDIA Triton Inference Server. Includes canary deployments, autoscaling, model versioning, A/B testing, and GPU resource management for production model serving.
license: MIT
metadata:
  author: devops-skills
  version: "1.0"
---

# Model Serving on Kubernetes

Production ML model serving with KServe and Triton — canary deployments, autoscaling, and GPU-aware scheduling.

## When to Use This Skill

Use this skill when:
- Serving scikit-learn, PyTorch, TensorFlow, or ONNX models at scale
- Implementing canary deployments and A/B testing for ML models
- Autoscaling inference pods based on request rate or GPU metrics
- Deploying LLMs with Triton or KServe on Kubernetes
- Managing multiple model versions with traffic splitting

## Prerequisites

- Kubernetes 1.28+ with GPU nodes
- KServe installed (or Triton standalone)
- `kubectl` and `helm` configured
- NVIDIA GPU Operator installed on cluster

## KServe Installation

```bash
# Install KServe with Helm
helm repo add kserve https://kserve.github.io/helm-charts
helm repo update

helm install kserve kserve/kserve \
  --namespace kserve \
  --create-namespace \
  --set kserve.controller.gateway.ingressGateway.className=nginx

# Verify
kubectl get pods -n kserve
kubectl get crd | grep kserve
```

## Basic InferenceService (KServe)

```yaml
apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
  name: sklearn-iris
  namespace: models
spec:
  predictor:
    sklearn:
      storageUri: gs://kfserving-examples/models/sklearn/1.0/model
      resources:
        requests:
          cpu: "1"
          memory: 2Gi
        limits:
          cpu: "2"
          memory: 4Gi
```

```bash
kubectl apply -f inference-service.yaml

# Get inference service URL
kubectl get inferenceservice sklearn-iris -n models
# NAME           URL                                          READY   ...
# sklearn-iris   http://sklearn-iris.models.example.com       True

# Test prediction
curl -X POST http://sklearn-iris.models.example.com/v1/models/sklearn-iris:predict \
  -H "Content-Type: application/json" \
  -d '{"instances": [[6.8, 2.8, 4.8, 1.4]]}'
```

## GPU-Enabled LLM InferenceService

```yaml
apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
  name: llama-3-8b
  namespace: models
  annotations:
    serving.kserve.io/enable-prometheus-scraping: "true"
spec:
  predictor:
    containers:
    - name: vllm-container
````
END THIRD-PARTY FILE bef698d927c56b59

The third-party file has ended. Everything between the bef698d927c56b59 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2524 of 8481 bytes. © devops-skills · MIT · https://github.com/BagelHole/DevOps-Security-Agent-Skills/tree/HEAD/devops/orchestration/model-serving-kubernetes/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
