ModelScan on Docker vs Kubernetes vs VMs

ModelScan is a CLI and Python API that scans model files and exits, so the real choice is where the scan job runs: a pinned VM, a container image or a Kubernetes job. This page sets out when each option fits a team's size and existing platform.

On this page

ModelScan deployment options: which setup fits which team

A team that must scan model files inside its own infrastructure should decide where the scan job runs before deciding anything else. ModelScan runs as a CLI and a Python API that returns a nonzero exit code when it finds unsafe code, so the scanner works anywhere a pinned Python process can read the artifact. The three options differ in who patches the host, how the Python environment is pinned, and how scan jobs are scheduled and retried. Choose the option your team already operates, because the scanner adds little load on its own and the surrounding platform decides most of the effort.

A virtual machine with a pinned Python environment fits a small team with no CI platform of its own, a scanning workload that runs a few times a day, or an air-gapped network where moving a locked package set is simpler than moving images. Pin the interpreter to a version in the supported range, Python 3.10 up to but not including 3.13, and record the ModelScan version in a lock file so every scan applies the same rules. The current release, 0.8.8, came out on February 18, 2026 (see the ModelScan releases page). A container image fits a team whose existing CI runner already executes Docker jobs. The image bakes in the same interpreter and ModelScan version, and the pipeline step calls the CLI and fails the build on the nonzero exit code. Confirm that the runner can mount model artifacts read-only and that a ModelScan upgrade triggers an image rebuild.

A Kubernetes cluster is worth its overhead only when the cluster already exists and several teams or pipelines need scan jobs on a shared schedule. In that case a Kubernetes Job per scan gives retries, resource limits and run history through the platform's own logging, and a node pool can be sized for the largest artifacts your team handles. For a single pipeline, the cluster adds manifests, registry access, admission policy and an upgrade cycle that the scanner itself does not need. Before committing, ask who owns cluster upgrades, whether scan pods can read model storage under your storage policy, and whether the image can be pinned to the same ModelScan version as your CI job. High availability for a batch scanner comes from the scheduler rerunning a failed job, so extra replicas add little.

How Docker, Kubernetes and VMs compare for ModelScan scans

This table compares how ModelScan scan jobs are packaged, run, sized, upgraded and backed up on Docker, Kubernetes and virtual machines. Read each row as a question your platform team must answer, and treat the shared Python runtime row as a fixed constraint for all three. The main takeaway is that a scan is mostly file reading, so the choice usually turns on how your team already runs containers, clusters or VMs.

FactorDockerKubernetesVirtual machines
Unit deployedA container image with ModelScan and a pinned Python baseA Job or CronJob running the scanner image, one pod per scanA virtualenv or package install on a host, started from a shell or scheduler
Where the scan runsOn one Docker host or CI runner, started by the pipeline or cronOn cluster worker nodes, scheduled by the control plane with other workloadsOn a dedicated or shared VM that your team patches and monitors
Main sizing leverCPU and memory allotted to the container, plus disk read speed for large filesPod resource requests and limits, and how many scan Jobs run in parallelVM size (vCPU, memory, disk throughput), chosen up front and resized by hand
High availability for a scan jobNone built in; re-run the container on another host if one failsJob retries and rescheduling onto healthy nodes, so a failed scan repeats the same checkDepends on the hypervisor or a second VM with a scripted or manual failover
UpgradesRebuild the image with the new ModelScan pin, redeploy and keep the old tag for rollbackChange the image tag in the Job template or chart values, and roll back by reverting the tagUpgrade the package in place or build a new VM, then confirm the Python version still fits
BackupsBack up image tags, scan reports and pipeline config, since containers are rebuiltBack up manifests, registry images and report storage in persistent volumes or object storageSnapshot or back up the whole VM, plus scanner config and reports
Python runtimePython 3.10 to 3.12, set by the ModelScan 0.8.8 support rangePython 3.10 to 3.12, set by the ModelScan 0.8.8 support rangePython 3.10 to 3.12, set by the ModelScan 0.8.8 support range
Skills neededContainer builds, image registry management, CI scripting and basic LinuxKubernetes Jobs, manifests, resource tuning, RBAC and cluster loggingLinux administration, Python packaging, patching and host monitoring
Main cost driversHost capacity, registry storage and time to maintain pipeline wiringCluster platform cost if none exists yet, node capacity and platform team timeVM hours, patching effort and keeping OS and Python versions aligned

ModelScan deployment options compared by what actually runs the scan

Each option changes which layers your team owns and who patches them, so the choice is about where the scan executes. The four cards cover a container image, a Kubernetes job, a virtual machine and the CI step that reads the exit code. ModelScan documents no server component, so confirm that none of these options needs a listening service before you approve it.

Container image built from PyPI

The team builds an image that installs the modelscan package from PyPI, pinned to a known release such as 0.8.8. The team owns the base image, the Python runtime inside it and the volume that mounts model files for the scan. Whoever rebuilds the image patches the base OS packages, so schedule rebuilds for each ModelScan and base image update. Pick a Python version from 3.10 through 3.12, the range ModelScan 0.8.8 supports, and confirm the container exposes no port.

modelscan on PyPI

Kubernetes job or runner pod

The scan runs as a Job that mounts model files from a persistent volume or object storage mount, then exits. The platform team owns the cluster, nodes and container runtime, while the team owns the image and the Job specification. Confirm that a nonzero scan exit code marks the Job as failed so the pipeline sees the result, and set retry limits so a flagged model is not retried into a pass. Confirm the pod needs no Service or listening port.

VM with pinned Python environment

A virtual machine runs ModelScan inside a virtual environment with every dependency version locked, so scan behavior does not shift when a package updates. The team owns the operating system, the Python interpreter, the local disk holding model files and the scan logs. Python security updates can change the environment, so review the lock file before applying them. Ask the vendor whether any ModelScan mode opens a network service before the VM is reachable by other hosts.

CI gate reading the exit code

A pipeline step runs the ModelScan CLI on each model file before promotion, and the step fails on a nonzero exit code. The CI runner, pipeline definition, artifact retention and scan logs belong to the team, and the runner image or hosted runner update cycle sets the patch rhythm. Confirm which severity levels among CRITICAL, HIGH, MEDIUM and LOW produce a nonzero exit code in the version you pin. Keep the report as a pipeline artifact so reviewers can see what blocked a model.

ModelScan repository

A model file reaches loading only after the scan gate passes

A model file starts at the Hugging Face Hub or an internal registry, outside the trust boundary. It is copied into staging storage inside the internal network, then picked up by a scan job running on Docker, Kubernetes or a virtual machine. That job calls the ModelScan CLI, which reads the file's bytes without loading it. A nonzero exit code sends the file and its report to quarantine. Only a passing result moves it to the approved store, and the model is loaded from there. The Hugging Face pickle import scan runs on the Hub side as a separate check and does not replace ModelScan. Confirm how the boundary crossing is controlled and who can release files from quarantine.

Loading happens only after the scan gate passes; failed files stay in quarantine.

Sizing ModelScan deployment options around file size and disk reads

Scan time for ModelScan follows the time needed to read each model file from disk. The project's README says the tool reads files byte by byte, looking for unsafe code signatures, without loading them, so embedded code never runs and a scan takes about as long as the read itself. That makes sizing an input and storage question. Start with the largest model files your pipeline will scan, because one very large checkpoint can take longer than a batch of small ones. Then count how many scans will run in parallel, since concurrent reads from the same volume share its throughput.

Each option changes where those reads land. In Docker, the scanner container reads from whatever you mount, so the host disk and the volume driver set the throughput. In Kubernetes, reads go through the storage class behind the persistent volume claim or a node-local volume, and parallel scan pods can land on nodes with different disks, so pin the scan Jobs to a known node pool if throughput matters. On virtual machines, throughput depends on the virtual disk type and contention on the hypervisor's shared storage. For each option, confirm where your intake step stages downloaded model files and how much scratch space that uses, because copies of multi-gigabyte files can exhaust a small volume before the scan starts.

Before you choose an option, measure your own file sizes. List every model format your team scans, such as PyTorch Pickle, Keras H5 or Joblib files, and record the largest file, the typical file and the number of files per release or per day. Those counts, combined with the parallel scan limit you set, give you the read volume your storage must sustain within your intake window. Then time one scan of your largest file on each option: the Docker host, a Kubernetes node in the target pool and a VM with the disk type you would deploy. The ModelScan project does not publish capacity figures, so the only reliable sizing numbers are the ones you collect yourself. Confirm the disk type, throughput and scratch limits for each option with your cloud or data center provider before you commit.

How each option handles ModelScan upgrades and backups

On Docker, a ModelScan version change is a new image build. You change the pinned version in the Dockerfile or build argument, rebuild the image, run a scan against a known test model, and point your pipeline at the new tag. The previous image stays available for rollback as long as your registry keeps it. Because the scanner and its Python runtime both live inside the image, the Python constraint in ModelScan 0.8.8 is the first check. The base image must provide Python 3.10 up to but not including 3.13, or the pin will not run as expected.

  • First upgrade check: Confirm the base image Python version sits in the 3.10 to below 3.13 range before you edit the pin. Read the ModelScan releases page for the release notes that apply to your target version.
  • Pipeline definitions: Keep the Dockerfile, build arguments and CI job definitions in version control so the image can be rebuilt from the repository.
  • Gate policy: Store the severity threshold and exit-code handling in version control and mount them at runtime, so every policy change is a reviewed commit.
  • Scan reports: Write reports to a mounted volume or object store that outlives the container. Reports written only inside a container are lost when it is removed.
  • Version record: Log the image tag, the image digest and the ModelScan version for each scan run, so you can show which scanner produced a given result.

A scan does not need its own backup because it can be rerun from the same image digest against the same model files, provided you keep those files or their hashes under your model registry controls.

Check that a restore rebuilds the exact image digest and reproduces the findings and exit code from the known test model.

Operating effort for upgrades, backups, monitoring and skills

This table compares the day-two work of running ModelScan on Docker, Kubernetes and virtual machines across upgrades, backups, monitoring, patching and skills. Read each row as a question to put to your own platform team: who does the work, and how often it repeats per image, cluster or host. ModelScan is one scanning step, so most of the operating effort comes from the platform underneath it.

AreaDockerKubernetesVirtual machines
UpgradesRebuild the image with the new release and redeploy. Pin the version in the Dockerfile and rescan after each rebuild.Roll a new image tag through the deployment manifests. Cluster changes such as admission policies and node pools follow a separate upgrade track.Upgrade the package on each VM or rebuild the VM image. Drift between hosts is the main risk when upgrades are applied by hand.
BackupsBack up scan configuration, CI definitions and any reports kept on the host. The image can be rebuilt from its source files.Back up scan configuration and reports through the cluster's existing backup tooling. Confirm who owns that tooling before go-live.Back up the VM or its disk image so a failed host restores with its Python environment intact. Snapshot timing needs care.
Monitoring and loggingCollect container output and exit codes, then forward them to your log platform. Non-zero exit codes from CI runs are the main failure signal.Scan jobs run as short-lived pods, so job status, pod events and node metrics need collection. Confirm cluster logging covers those pods.Use host agents for system logs and scan output. Standard host monitoring covers most needs, with scan results added separately.
Patching the base OS and PythonRebuild base images to pick up OS patches. ModelScan supports Python 3.10 up to but not including 3.13, so pin the interpreter within that range.Patch node operating systems through the cluster's node upgrade process and rebuild images for base and Python updates. The same Python range applies.Patch the guest OS and Python on each VM, usually through configuration management. Each host is a separate patch target, so drift is more likely.
Skills neededContainer build and registry basics, plus CI scripting. Less cluster knowledge is needed, but image hygiene matters.Cluster operations, RBAC, job scheduling and image policy. Many of these skills overlap with platform engineering the team may already have.Linux administration, configuration management and patch management. Familiar to most infrastructure teams, but manual drift needs active control.
Who usually owns the workUsually the CI or DevSecOps owner, with the platform team supporting the build host.Usually the platform engineering team, with security owning scan policy and exception handling.Usually the infrastructure or systems team, with security reviewing the scanner configuration.

How to pin ModelScan 0.8.8 and retest after each upgrade

This sequence pins ModelScan 0.8.8 to a supported Python version, builds the same scanner on Docker, Kubernetes or virtual machines, and proves it flags and passes the right files before any rollout. Each step ends with a check you can record, so the change record shows which version ran where. Repeat the sequence after every upgrade.

  1. Confirm targets run Python 3.10, 3.11 or 3.12

    Check the Python version on each target before you build anything. On Docker, read the base image tag. On Kubernetes, read the image that your pods actually run. On virtual machines, run python3 --version on every host that will execute the scanner. ModelScan 0.8.8 supports Python 3.10 up to but not including 3.13, so a runtime outside 3.10, 3.11 or 3.12 must change before you pin anything. Ask the platform team to confirm the version in writing for each node pool and VM image. Done when every target reports 3.10, 3.11 or 3.12 and the result is in the change record.

  2. Pin ModelScan 0.8.8 after checking releases

    Open the ModelScan releases page before you choose a pin and look for versions published after 0.8.8, which was released on February 18, 2026. If a later release exists, read its notes and decide which version your team will pin. Then pin that version exactly in your lockfile, and use the same version in the Docker image tag or base image layer and in the Kubernetes or VM build script. Avoid version ranges that float to newer releases. Done when the lockfile, image definition and VM build script all name the same version string.

  3. Build the scanner on each platform

    Build the environment the way each platform runs it, using only the pinned version. On Docker, build one image from the pinned base and install modelscan at the pinned version. On Kubernetes, push that image to your internal registry and deploy it through your usual manifests or chart. On virtual machines, create a virtual environment on each host and install the same version. Run pip show modelscan inside each build to confirm the installed version matches the pin. Done when every image and virtual environment reports the pinned version and no target still runs an older copy.

  4. Run the scanner against approved fixtures

    Ask the security team to approve a fixture set before the first run. It should include model files they expect ModelScan to flag and clean files they expect it to pass. Cover each format your teams load, such as PyTorch pickle, Keras H5 or Keras V3, and classic Pickle, Cloudpickle, Dill or Joblib files, because ModelScan covers all of these and you need evidence for each one. Run the CLI on every target against the same fixtures and keep the output. Done when each flagged file is reported at the severity the security team recorded and each clean file passes, with any mismatch blocking the rollout until it is explained.

  5. Confirm nonzero exit codes fail the pipeline

    Confirm that the CI/CD job stops when ModelScan returns a nonzero exit code. Add a stage that runs the CLI on a known flagged fixture and check that the job fails and the deploy stage does not start. Repeat on each path: the Docker image build, the Kubernetes deploy pipeline and the VM release job, since each one may wrap the command differently. Then run a clean fixture and confirm the job passes. Done when the flagged fixture blocks the pipeline on all three paths and the clean fixture lets it continue.

  6. Record version and release notes before rollout

    Before any rollout, add the pinned version, a reference to its release notes and the fixture results to the change record. For Docker, record the image tag and digest. For Kubernetes, record the image tag and namespace. For virtual machines, list each host and its install path. Also record the Python version from the first step. Repeat these steps after every upgrade, so the record always shows a fresh fixture run for the version now in production. Done when the change record names one version for each platform and the fixture run is dated after the pin.

What it costs to move ModelScan between deployment options later

The scanner package is the easiest part to move. ModelScan 0.8.8, released on February 18, 2026, supports Python 3.10 up to but not including 3.13, so a pinned version and interpreter can usually move unchanged. The costs sit in everything around it: pipeline definitions that call the CLI and act on its nonzero exit codes, image build steps that install the package, storage paths where candidate model files are staged, access controls that decide who can edit the gate, and the record of scan results that reviewers may ask to see. Each of these was written against the platform it was first built on, so each one needs rebuilding in the new environment. Check the ModelScan releases page for the version you pinned before you plan the move.

Three activities drive most of the effort. The first is rewriting pipeline steps, because a Compose service, a Kubernetes Job and a VM cron entry each handle secrets, file mounts, retries and artifact upload differently. The second is rerunning the same fixtures to confirm gate behavior. Keep a small set of known-clean and known-unsafe model files, then check that a CRITICAL or HIGH finding still fails the build in the new location and that the clean file still passes. A green pipeline alone does not show the gate works. The third is re-approving access: service accounts, registry or artifact permissions, and the people who may change the gate configuration, each usually needing a fresh sign-off from the security owner.

Decide in advance which parts are portable. A practical split keeps the portable layer in version control: the pinned ModelScan version, the CLI invocation, the severity threshold that fails the build and the report format. The platform layer covers the runner, image base, storage mount, service identity and log destination. Record that split in the design notes before the first deployment, so a later move changes only the platform layer. Ask your security team now which scan records must be retained, for how long and in which system, because that answer decides how much of the results store can move. Changes like this should be scoped in writing before work starts, with pipeline changes, fixture reruns, access changes and retesting listed as separate deliverables, so the quote follows from a defined move.

Questions teams ask before choosing a ModelScan deployment

Does ModelScan need Kubernetes to run?

No. ModelScan is an Apache-2.0 Python package with a command-line interface and a Python API, so it can run as a step in a CI/CD pipeline, on a workstation or on one virtual machine. Kubernetes starts to pay off when you need many scan workers, scheduled jobs that grow with intake, or the same deployment pattern as your other services. It also adds cluster operations, image builds and access control that a scanner may not need. Whichever host you pick, settle the runtime first. ModelScan 0.8.8, released on February 18, 2026, supports Python 3.10 up to but not including 3.13, so build your image or virtual environment on 3.10, 3.11 or 3.12. Test that version before you roll out the gate.

What drives the cost and effort of running ModelScan?

The main drivers are how many models you scan, how large those files are, how often scans run, and how many people must maintain the host. ModelScan reads model files byte by byte and never loads them, so a scan takes about as long as reading the file from disk. Storage throughput and file size therefore tend to set the runtime. Costs fall into two groups. One-time costs cover designing the pipeline, the gate that blocks unsafe files, and the evidence your security team reviews. Recurring costs cover patching the scanner, keeping the Python runtime on a supported version, rescanning when policy changes, and watching alerts. Every failed scan needs a person to triage it, so the number of findings also drives labor. Ask any provider for a quote that lists these drivers separately, with who performs each task and who keeps the host running after handover.

How long does ModelScan setup take and what does a quote depend on?

Setup time depends on the environment and the scope, so no duration can be given here. DeployOpen publishes no price list, and a quote follows the written scope. The factors that change effort include the hosts you must build and secure, whether scans sit inside existing pipelines or need new ones, how many model formats and repositories are in scope, how your change control and approvals run, and whether you need evidence packs for an assessment. Each factor changes the work and the people involved, so the written scope should name them. Ask for the deliverables, the environment assumptions, the handover steps, the acceptance criteria and the dependencies on your own teams, such as access to repositories and identity systems. Those assumptions are what make two quotes comparable.

What must our team have in-house to run ModelScan alone?

Your team needs a named owner for the scanner and the skills to operate the host it runs on. In practice that means:

  • Python packaging skills to pin ModelScan and a supported interpreter, keeping the 3.10 to 3.12 range in mind for ModelScan 0.8.8.
  • Linux administration for the virtual machine or container host, including patching, logging and backup of scan reports.
  • CI/CD skills to map the CLI's nonzero exit codes to a gate that blocks a failed model load.
  • Security triage capacity to review CRITICAL, HIGH, MEDIUM and LOW findings and decide what to quarantine.

Someone must also decide when to upgrade after a new release and test that upgrade before it reaches the gate. If these roles sit with one or two people, a handover plan matters as much as the first installation.

Can a ModelScan virtual machine move to Kubernetes later?

Usually yes, because ModelScan is a Python package and CLI, so the scanning logic does not depend on the host type. The work sits in the surrounding parts: the image build, the pinned Python version, the way model files reach the pods (for example, through a mounted volume or an object store), the secrets for any registry access, and the rollout of the new gate in your pipeline. Plan the move as a parallel run. Keep the virtual machine scan path until the cluster path produces the same findings on the same test set, and keep the report format and exit-code handling unchanged. Ask your implementation partner to keep the host layer separate from scan policy, so a later move changes one layer only. Budget for the migration as real engineering work with its own test and cutover steps.

Is there a managed or enterprise ModelScan option?

Confirm this with Protect AI before you plan around it. The ModelScan README describes Guardian as Protect AI's enterprise model scanning product, with newer scanners, broader model support and enforcement for Hugging Face models. That description does not settle whether Guardian is a managed or enterprise option for a self-hosted ModelScan deployment, so ask Protect AI what it covers, how it is licensed, and whether it replaces or sits beside ModelScan. ModelScan itself is Apache-2.0 licensed, so the tool carries no license fee. DeployOpen plans, implements, hardens, backs up, upgrades and supports self-hosted open-source platforms inside your infrastructure. DeployOpen is not a Protect AI partner or reseller. DeployOpen publishes no price list, and a quote follows the written scope.

How DeployOpen scopes and runs ModelScan deployments

DeployOpen plans, implements, hardens, backs up, upgrades and documents self-hosted open-source platforms inside your own infrastructure. The same method applies to ModelScan on Docker, Kubernetes or virtual machines, with the runtime choice made in the written scope. Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.

How we scope

  • The written scope names the runtime (Docker, Kubernetes or VMs) and the reasons for choosing it.
  • Scope lists the model file types, scan points and CI jobs that ModelScan will cover in your environment.
  • Engagements are fixed-scope, and ongoing support can be added later as a retainer.

How we build

  • Install ModelScan 0.8.8 on a Python version from 3.10 up to, but not including, 3.13.
  • Wire the CLI exit codes into your CI/CD pipeline or call the Python API from build jobs.
  • Harden the Docker image, VM or Kubernetes manifests, then test the scan step against known-unsafe sample files.

How we hand over

  • Documentation covers deployment steps, scan points, exit code handling and operating notes for the chosen platform.
  • Handover includes backup and upgrade procedures for the model storage and scanner components, as set out in scope.
  • Open items, owners and any scan findings are recorded in the handover so your team can review them.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Re-check the Python range before any upgrade, since ModelScan 0.8.8 excludes 3.13.
  • Confirm which team owns scan results, alerts and escalation before go-live.

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.