Skip to content

feat(k8s): fall back from claude-sonnet-5-5 to deepseek-v4.1-flash-1017 #3152

Description

@dan-petty

Problem or Motivation

The hosted groups of the gateway have no fallback. When Anthropic answers an error, a rate limit, or the account reaches its spend limit (this happened on 2026-11-02), a call to claude-sonnet-5-5 fails, and nothing else can answer. The evaluation of 2026-11-02 measured which hosted models can stand in for it.

Review of a plan, recall of the known defects of 12 golden plans (the cited files as context, no tools; matching by an independent agent, .data/agent/scratch/model-eval/):

Model Recall Recall of major defects Cost of one review (estimate)
claude-sonnet-5-5 56% 68% about 0.03 USD
deepseek-v4.1-flash-1017 38% 48% about 0.001 USD
claude-haiku-5-5 36% 46% about 0.002 USD
Gemini 3 Flash, 3.8 Flash 24 to 25% 28 to 34% free tier, 20 requests a day
Gemini 3.1 and 3.5 Flash Lite, Gemini 3.6 Flash, Gemma 4 7 to 14% 8 to 18% free tier
Local qwen3.8:27b, qwen3-coder:30b 22 to 23% 30 to 32% none

Gemini 2.5 Flash and 2.5 Flash Lite answer 404 ("no longer available to new users"). Gemma 4 on the free tier takes 16000 input tokens a minute, below one review prompt of 8 to 16 thousand tokens plus the answer, and below the 19000 tokens of a stage prompt.

Proposed Solution & Architectural Design

Add one fallback to router_settings.fallbacks of k8s/llm/gateway/config.yaml: claude-sonnet-5-5 falls back to deepseek-v4.1-flash-1017. No other hosted group joins a fallback: Flash Lite, Gemma and the older Gemini models find only the missing paths that a deterministic gate already finds, so they are not suitable. Haiku is no better than DeepSeek and costs more per token.

The hosted-group check changes from "no fallback names a hosted group" to: a fallback may link a hosted group to a hosted group only, and never an Ollama group to a hosted group, so a prompt leaves the cluster only when its caller names a hosted group. SECURITY.md rule 12 and the README say that a fallback sends the prompt to the OpenRouter provider and not to Anthropic.

Target Subsystem

k8s/llm/gateway/config.yaml, tests/ai/benchmark/test_k8s_llm_gateway.py, k8s/README.md, SECURITY.md.

Existing Tool Considered

LiteLLM router_settings.fallbacks. No new tool. Cost: about 15k tokens.

Activity

  1. added
    source/agent
    type/feature
    scope/k8s
    status/new
    value/medium
    effort/low
    on Nov 2, 2026
  2. dan-petty commented on Nov 2, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P2-Medium. Prevents a total outage when Anthropic is unavailable, but the fallback has lower recall so it is a resilience improvement, not a fix.
    • Value: Medium. Keeps the gateway responsive during provider failures, though with degraded quality.
    • Effort: Low. One YAML entry, one test update, and two doc edits; no new tool or architecture change.
    • Related: feat(k8s): serve deepseek-v4.1-flash-1017 through OpenRouter #3144, which asks for a different change. Both target k8s/llm/gateway/config.yaml and involve deepseek-v4.1-flash-1017; #3144 adds the model as a gateway group, while this candidate adds a fallback rule that references it.
  3. added
    priority/p2-medium
    on Nov 2, 2026
  4. removed
    status/new
    on Nov 2, 2026
  5. added a commit that references this issue on Nov 2, 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

    effort/lowpriority/p2-mediumscope/k8ssource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions