litellm/docker/task_insights/docker-compose.yml
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

135 lines
4.2 KiB
YAML

# Task Insights demo: the proxy and dashboard built from this checkout, Postgres, a dedicated Redis,
# a one-shot seed job and an optional analysis worker. See docker/task_insights/README.md.
#
# printf 'LITELLM_MASTER_KEY=sk-%s\nLITELLM_SALT_KEY=sk-%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > docker/task_insights/.env
# docker compose -f docker/task_insights/docker-compose.yml up -d --build --wait
# docker compose -f docker/task_insights/docker-compose.yml run --rm task-insights-seed
#
# The seeded walkthrough calls no model. The worker only starts with `--profile live`.
name: litellm-task-insights
x-litellm-runtime: &litellm-runtime
image: litellm-task-insights:local
pull_policy: never
env_file:
- path: .env
required: false
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,noexec,nosuid,nodev,size=64m,mode=1777
- /app/.cache:rw,noexec,nosuid,nodev,size=128m,mode=1777
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"
services:
litellm:
<<: *litellm-runtime
build:
context: ../..
target: runtime
command: ["--config", "/app/task-insights-config.yaml", "--port", "4000", "--num_workers", "2"]
ports:
- "127.0.0.1:${TASK_INSIGHTS_PORT:-4000}:4000"
volumes:
- ./task-insights-config.yaml:/app/task-insights-config.yaml:ro
environment:
LITELLM_MASTER_KEY: ${LITELLM_MASTER_KEY:?set it in docker/task_insights/.env, see the header of this file}
LITELLM_MIGRATION_DIR: /tmp/litellm-migrations
DATABASE_URL: postgresql://llmproxy:dbpassword9090@db:5432/litellm
REDIS_HOST: redis
REDIS_PORT: "6379"
STORE_MODEL_IN_DB: "True"
LITELLM_TASK_INSIGHTS_ENABLED: "true"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test:
- CMD-SHELL
- python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:4000/health/liveliness')"
interval: 10s
timeout: 10s
retries: 12
start_period: 60s
task-insights-seed:
<<: *litellm-runtime
profiles: ["seed"]
entrypoint: ["python", "-m", "litellm.task_insights.demo_seed"]
command: []
environment:
DATABASE_URL: postgresql://llmproxy:dbpassword9090@db:5432/litellm
depends_on:
litellm:
condition: service_healthy
task-insights-traffic:
<<: *litellm-runtime
profiles: ["live"]
entrypoint: ["python", "-m", "litellm.task_insights.demo_traffic"]
command: ["--help"]
environment:
DATABASE_URL: postgresql://llmproxy:dbpassword9090@db:5432/litellm
LITELLM_TASK_INSIGHTS_GATEWAY_URL: http://litellm:4000/v1
LITELLM_TASK_INSIGHTS_GATEWAY_KEY: ${LITELLM_MASTER_KEY:-}
volumes:
- ./labels:/labels
depends_on:
litellm:
condition: service_healthy
task-insights-worker:
<<: *litellm-runtime
image: litellm-task-insights-worker:local
build:
context: ../..
dockerfile: docker/task_insights/Dockerfile.worker
profiles: ["live"]
command: ["python", "-m", "litellm.task_insights.worker"]
environment:
DATABASE_URL: postgresql://llmproxy:dbpassword9090@db:5432/litellm
LITELLM_TASK_INSIGHTS_GATEWAY_URL: http://litellm:4000/v1
LITELLM_TASK_INSIGHTS_GATEWAY_KEY: ${LITELLM_MASTER_KEY:-}
LITELLM_TASK_INSIGHTS_EMBEDDING_MODEL: qwen3.7-text-embedding
LITELLM_TASK_INSIGHTS_SYNTHESIS_MODEL: claude-sonnet-5-5
LITELLM_TASK_INSIGHTS_DECISION_MODEL: task-insights-decision
NUMBA_CACHE_DIR: /tmp/numba
depends_on:
litellm:
condition: service_healthy
db:
image: postgres:16
restart: unless-stopped
environment:
POSTGRES_DB: litellm
POSTGRES_USER: llmproxy
POSTGRES_PASSWORD: dbpassword9090
volumes:
- task_insights_postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -d litellm -U llmproxy"]
interval: 2s
timeout: 5s
retries: 15
redis:
image: redis:7.4-alpine
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
timeout: 5s
retries: 15
volumes:
task_insights_postgres: