Skip to content

bug(kagent-feast-mcp): requirements.txt installs full CUDA torch (~2.5GB) on a CPU-only base image #198

@Kunal-Somani

Description

@Kunal-Somani

Bug Description

kagent-feast-mcp/mcp-server/requirements.txt lists torch without specifying a build variant. The Dockerfile uses python:3.10-slim — a CPU-only base image with no CUDA drivers or GPU support.

What happens

pip install torch without a variant index installs the full CUDA-enabled wheel (~2.5GB). The container has no GPU and can never use CUDA. The embedding model (all-mpnet-base-v2) runs on CPU regardless, making the entire CUDA payload dead weight.

Impact

  • Final Docker image is ~3.5-4GB instead of under 1GB
  • docker pull and cold-start time are 3-4x longer than necessary
  • CI/CD pipelines building this image waste significant bandwidth and compute on every run
  • No functional benefit — the model runs on CPU either way

Root Cause

# kagent-feast-mcp/mcp-server/requirements.txt
torch   # installs full CUDA wheel (~2.5GB) by default
FROM python:3.10-slim   # CPU-only, no CUDA drivers

Proposed Fix

Pin torch to the official CPU-only wheel using PyTorch's CPU index:

torch --index-url https://download.pytorch.org/whl/cpu
pymilvus
sentence-transformers
fastmcp

This brings torch down to ~200MB, reducing the final image size from ~3.5GB to under 1GB with no change in runtime behavior.

I will submit a PR with this fix.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions