fix: install pip via ensurepip before installing requirements

The litellm/litellm base image uses uv to manage a virtualenv at
/app/.venv, which does not include pip. Running ensurepip first
bootstraps pip inside the venv so we can install numpy, scikit-learn
and other extra dependencies.
This commit is contained in:
CM Consultor
2026-08-06 22:47:08 +00:00
parent 38e800bd3c
commit 44579d6830

View File

@@ -46,7 +46,8 @@ COPY --chown=litellm:litellm \
# 6. Install the extra Python deps that the router needs:
# - numpy (for cosine similarity)
# - scikit-learn (for the Jaccard fallback)
RUN python3 -m pip install --no-cache-dir -r requirements.txt
RUN python3 -m ensurepip --upgrade && \
python3 -m pip install --no-cache-dir -r requirements.txt
# 7. Expose the port used by LiteLLM
EXPOSE 4000