litellm/litellm-rust/loadtest/compose.yaml
Claude a934182437
feat(gateway): customer-proxy scaffolding: NODELAY, configurable image build, load-test kit
- Set TCP_NODELAY on accepted sockets; Nagle was holding small SSE chunks
  for the client's delayed ACK (~40 ms per stream).
- Gateway Dockerfile takes LTO / CODEGEN_UNITS build args for faster
  iteration builds; release defaults are unchanged.
- litellm-rust/loadtest: mockllm (OpenAI chat + Anthropic messages,
  directive-driven timing, per-deployment hits and fault injection),
  open-loop loadgen with workload files (1 s to 30 min requests,
  10k to 1M token contexts, many keys and deployments), genconfig,
  summarize, procmon, compose file, image build script, and AWS
  Terraform plus a run script for an out-of-process rig.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0142NUB9q7gotdupNjp63QgB
2026-10-15 21:47:45 +00:00

36 lines
1.4 KiB
YAML

# Local, out-of-process smoke test: gateway, mock upstream and load generator in separate
# containers. Not a perf number (one host), but the same images and workloads as the cloud rig.
#
# docker run --rm -v "$PWD/out:/work/out" litellm-loadtest genconfig -out out \
# -mocks http://mockllm:9000 -chat-provider openai_like
# GATEWAY_IMAGE=litellm-rust-gateway:<tag> TOOLS_IMAGE=litellm-loadtest:<tag> docker compose up -d gateway mockllm
# docker compose run --rm loadgen loadgen -workload /workloads/smoke.json \
# -target http://gateway:4000 -key sk-loadtest-master -out out/smoke.jsonl
# docker compose run --rm loadgen summarize out/smoke.jsonl
services:
mockllm:
image: ${TOOLS_IMAGE:-litellm-loadtest:local}
command: ["mockllm", "-addr", ":9000", "-faults", "${MOCK_FAULTS:-}"]
gateway:
image: ${GATEWAY_IMAGE:-litellm-rust-gateway:local}
environment:
LITELLM_CONFIG: /config/config.yaml
PORT: "4000"
volumes:
- ./out:/config:ro
ports:
- "4000:4000"
depends_on: [mockllm]
procmon:
image: ${TOOLS_IMAGE:-litellm-loadtest:local}
pid: "service:gateway"
user: "10001" # the gateway's uid, so /proc/1/fd is readable
command: ["procmon", "-pid", "1", "-every", "5s"]
depends_on: [gateway]
loadgen:
image: ${TOOLS_IMAGE:-litellm-loadtest:local}
profiles: ["run"]
working_dir: /work
volumes:
- ./out:/work/out
depends_on: [gateway]