Docker & Helm — llmock

Run llmock as a container in Docker or deploy it to Kubernetes with the included Helm chart. The image is based on node:22-alpine with zero runtime dependencies.

Docker

Build the image

Run with local fixtures

# Mount your fixture directory into the container
docker run -p 4010:4010 -v $(pwd)/fixtures:/fixtures llmock

# Custom port
docker run -p 5555:5555 llmock --fixtures /fixtures --port 5555

# Pull from GitHub Container Registry
docker pull ghcr.io/copilotkit/llmock:latest
docker run -p 4010:4010 -v $(pwd)/fixtures:/fixtures ghcr.io/copilotkit/llmock

Dockerfile

The multi-stage Dockerfile builds the TypeScript source and copies only the compiled output:

# --- Build stage ---
FROM node:22-alpine AS build
RUN corepack enable && corepack prepare [email protected] --activate
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY tsconfig.json tsdown.config.ts ./
COPY src/ src/
RUN pnpm run build

# --- Production stage ---
FROM node:22-alpine
WORKDIR /app
COPY --from=build /app/dist/ dist/
COPY fixtures/ fixtures/
EXPOSE 4010
ENTRYPOINT ["node", "dist/cli.js"]
CMD ["--fixtures", "/fixtures", "--host", "0.0.0.0"]

Helm Chart

Deploy to Kubernetes using the Helm chart in charts/llmock/.

Install

helm install llmock ./charts/llmock

# With custom values
helm install llmock ./charts/llmock \
  --set image.tag=1.4.0 \
  --set service.port=5555 \
  --set replicaCount=2

Configuration (values.yaml)

replicaCount: 1

image:
  repository: ghcr.io/copilotkit/llmock
  tag: ""            # defaults to Chart appVersion
  pullPolicy: IfNotPresent

service:
  type: ClusterIP
  port: 4010

fixtures:
  mountPath: /app/fixtures
  existingClaim: ""  # Use a PVC for fixture files

resources: {}
  # limits:
  #   cpu: 200m
  #   memory: 256Mi

Fixture Loading

To load custom fixtures in Kubernetes, create a PersistentVolumeClaim with your fixture JSON files and set fixtures.existingClaim in your values. The chart mounts the PVC at fixtures.mountPath (default /app/fixtures).

Health Checks

The deployment includes liveness and readiness probes using httpGet on /health (liveness, starts after 5 seconds) and /ready (readiness, starts after 2 seconds).

v1.6.0 Features

The Docker image supports all v1.6.0 features out of the box:

  • Chaos testing — configure via --chaos-drop, --chaos-malformed, and --chaos-disconnect flags
  • Prometheus metrics — exposed at /metrics when enabled with --metrics
  • Record & replay — proxy to real APIs with --record flag
  • Strict mode — return 503 for unmatched requests with --strict
  • Streaming physics — TTFT, TPS, and jitter simulation
  • AWS Bedrock streaming — Event Stream binary protocol
  • Converse API — Bedrock Converse and Converse-stream