#31877 feat(proxy): add per-deployment keepalive_seconds SSE heartbeat for long-running streams
## Problem
For long-running streaming LLM responses, reverse proxies and load balancers (nginx, AWS ALB, Cloudflare) close idle SSE connections after their timeout threshold (often 60s). If a model takes longer than this between tokens, the connection is dropped and the client sees a truncated stream with no error.
## Proposed fix
Add a `keepalive_seconds` option to per-deployment config. When set, the proxy sends periodic SSE comment lines (`: keepalive\n\n`) at that interval during streaming pauses, keeping the connection alive through upstream idle-timeout thresholds without affecting the stream content visible to the client.
## Files
- `litellm/proxy/` (streaming response handling)