Meta Purple Llama on Docker vs Kubernetes vs VMs

Purple Llama is not one server. Its components run as a Python package and as model workloads, so the right host depends on the platform your team already operates and who will carry the upkeep. This page compares Docker, Kubernetes and virtual machines on sizing, availability, upgrades, backups and skills.

On this page

Which Purple Llama deployment option fits your team: Docker, Kubernetes or VMs

The choice depends mainly on the platform your team already operates and on who will own upgrades and incidents. The scanners matter less to this decision than where they run. The documented install path for LlamaFirewall is a Python package installed with pip install llamafirewall, which needs Python 3.10 or later, so each option is really a decision about where that Python service runs. Docker fits a small team that runs a few hosts, wants reproducible images and can accept host-level recovery as its availability model. Kubernetes fits when a cluster with health checks, rolling upgrades and an on-call rota already exists, because the guard service inherits those controls. VMs fit when your change process is built around OS images and patch windows, or when the security team wants the service on a host it controls directly.

Sizing is the first thing to confirm, and it differs by model. Llama Guard 4 is a 12-billion-parameter multimodal classifier, so check its memory and accelerator needs against the node types you can actually provision. Prompt Guard 2 comes in 86M and 22M parameter versions with a 512-token context window. The Prompt Guard 2 model card says the 22M version, based on DeBERTa-xsmall, cuts latency and compute costs by 75% with minimal performance trade-offs, and that the 86M version is multilingual. Load test both sizes on your own prompts, because the model card figure is a starting point and your traffic sets the number that matters. Confirm one more constraint for every option: AlignmentCheck requires a Together API key, so the service needs outbound access to that provider unless you leave that scanner out of your design.

What runs where in a Docker, Kubernetes or VM deployment

Each deployment option runs the same LlamaFirewall pipeline on different infrastructure. The cards below show which components run where, who owns each one, and what leaves your host or cluster whichever option you choose.

Single Docker host

One host runs the application containers, LlamaFirewall inside the application or in a separate service container, and any guard model server you host yourself. Your team owns the host OS, patching, the Docker engine, the images you build, and the model files you mount. Confirm in the Purple Llama repository whether Meta publishes a container image before you rely on one. A single host is also a single failure domain, so decide what happens to guardrail coverage during a restart or disk failure, and whether requests fail open or closed.

Purple Llama repository

Kubernetes cluster

Pods run the application, the LlamaFirewall wrapper, and a model-serving workload for Llama Guard or Prompt Guard if you host them yourself. The platform team owns the cluster, including node pools, GPU scheduling, ingress, secrets and network policies, while the application team owns the pod spec and the calls into LlamaFirewall. Confirm in the Purple Llama repository whether Helm charts or manifests are published before you write your own. Check replica counts, pod disruption budgets, and how the guard path behaves while its pods are rescheduled.

Virtual machines

Each VM runs the application, LlamaFirewall in a Python 3.10 or later environment, and any model server, under a hypervisor and guest OS owned by your infrastructure team. Do not assume VM templates exist for this stack; confirm in the Purple Llama repository whether any are published. VMs suit teams whose machine image change control already covers the rest of the estate, so the guard path is patched on the same cycle. Pin the llamafirewall package version across every VM, since version 1.0.3 is the latest on PyPI and drift between VMs is hard to spot.

PyPI package page

Dependencies that move with every option

Model weights for Llama Guard 4 or Prompt Guard 2, the application calling LlamaFirewall, and the outbound AlignmentCheck call to Together travel with each option. Llama Guard 4 and Prompt Guard 2 ship under the Llama 4 Community License, so legal review should cover the weights and where they are stored. AlignmentCheck requires a Together API key and sends content to Together, so if your data rules block that egress, skip that scanner or confirm an alternative for each environment before the first deployment.

LlamaFirewall license

How a request moves through LlamaFirewall and your hosting boundary

The diagram starts with a user request reaching the LLM application inside your runtime. PromptGuard 2 scans the incoming prompt for direct prompt injection before the model receives it. After the model responds, CodeShield or a custom regex scanner checks the generated output, and the response returns to the user only after those checks pass. Llama Guard 4 is not a LlamaFirewall scanner in this flow. It runs as a separate classifier service your team hosts inside the boundary. The only outbound path shown is the optional AlignmentCheck call to Together, which requires a Together API key. Confirm exactly which traffic crosses that egress line before you approve it.

Scanners run in your runtime; only optional AlignmentCheck leaves the boundary.

Purple Llama deployment options compared on packaging, sizing and upkeep

This table compares how Meta Purple Llama components run as containers on a single Docker host or a Kubernetes cluster, and as virtual machines, across packaging, scaling, high availability, upgrades, backup, monitoring, skills and cost timing. Read each row as a question to answer for your own environment. The main takeaway: containers shift effort toward image and cluster operations, while VMs keep the operating model your team may already run, so confirm your platform's HA and patching capabilities before choosing.

DimensionContainers (single Docker host or Kubernetes cluster)Virtual machines
Packaging unitImage you build around the Purple Llama Python packages. A Docker host runs it as a container; a Kubernetes cluster runs it as a pod.Full guest OS with Python 3.10 or later, the llamafirewall package and model files installed.
Scaling unitOne container on a single Docker host, or more pod replicas across a Kubernetes cluster's nodes.Whole VM instances added behind a load balancer, each carrying its own OS and patch cycle.
High availability ownerSingle Docker host: you build failover yourself. Kubernetes: the cluster reschedules pods, but confirm node capacity and control plane design.Your hypervisor and load balancer provide failover. Confirm live migration and automatic VM restart support.
Upgrade pathRebuild the image with the new package version, then replace the container. Kubernetes can roll pods one at a time.Patch the guest OS and upgrade packages on each VM, or rebuild the template and redeploy.
Backup scopeConfiguration, policies and any mounted model or cache volumes. Keep image build inputs in version control so the image can be rebuilt.Full VM image or snapshot covering OS, packages, model files and configuration.
MonitoringContainer runtime metrics plus scanner latency and block counts from the application. On Kubernetes, add cluster-level alerts.Host agent metrics per VM plus application logs. Confirm your existing agent supports the guest OS.
Skills neededDocker and Python for a single host. Kubernetes adds manifests, networking, secrets handling and cluster upgrades.Linux administration, patching, hypervisor operations and Python packaging on each guest.
One-time vs recurring costsOne-time: image pipeline, manifests and cluster build. Recurring: image rebuilds, base image patches and cluster upkeep.One-time: VM template and hardening. Recurring: per-VM OS patching, snapshot storage and any hypervisor licensing you hold (confirm terms).

Which team should run Purple Llama on Docker, Kubernetes or VMs

This fits a team with one application service, no cluster and no hypervisor baseline. LlamaFirewall is a Python library installed with pip install llamafirewall on Python 3.10 or later, so the guard can sit beside the application in one container or on one VM. The setup stays small, but the guard is only as available as the single host it runs on, and the team carries every patch itself.

  • Fit condition: one service, one owning team, and a change window the team controls without coordinating a cluster or a shared platform.
  • Not a fit: several services need the same guard, or an outage of the guard host would block customer traffic. A shared host or cluster is then the more suitable choice.
  • Model fit: Prompt Guard 2 has a 512-token context window, so long inputs need a chunking plan. Confirm memory and CPU needs for the model you choose with its model card and a load test.
  • External calls: AlignmentCheck requires a Together API key, so confirm whether that data path is allowed before enabling it.
  • Handover ownership: the team owns the container image, base image patching, pinned package versions, logs and any model file updates.

Confirm the license terms of each model you deploy, since Llama Guard 4 and Prompt Guard 2 ship under the Llama 4 Community License, before you build the image.

How model size and context limits shape sizing and high availability

Size each component on its own terms before you size the cluster. Llama Guard 4 is a 12-billion-parameter multimodal classifier that checks both prompts and responses, so it is the heavy component and the one that drives accelerator memory and node choice. Prompt Guard 2 comes in 86M and 22M parameter versions with a 512-token context window, so it needs much lighter hardware, but any input longer than 512 tokens must be split or truncated by your application, and you should confirm how your integration handles that. The Prompt Guard 2 model card says the 22M version cuts latency and compute costs by 75% with minimal performance trade-offs, and that the 86M version is multilingual. Pick the 22M version when latency and cost dominate, and the 86M version when language coverage matters, then confirm the detection quality on your own traffic.

A classifier in the request path makes its availability your application's availability, so plan for its failure before go-live. Run enough replicas that a single node loss, drain or upgrade does not stop inference, and spread them across failure domains such as separate Docker hosts, Kubernetes nodes in different zones, or VMs on different hypervisor hosts. Then write down the failure policy for each component. Fail-closed blocks a request when the guard cannot answer, which protects data but turns a guard outage into an application outage. Fail-open keeps traffic moving but removes the check during the incident. Many teams split the policy, for example failing closed on agent tool calls and open on low-risk chat, but that split needs sign-off from the risk owners. Separately, AlignmentCheck depends on an outbound call and requires a Together API key, so egress rules, key rotation and a Together outage belong in your availability model. Confirm with Meta or your own platform team whether any AlignmentCheck path can run without that dependency in your setup.

Benchmark hardware and latency on your own traffic before you choose node or VM sizes. Replay a sample of your real prompts and model responses, including the longest inputs you expect, through each component at expected and peak concurrency. Record p95 latency, memory and accelerator use, and how the 512-token limit affects detection on long inputs. Use those results to decide the instance type, the replica count, and whether Llama Guard 4 needs a dedicated accelerator node or can share one with other workloads. No hardware figures for these models are given here, so ask Meta's documentation or your platform team to confirm the requirements for the 12-billion-parameter model before you order capacity. Keep the benchmark scripted so you can rerun it after each upgrade of the model, the runtime or the orchestrator.

Upgrades, backups and monitoring for each hosting option

This table compares the upkeep each hosting option asks for: upgrades, backups, monitoring and skills. Each row names whether the task is one-time or recurring, so you can compare the ongoing load. The main takeaway is that all three options need the same retest before a new LlamaFirewall release or model version goes live, and the difference is how much platform skill your team already has.

TaskDockerKubernetesVirtual machines
Upgrade method (recurring)Rebuild the image with the pinned version, run tests, then redeploy the container.Build a new image, roll it out with a rolling update, and roll back if health checks fail.Update the pinned package in a virtual environment during a patch window, then restart the service.
Retest before rollout (recurring)Run your prompt injection and jailbreak test set on a staging container before switching the tag.Run the same tests against a canary deployment before shifting traffic to the new version.Test the new package and model versions on a staging VM before the patch window opens.
Version check (one-time per pin, then at each upgrade)Pin the release in the Dockerfile. Version 1.0.3 was the latest on PyPI at research time.Pin the same release in the image build and confirm the current PyPI version before each upgrade.Pin the same release in the requirements file and confirm the current PyPI version before each upgrade.
Model weights backup (one-time setup, then recurring)Keep weights in a versioned volume, copy them off-host after each change, and record checksums.Store weights on a persistent volume or object storage with snapshots, and record checksums in Git.Copy weight files and checksums to separate backup storage. Add a disk snapshot if your policy requires one.
Configuration backup (one-time setup, then recurring)Keep compose files and env templates in Git. Keep secrets, including any Together API key for AlignmentCheck, in a vault.Keep manifests, Helm values and config maps in Git. Back up secret values through your secret store.Keep config files and service unit files in Git, and export them after each change.
Logs and audit trail (recurring)Send container logs to a central store, and set retention in the log collector.Ship pod logs to a central store and confirm cluster audit logging is enabled and retained.Forward service logs to a central store and keep the scanner verdict trail on separate storage.
Latency and error monitoring (recurring)Time each scan in your wrapper, and watch container restarts and error rates.Export scan timings and error counts from your wrapper, and alert on restarts and failed probes.Time each scan in the application, and watch service health and error logs on the host.
Blocked-request monitoring (recurring)Count block verdicts from application logs and alert on sudden spikes.Export block counts per namespace, alert on spikes, and review samples with the security team.Count block verdicts from application logs and review spikes in your log tool.
Skills each option needs (one-time hiring or training)Container builds, Python 3.10 or later packaging, and basic registry and volume handling.Cluster operations, manifests or Helm, secret handling and network policy. This is the widest skill set.Linux patching, service supervision, Python environments and change control during patch windows.

How to choose and run a deployment model in four phases

The sequence moves from what your team already runs to a tested single-host setup, then to agreed availability and fail behavior, and finally to a written upgrade and backup runbook. Each phase closes with a document you can attach to a quote, so the work can be priced against a clear scope.

  1. Inventory the platform and skills you already run

    Phase one starts with an inventory of the container platform, virtualization stack, backup tooling and monitoring your team already operates, plus the people who can run each one. Your team or an implementation partner produces a written scope listing those systems, their owners and the skills gaps. DeployOpen engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts, so this scope is the document to attach to a quote. The step is done when every system owner has signed off the inventory.

  2. Shortlist the deployment model

    Still in phase one, compare the three models against the inventory. Docker on a single host suits a small footprint with few operators, Kubernetes suits a team that already runs a cluster and its operating practice, and VMs suit a team whose controls and backup tooling are built around hypervisors. Record the choice, the rejected options and the owner of host or cluster patching in an architecture decision record. The step is done when the record is approved by the platform owner.

  3. Test LlamaFirewall and chosen models on one host

    Phase two installs LlamaFirewall from PyPI on one host running Python 3.10 or later, then loads the models you plan to use, such as Llama Guard 4 for hazard classification or Prompt Guard 2 in its 22M or 86M size for prompt injection and jailbreaks. Measure memory, latency and throughput on your own hardware, and confirm whether AlignmentCheck is in scope, since it needs a Together API key. The output is a test report with resource figures and the prompts that were missed. The step is done when the platform owner has reviewed the report.

  4. Agree availability and fail policy

    Phase three is a decision for the security and platform owners together: what happens when the guard service is down or slow. They choose whether requests fail closed and are blocked, or fail open and pass with logging. Map that choice to the chosen model, because a single Docker host, a Kubernetes deployment with replicas and a pair of VMs each give different recovery paths and different operating effort. Ask the security team to confirm the availability target in writing, since the right target depends on your own risk model. The output is a signed policy and a recovery diagram.

  5. Write the upgrade and backup runbook

    Phase four is a runbook covering how LlamaFirewall and model versions are pinned, tested in staging, rolled forward and rolled back. It also covers how configuration, audit logs and model weight files are backed up and restored. Pin the exact release you tested, and confirm the current release on PyPI before pinning, since the latest version changes over time. Include one restore drill on a second host and log the result. The step is done when the platform owner and security team both sign the runbook and the drill is recorded.

What Purple Llama hosting effort and deployment cost depend on

What drives the cost and effort of running Purple Llama on Docker, Kubernetes or VMs?

Effort follows how much of the platform you run yourself, and cost follows that effort plus the compute underneath. Expect three groups: a one-time build (images or manifests, configuration, SSO and logging integration, testing), recurring operations (patching, upgrades, backups, monitoring, on-call) and compute, which depends on model size and whether GPUs are needed.

  • Docker on one host has the fewest moving parts, but high availability and rollback stay with your team.
  • Kubernetes adds cluster operation, ingress, secrets handling and GPU scheduling. It pays off when several teams share the platform.
  • VMs fit teams whose patching, backup and access standards already run on hypervisors.

Ask any partner or internal estimate to split these groups, so you can compare the options on your own infrastructure.

Can an in-house team run this without outside help, and what does it need?

Yes. A team with container, Linux and Python experience can run these components itself, and the LlamaFirewall README covers installation. Plan for four needs:

  • Engineers who operate your chosen runtime and can maintain Python 3.10 or later for LlamaFirewall.
  • GPU or suitable compute nodes for the models you deploy, plus approval for any outbound calls.
  • A named owner for the AlignmentCheck Together API key, with a decision on where it is stored and how it rotates.
  • Review of SSO, audit logging and access controls, which your compliance team will want to see.

Confirm each item against your environment before you commit headcount. If you prefer a fixed-scope engagement, DeployOpen implements, documents and hands over this work inside your own infrastructure.

How long does a Purple Llama hosting project take to deliver?

The length is set by your environment and agreed scope, so ask for a dated plan in the written scope. The main drivers are:

  • The number of components you deploy and the runtime you target.
  • Whether a cluster, GPU pool or VM platform already exists, or must be built first.
  • Approval lead times for GPU capacity, outbound access for the AlignmentCheck Together API key and change control.
  • Integration depth: SSO, audit logging and how many applications call the guardrails.
  • Testing cycles, retest and handover.

Most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. Ask which of your approvals sit on the critical path.

Does moving from Docker to Kubernetes later mean a rebuild?

It depends on how the first deployment was built. If model files, configuration and secrets sit outside the container images, moving to Kubernetes is mostly repackaging: manifests, service wiring and secret references. If hosts, paths or keys are baked into the images, expect more rework. Check these before choosing Docker for a first step:

  • Health checks and startup behavior, since Kubernetes restarts and reschedules workloads.
  • Storage for model files and logs, which must survive pod replacement.
  • GPU scheduling and node selection, which Docker hosts handle differently.
  • Ingress, TLS and how the AlignmentCheck key is injected.

Ask your engineers to mark which parts carry over unchanged, so the migration effort follows from that list.

Does the hosting choice change the license terms for these components?

Licenses attach to each component, so the hosting choice on its own should not change the terms. Docker, Kubernetes and VMs run the same components under the same license:

  • LlamaFirewall is MIT licensed. Read its LICENSE file for the exact text.
  • Llama Guard 4 and Llama Prompt Guard 2 ship under the Llama 4 Community License Agreement.

Changing components changes which license applies. Have counsel review the Llama 4 Community License against your intended use, including any hosting, redistribution or acceptable use obligations, before you deploy.

What should we ask for in a quote for a hosting engagement?

Ask for a written scope that lists each component, each runtime target, and what is in and out of the work. Quote lines should also cover:

  • Deliverables: deployment configurations, runbooks, key handling notes and architecture documentation.
  • Testing: what is tested before handover and what a retest covers.
  • Handover: who receives the work, the training provided and the operating documents.
  • Retainer terms: upgrades, patching, backups and continuous testing, with any service levels written down.

Ask which costs are one-time and which recur. DeployOpen does not publish a price list. A quote follows from the written scope.

How DeployOpen scopes, deploys and supports Purple Llama on your infrastructure

DeployOpen plans, implements, hardens, backs up, upgrades and documents self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks. For Meta Purple Llama, the choice between Docker, Kubernetes and virtual machines is decided in a written scope before any build starts, with your team's skills and change process in view. The same engagement covers the Llama Guard, Prompt Guard and LlamaFirewall components you select.

How we scope

  • The written scope names the runtime (Docker, Kubernetes or VMs), the target environment and who operates it.
  • Each component in scope, such as Llama Guard 4 or Prompt Guard 2, is listed with its license.
  • Fixed-scope engagements agree deliverables and timelines in writing before work starts; ongoing support is available as a retainer.

How we build

  • Hosting, network placement and secrets handling are built to your environment and reviewed before go-live.
  • Your legal team confirms each model's license against your use case before build starts.
  • LlamaFirewall installs from PyPI on Python 3.10 or later, and AlignmentCheck needs a Together API key.

How we hand over

  • Handover covers configuration, runbooks for the chosen runtime and the upgrade path.
  • Documentation records which Purple Llama components run, where, and under which license.
  • Evidence such as configuration records and audit logs is prepared for your auditors, who make the determination.

How we support

  • Retainers can cover upgrades, continuous testing and ongoing support after handover, agreed in writing.
  • Re-testing after a new Llama Guard or Prompt Guard release should be agreed as part of scope.
  • Ask whether runtime and model upgrades are included and what the retainer term and exit terms are.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.