Repository navigation
Closed
Labels
priority/p2-mediumPriority P2: standard workscope/aiAI review pipeline, personas, prompts, LLM client, or RAGscope/k8sKubernetes commands, Helm charts, pods, services, and policiestype/featureType feature: a new function
Milestone
Description
Problem
The gateway's routing config is tuned by hand. #467 found that devops-review held its largest server to about 2 concurrent requests and sent half of all review calls to the slowest servers. Fixing that meant measuring every backend, deriving weights, and editing the ConfigMap. Several values in the gateway config are hand-maintained and silently go stale when the cluster changes:
- Throughput weights per deployment.
max_input_tokens, derived from each backend's context window (vLLM--max-model-len, OllamaOLLAMA_CONTEXT_LENGTH).- One gateway entry per Ollama replica. Today a test enforces this, but nothing generates the entries.
Proposal
Add devops ai gateway tune, delivered in slices:
- Measure and recommend (read-only, this issue's first PR)
- Discover the model group's deployments from the gateway's
/model/info, using the authenticated lookup from the routes fix. - Run a calibrated concurrency sweep against each backend directly, through the Kubernetes API proxy: a Service proxy for vLLM and a pod proxy for each Ollama pod. The same request goes through each backend's OpenAI-compatible API. The gateway cannot pin a request to one deployment: the
ollama/*wildcard takes precedence, and deployment names are not unique. - Report each deployment's saturated throughput and latency, plus recommended weights in proportion to throughput. Add JSON output for automation.
- Optionally, run the same sweep through the gateway, attributing each response by its
x-litellm-model-idheader, to compare the current weights with the recommended ones.
- Discover the model group's deployments from the gateway's
- Render: a diff of
k8s/llm/gateway/configmap.yamlthat updates weights, derivesmax_input_tokensfrom the backend manifests, and generates one entry per Ollama replica. - Apply: with
--apply, update the live ConfigMap, roll out the gateway, run the sweep again, and roll back if throughput drops. - Continuous: re-tune when topology changes, for example a new Ollama replica or a changed model.
Acceptance criteria (slice 1)
-
devops ai gateway tune --model devops-reviewprints each deployment's measured throughput, latency and recommended weight, and changes nothing. -
--jsonproduces the same data machine-readably. - Unit tests cover discovery, the conversion from throughput to weights, and the mapping from backend URL to proxy path, without a cluster.
Metadata
Metadata
Assignees
Labels
priority/p2-mediumPriority P2: standard workscope/aiAI review pipeline, personas, prompts, LLM client, or RAGscope/k8sKubernetes commands, Helm charts, pods, services, and policiestype/featureType feature: a new function
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(ai): devops ai gateway tune measures capacity and cost per backe…
feat(ai): devops ai gateway tune measures capacity and cost per backe…
dan-petty commentedon Sep 24, 2026
Closed by #484, merged into
release/v0.2.23.GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by
devops gh issues close-merged.feat(release): v0.2.23 (#681)