Skip to content

feat(cli): measured per-deployment capability probes replacing parameter-count failover floors #595

Description

@dan-petty

Context & Rationale

#430 added parameter-count floors (reasoning >=30B, coding >=7B) in src/devops_cli/ai/capability.py. They are inferred from the model name, and a name it cannot parse passes (capability.py:105). The gate runs in GatewayRouter.trigger_failover (src/devops_cli/ai/gateway.py:509) and in ConstellationManager.failover. trigger_failover is a manual CLI path that no live request uses. Live failover is LiteLLM's static fallbacks (k8s/llm/gateway/configmap.yaml:136-138). There, devops-reasoning falls to devops-coder. While both were vLLM deployments (32B AWQ and 14B AWQ) that was the edge the 30B floor forbids; vLLM was removed in #734 and both groups now route to ollama_chat/qwen3-coder:30b on ollama-48gib, so the edge meets the floor but fails over to the same backend. devops-coder falls to devops-reasoning, then to devops-chat (now Qwen3.8 27B). Only the chat task uses these fallbacks. Reviews use devops-review, which has no fallback but shuffles across two models (qwen3-coder:30b and gpt-oss:20b). probe_backend (gateway.py:624) checks health only. gateway tune measures capacity and cost only. vibes' 0%-vs-85%+ figures describe a 70B tier that is not deployed here, and they have not been measured.

Scope & Deliverables

  • Context & Rationale*: feat(ai): capability-gated model failover & aimd batch recovery #430 added parameter-count floors (reasoning >=30B, coding >=7B) in src/devops_cli/ai/capability.py. They are inferred from the model name, and a name it cannot parse passes (capability.py:105). The gate runs in GatewayRouter.trigger_failover (src/devops_cli/ai/gateway.py:509) and in ConstellationManager.failover. trigger_failover is a manual CLI path that no live request uses. Live failover is LiteLLM's static fallbacks (k8s/llm/gateway/configmap.yaml:136-138). There, devops-reasoning falls to devops-coder. While both were vLLM deployments (32B AWQ and 14B AWQ) that was the edge the 30B floor forbids; vLLM was removed in feat(k8s): modernize monitoring stack, llm profiles, traefik routing, and remove squid proxy #734 and both groups now route to ollama_chat/qwen3-coder:30b on ollama-48gib, so the edge meets the floor but fails over to the same backend. devops-coder falls to devops-reasoning, then to devops-chat (now Qwen3.8 27B). Only the chat task uses these fallbacks. Reviews use devops-review, which has no fallback but shuffles across two models (qwen3-coder:30b and gpt-oss:20b). probe_backend (gateway.py:624) checks health only. gateway tune measures capacity and cost only. vibes' 0%-vs-85%+ figures describe a 70B tier that is not deployed here, and they have not been measured.
  • Deliverable*: Slice 1 is report-only: a capability pass in devops ai gateway tune. Extend the stdlib in-pod runner (gateway_bench.py) to return reply text. Its run_level keeps only usage.completion_tokens today. Send vibes' four probes (5-field JSON, 10-tool choice, deep recall, explicit prohibition) in the production prompted format. Do not use native tools/response_format, because reviews do not use them. Score on the CLI side with pydantic_evals, which the pinned pydantic-ai already installs: a Dataset of Cases, deterministic evaluators and evaluate(repeat=N). Also record whether response_repair.fix_llm_response had to repair the reply. Persist results per deployment id in feat(ai): llm gateway tuning cost from real traffic and no-load capacity estimates #477's store. Slice 2 comes with feat(ai): llm gateway tuning render and apply configuration with rollback #478: floors read these records instead of parameter counts. The rendered config drops below-floor fallbacks targets and flags below-floor devops-review deployments. Slice 3 adds a client-side floor check on served_by (feat(ai): llm gateway calls record their serving backend in the spend ledger #474). Out of scope: task-class ordering driven by 429 responses. Local offload of mechanical sub-agent work already exists (src/devops_cli/ai/harness/slots.py:133,363).
  • Constraint*: A gate only in GatewayRouter never touches real traffic. Probing a model group averages two models into one number. A 32K recall probe exceeded devops-coder's max_input_tokens: 12288, but that was vLLM's 16K window and went with vLLM in feat(k8s): modernize monitoring stack, llm profiles, traefik routing, and remove squid proxy #734; the Ollama tiers the gateway routes to now allow 48000 to 160000 tokens (OLLAMA_CONTEXT_LENGTH in k8s/llm/profiles/ollama-profiles.yaml), so windows still differ per deployment. Size it per deployment, as deployment_prompt_tokens (gateway_tune.py:243) already does. Four prompts are a smoke test and do not replace feat(review): per-model review quality baseline for the devops-review pool #475's whole-review baseline. Record pass counts over repeated temperature-0 trials. Report a deployment that was never probed as unmeasured rather than passing. Change no routing until slice 1 has run.
  • Measured*: grep -c 'model_name: devops-review' k8s/llm/gateway/configmap.yaml gives 4 deployments. awk '/model_name: devops-review/{f=1;next} /model_name:/{f=0} f && /model:/{print $2}' k8s/llm/gateway/configmap.yaml | sort -u | wc -l gives 2 models. The tool-call-parser|enable-auto-tool-choice grep no longer applies: those were vLLM flags, and vLLM was removed in feat(k8s): modernize monitoring stack, llm profiles, traefik routing, and remove squid proxy #734. grep -rln pydantic_evals src tests | wc -l gives 0.
  • Source*: vibes observations/devops-cli/20-model-failover-capability-cliffs-and-one-way-degradation-ratchets.md, vibes observations/devops-cli/06-rate-limits-and-anti-brittle-heuristics.md, vibes observations/devops-cli/05-harness-slots-and-subagent-offloading.md

Update 2026-10-08: refinement

devops-review falls back to devops-background (k8s/llm/gateway/configmap.yaml:196), so 'which has no fallback' no longer holds, and it has 3 deployments, not 4. The router is least-busy (:177) and ignores weights, so slice 2 cannot starve a deployment through them. Per the owner's #1001 decision, floors come from probe records keyed by deployment, and the name-parsed counts in ai/capability.py go.

Proposed design

Problem statement

The current failover capability checking in devops-cli relies on parameter-count floors inferred from model names, which are outdated and do not reflect actual deployment capabilities. This leads to incorrect failover decisions and potential routing to underpowered models.

Acceptance criteria

  • Criterion 1: A capability pass is reported in devops ai gateway tune command
    Verification: Run devops ai gateway tune and verify that it reports capability pass results for deployments
  • Criterion 2: Four probe prompts are sent to production prompted format
    Verification: Verify that the four probes (5-field JSON, 10-tool choice, deep recall, explicit prohibition) are sent in the production prompted format
  • Criterion 3: Results are scored using pydantic_evals with deterministic evaluators
    Verification: Run a test with pydantic_evals and verify that it correctly evaluates the probe responses with deterministic evaluators
  • Criterion 4: Probe results are persisted per deployment id in store from feat(ai): llm gateway tuning cost from real traffic and no-load capacity estimates #477
    Verification: Check that probe results for each deployment are stored in the persistence layer referenced by issue feat(ai): llm gateway tuning cost from real traffic and no-load capacity estimates #477

Key questions

  • What is the current mechanism for failover capability checking?: The current mechanism relies on parameter-count floors inferred from model names, which are defined in src/devops_cli/ai/capability.py and enforced in GatewayRouter.trigger_failover and ConstellationManager.failover. [sources: src/devops_cli/ai/capability.py, src/devops_cli/ai/gateway.py:509]
  • Should the gate in GatewayRouter touch real traffic?: No, a gate only in GatewayRouter never touches real traffic. [sources: src/devops_cli/ai/gateway.py:509]
  • What is the current structure of fallbacks for devops-review?: Currently, devops-review falls back to devops-background, and there are 3 deployments using this pattern. [sources: src/devops_cli/ai/gateway.py:196]

Open questions

  • What are the specific changes needed to replace parameter-count floors with capability probes? (missing verified source)
  • How will the probe records be used instead of parameter counts? (missing verified source)
  • What is the expected behavior of the probe backend? (missing verified source)

Fit

Needs splitting into 3 items:

  1. Slice 1: Report-only capability pass in devops ai gateway tune with probe backend extension
  2. Slice 2: Floors read probe records instead of parameter counts
  3. Slice 3: Client-side floor check on served_by

Suspected block

None.

Dependencies

#477, #478

Activity

  1. added this to the v0.2.23 milestone on Sep 25, 2026
  2. added
    type/feature
    scope/cli
    priority/p2-medium
    on Sep 25, 2026
  3. modified the milestones: v0.2.23, v0.2.24 on Sep 28, 2026
  4. removed this from the v0.2.23 milestone on Oct 1, 2026
  5. dan-petty commented on Oct 1, 2026

    @dan-petty
    OwnerAuthor

    Moved from the shipped v0.2.23 to the backlog. It is still valid (checked 2026-10-01), and P2 items don't displace P1 work in the planned releases.

  6. added
    scope/ai
    and removed
    scope/cli
    on Oct 2, 2026
  7. added this to the v0.2.39 milestone on Oct 17, 2026
  8. dan-petty commented on Oct 17, 2026

    @dan-petty
    OwnerAuthor

    Proposal needs splitting into 3 items at 3dd7fa6 (see proposed design in issue body).

  9. modified the milestones: v0.2.39, on Oct 20, 2026
  10. added a commit that references this issue on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p2-mediumscope/aitype/feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions