litellm/docker/task_insights/Dockerfile.worker
Joshua Valluru ef21f7bb1e feat(task-insights): seeded preview branch that runs without building Rust
Ports the Task Insights feature from litellm_task_insights_poc (b11cf90c4b) onto 07c7229895 so the seeded
demo can reuse the published multi-arch image built from that commit for the compiled extension and Python
dependencies. litellm/accounting/worker.py, litellm/repositories/accounting_delivery_repository.py and
litellm/proxy/deps/repositories.py are adapted by hand to the older accounting worker. The feature's tests come
along except tests/unit/accounting/test_worker.py, which does not exist at this base.

docker/task_insights/demo.sh builds the preview image (dashboard only, 4 GiB Node heap), starts Postgres, Redis
and the gateway in their own Compose project on localhost, seeds sample data and says how to sign in. It writes
random credentials only when missing, refuses a busy port, and keeps the database on stop. The image build
fails when the base image's compiled extension lacks a function the Python package expects.

Only the seeded flow is verified on this branch. Live discovery and bucketing were verified on the feature branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:23:16 -08:00

15 lines
751 B
Text

# syntax=docker/dockerfile:1.7
# The Task Insights analysis worker: the branch image plus the clustering libraries discovery needs.
# Build the litellm service of docker/task_insights/docker-compose.yml first, it produces the base image.
ARG BASE_IMAGE=litellm-task-insights:local
ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a
FROM $UV_IMAGE AS uvbin
FROM $BASE_IMAGE
USER root
COPY --from=uvbin /uv /usr/local/bin/uv
COPY docker/task_insights/worker-requirements.txt /tmp/worker-requirements.txt
RUN uv pip install --python /app/.venv/bin/python --require-hashes --no-deps -r /tmp/worker-requirements.txt \
&& rm /usr/local/bin/uv /tmp/worker-requirements.txt
USER 65532:65532