Skip to content

feat(ai): make omniroute primary reviewer model, qwen-3.6-fast fallback - #4309

Merged
Tanguille merged 2 commits into
mainfrom
feat/omniroute-primary-qwen-fallback
Aug 2, 2026
Merged

feat(ai): make omniroute primary reviewer model, qwen-3.6-fast fallback#4309
Tanguille merged 2 commits into
mainfrom
feat/omniroute-primary-qwen-fallback

Conversation

@Tanguille

@Tanguille Tanguille commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Point agent-pr-review.yaml at omniroute (was qwen-3.6-fast) — several free models routed through omniroute (Kimi/GLM/DeepSeek-class, via opencode) outclass the self-hosted 27B on review quality.
  • omniroute stays on openai/auto (OmniRoute's live per-request scoring across all connected providers) rather than pinning a single model.
  • Add routerSettings.fallbacks: [{omniroute: [qwen-3.6-fast]}] in litellm so a flaky free provider automatically falls back to the self-hosted model instead of failing the run.
  • Pin an explicit review temperature since omniroute's proxied models don't share SGLang's sampling_defaults.

Test plan

  • kustomize build kubernetes/apps/ai/litellm/instance — builds clean, fallback present
  • YAML syntax check on workflow file
  • Manual side-by-side (3 review-style prompts): omniroute matched/beat qwen-3.6-fast on correctness and was 2-7x faster every time
  • Flux reconcile + confirm next PR review run uses omniroute, falls back correctly if it errors

Summary by CodeRabbit

  • Improvements
    • Updated AI-powered review processing with more consistent model settings and response behavior.
    • Improved model routing by selecting providers based on availability, quota, cost, and task suitability.
    • Added an automatic fallback to help keep review processing available when the primary model is unavailable.
    • Added clearer expectations around model routing, fallback behavior, and review response times.

Several free models routed through omniroute (opencode's Kimi/GLM/
DeepSeek-class models) outclass the self-hosted 27B on review quality.
Pin the omniroute LiteLLMModel to a specific model instead of "auto"
for reproducible output, add litellm router fallback to qwen-3.6-fast
so a flaky free provider can't take out the PR review action, and
point agent-pr-review.yaml at omniroute.
@deepsource-io

deepsource-io Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

DeepSource Code Review

We reviewed changes in b60ab0e...4de58d7 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Aug 2, 2026 6:10p.m. Review ↗
Shell Aug 2, 2026 6:10p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 29d6a2aa-c9d0-47a5-a6a0-ce6700b517ec

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR changes the review workflow to use omniroute with temperature 0.2, documents OmniRoute provider selection, and configures qwen-3.6-fast as its LiteLLM fallback.

Changes

OmniRoute routing

Layer / File(s) Summary
Document OmniRoute and configure fallback
kubernetes/apps/ai/litellm/instance/models.yaml, kubernetes/apps/ai/litellm/instance/proxy.yaml
The configuration documents provider selection based on quota, health, cost, and task fit. LiteLLM falls back to qwen-3.6-fast when omniroute fails.
Select OmniRoute in the review workflow
.github/workflows/agent-pr-review.yaml
The workflow selects omniroute and sets the AI temperature to 0.2. Comments document routing, fallback behavior, and expected latency.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AgentPRReview
  participant LiteLLM
  participant QwenProvider
  AgentPRReview->>LiteLLM: Request review with omniroute
  LiteLLM->>QwenProvider: Fallback after omniroute failure
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary model change and the configured fallback, which match the main pull request objectives.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/omniroute-primary-qwen-fallback

Comment @coderabbitai help to get the list of available commands.

@tanguille-cluster

tanguille-cluster Bot commented Aug 2, 2026

Copy link
Copy Markdown
@@ spec.routerSettings @@
# litellm.home-operations.com/v1alpha1/LiteLLMProxy/ai/litellm
! + one map entry added:
+ fallbacks:
+ - omniroute:
+   - qwen-3.6-fast

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

AI Automated Review (incremental)

Analysis engine: omniroute@http://litellm.ai.svc.cluster.local/v1 (openai)

Recommendation

Approve with one minor follow-up. The incremental delta reverts omniroute to openai/auto (OmniRoute's live per-request smart routing) and drops the maxInputTokens/maxOutputTokens overrides that were paired with the previous pinned-model change. The workflow and LiteLLM fallback wiring are internally consistent and match the PR intent.

Change-by-change findings

  • kubernetes/apps/ai/litellm/instance/models.yaml — Reverts model: openai/oc/big-pickle back to model: openai/auto and removes the maxInputTokens: 200000 / maxOutputTokens: 8192 block that the previous review's pinned-model state had added. The comment now accurately describes auto as OmniRoute's live per-request scoring across connected providers. The revert is clean and the remaining apiBase, api_key, and additional.timeout/num_retries fields are unchanged and still valid for openai/auto. One concern: with maxInputTokens/maxOutputTokens removed, LiteLLM will apply its defaults for this model entry. For the PR-review use case (large diffs plus tool-loop context), the defaults may be lower than the 200K context the previous pinned model exposed; this is a minor robustness risk, not a blocker, since OmniRoute's auto routing already selects models dynamically and the workflow pins model_context_tokens: "120000" upstream in the action.
  • kubernetes/apps/ai/litellm/instance/proxy.yaml — No change in this delta; the fallbacks: [{omniroute: ["qwen-3.6-fast"]}] entry added in the prior commit remains. It is well-commented and consistent with the workflow's ai_model: omniroute. LiteLLM's routerSettings.fallbacks format expects a list of {<model_alias>: [<fallback_alias>, ...]} mappings, which this entry satisfies. The fallback target qwen-3.6-fast is defined in the same models.yaml with a valid apiBase and sampling config, so the fallback chain is resolvable.
  • .github/workflows/agent-pr-review.yaml — No change in this delta; the prior commit's switch to ai_model: omniroute, ai_temperature: "0.2", and ai_request_timeout_sec: "600" remains. The temperature pin is justified by the comment (OmniRoute's proxied models don't inherit SGLang's sampling_defaults), and the 600s timeout covers both OmniRoute's observed 2-74s latency and the qwen-3.6-fast fallback's 155-220s cold prefills. The tool_loop_wall_clock_sec: "900" and tool_planning_timeout_sec: "600" settings remain consistent with the per-request timeout.

Standards Compliance

  • Conventional Commit title (feat(ai): ...) on the prior commit; the incremental delta commit uses fix: revert omniroute to auto routing, resolve review feedback which is acceptable for a follow-up fix but could be scoped (fix(ai): ...) per the repo's convention examples. Not blocking.
  • YAML changes are small, focused, and preserve existing patterns (comments explain non-obvious routing/sampling decisions, consistent with the rest of models.yaml and proxy.yaml).
  • No shell scripts touched; shellcheck requirement does not apply.
  • No secrets, SOPS, or age.key changes; the redacted api_key placeholders in models.yaml are unchanged.

Tool Harness Findings

Tool harness planning is pending and no harness output was available at review time; no tool-harness-derived issues to report.

Unknowns or Needs Verification

  • LiteLLM's exact default maxInputTokens/maxOutputTokens behavior when a LiteLLMModel omits the info block's token fields could not be verified against upstream docs this run (the LiteLLM routing docs fetch was blocked by the host allowlist). If the defaults are lower than the ~120K-token review payloads the action is configured to send (model_context_tokens: "120000"), large PRs may hit context truncation or rejection on the omniroute path. Suggest confirming the effective limits after the next Flux reconcile, or restoring explicit maxInputTokens/maxOutputTokens values if truncation appears in review run logs.
  • The PR's test plan leaves "Flux reconcile + confirm next PR review run uses omniroute, falls back correctly if it errors" unchecked. This is the live-validation step that would close out the unknowns above; it should be completed post-merge (or on this PR's own review run, which will exercise the omniroute path).

coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 2, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@kubernetes/apps/ai/litellm/instance/models.yaml`:
- Around line 81-82: Update the big-pickle model configuration so maxInputTokens
reserves the 8192 maxOutputTokens from the 200000-token context window, setting
it to 191808; alternatively, explicitly document that 200000 applies to input
tokens only.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d5b43563-7c0f-4aa4-b37d-6f0bd67f6468

📥 Commits

Reviewing files that changed from the base of the PR and between b60ab0e and 8c11e6d.

📒 Files selected for processing (3)
  • .github/workflows/agent-pr-review.yaml
  • kubernetes/apps/ai/litellm/instance/models.yaml
  • kubernetes/apps/ai/litellm/instance/proxy.yaml
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Tanguille/LLMKube (auto-detected)
  • Tanguille/toolhive (auto-detected)
  • Tanguille/pr-reviewer-action (auto-detected)
  • Tanguille/2x-R9700-RDNA4-GFX1201-sglang-inference (auto-detected)

Comment on lines +81 to +82
maxInputTokens: 200000
maxOutputTokens: 8192

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n --glob '*.yaml' --glob '*.yml' --glob '*.json' \
  'maxInputTokens|maxOutputTokens|context(Window|_length)?'

Repository: Tanguille/cluster

Length of output: 155


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- candidate files ---'
git ls-files | grep -E '(^|/)models\.(yaml|yml|json)$|litellm' | head -200 || true

printf '%s\n' '--- exact target candidates ---'
find . -type f \( -name 'models.yaml' -o -name 'models.yml' \) -print

printf '%s\n' '--- target content ---'
for f in $(find . -type f \( -path '*/kubernetes/apps/ai/litellm/instance/models.yaml' -o -name 'models.yaml' \) -print); do
  echo "FILE: $f"
  grep -n -C 12 -E 'big-pickle|maxInputTokens|maxOutputTokens|context' "$f" || true
done

printf '%s\n' '--- repository references ---'
rg -n -i --hidden -g '!*.lock' -g '!node_modules' \
  'big-pickle|maxInputTokens|maxOutputTokens|context.?window|context.?length' . || true

Repository: Tanguille/cluster

Length of output: 4796


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -i --hidden -g '!*.lock' -g '!node_modules' \
  'big-pickle|maxInputTokens|maxOutputTokens|context.?window|context.?length' . || true

Repository: Tanguille/LLMKube

Length of output: 18849


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -i --hidden -g '!*.lock' -g '!node_modules' \
  'big-pickle|maxInputTokens|maxOutputTokens|context.?window|context.?length' . || true

Repository: Tanguille/toolhive

Length of output: 1516


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -i --hidden -g '!*.lock' -g '!node_modules' \
  'big-pickle|maxInputTokens|maxOutputTokens|context.?window|context.?length' . || true

Repository: Tanguille/pr-reviewer-action

Length of output: 2472


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -i --hidden -g '!*.lock' -g '!node_modules' \
  'big-pickle|maxInputTokens|maxOutputTokens|context.?window|context.?length' . || true

Repository: Tanguille/2x-R9700-RDNA4-GFX1201-sglang-inference

Length of output: 47538


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

sed -n '60,95p' kubernetes/apps/ai/litellm/instance/models.yaml
rg -n -i --hidden -g '!*.lock' \
  'maxInputTokens|maxOutputTokens|context.?window|context.?length|big-pickle' .

Repository: Tanguille/cluster

Length of output: 2207


🌐 Web query:

LiteLLM maxInputTokens maxOutputTokens context window semantics

💡 Result:

In LiteLLM, token limit parameters are used for both runtime API requests and model metadata management. Their semantics are defined as follows: 1. max_input_tokens: Represents the maximum input token limit (often equivalent to the model's context window) [1][2]. This is primarily used for validation, such as checking if a request is within the model's context window before execution when enable_pre_call_checks is set to true [3]. 2. max_output_tokens: Represents the maximum number of tokens that can be generated in the output (completion) [1][2]. 3. max_tokens (Legacy): This is a legacy parameter maintained for backward compatibility [1][4]. Its definition is inconsistent across older model entries in the LiteLLM catalog: - Ideally, if max_output_tokens is specified, max_tokens should match it [1][4]. - If max_output_tokens is absent, it defaults to the value of max_input_tokens [1][4]. - Due to historical inconsistencies, some older catalog entries may set max_tokens to represent the total context window, while others represent the output limit [5][4]. LiteLLM is currently undergoing a migration to replace this legacy field with explicit max_input_tokens and max_output_tokens values to resolve this ambiguity [5][4]. 4. max_completion_tokens: This is a newer parameter (aligning with OpenAI API standards) that represents an upper bound for the number of tokens generated, encompassing both visible output tokens and internal reasoning tokens [6]. When building integrations or configuring LiteLLM, it is recommended to rely on the explicit max_input_tokens and max_output_tokens fields rather than the legacy max_tokens parameter to ensure predictable behavior [1][4]. For runtime request payloads, standard parameters like max_tokens (for generation length) or max_completion_tokens (for newer reasoning models) should be passed according to the target provider's requirements [7][6].

Citations:


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- LiteLLM deployment references ---'
rg -n -C 4 -i \
  'litellm|chart:|version:|repository:|kind: LiteLLMModel|maxInputTokens|maxOutputTokens' \
  kubernetes/apps/ai/litellm kubernetes/apps/ai/llmkube || true

printf '%s\n' '--- tracked CRD/schema references ---'
git ls-files | grep -Ei 'crd|litellm' | head -200 || true
rg -n -i 'litellmmodel_v1alpha1|maxInputTokens|maxOutputTokens' --hidden . || true

Repository: Tanguille/cluster

Length of output: 50373


🌐 Web query:

site:github.com home-operations charts litellm LitellMModel maxInputTokens maxOutputTokens

💡 Result:

In the context of LiteLLM and the LiteLLM Kubernetes operator, maxInputTokens and maxOutputTokens represent critical token limit parameters for managing model context windows and generation bounds [1][2]. 1. Usage in LiteLLM: max_input_tokens and max_output_tokens are used to define the capacity of models within LiteLLM's internal configuration (often found in model_prices_and_context_window.json) [3][4]. These fields have largely replaced the legacy max_tokens parameter, which historically led to ambiguity as it was inconsistently used to represent either input (context) or output limits [3][4]. LiteLLM now surfaces these explicit fields through the proxy's API (e.g., /v1/models) to allow downstream tools to discover specific model limits [1][2]. 2. Configuration in Kubernetes (LiteLLMOperator): When using the LiteLLMModel custom resource definition in Kubernetes, you can define these limits within the modelInfo section to specify the model's capabilities to the proxy [5]. Example configuration for a LiteLLMModel resource: kind: LiteLLMModel metadata: name: gpt4o spec: instanceRef: name: my-gateway modelName: gpt-4o litellmParams: model: openai/gpt-4o... modelInfo: maxInputTokens: 128000 maxOutputTokens: 16384... 3. Key Distinction: While max_tokens (or max_completion_tokens) remains a valid parameter in completion requests to control the number of tokens generated in a specific response [6], max_input_tokens and max_output_tokens are primarily used for model metadata, service discovery, and configuration management to ensure the system and its clients understand the architectural constraints of the underlying model [1][2][3].

Citations:


🌐 Web query:

LiteLLMModel CRD maxInputTokens maxOutputTokens home-operations

💡 Result:

The LiteLLMModel Custom Resource Definition (CRD) is part of the Kubernetes operator for LiteLLM, which allows managing AI model registrations declaratively [1][2]. In recent versions of the LiteLLM operator (such as v0.16.0), the LiteLLMModel CRD has been updated to expose the full configuration surface supported by the LiteLLM proxy [3][4]. You can manage token limits within the LiteLLMModel manifest using the following fields [3][4]: 1. spec.litellmParams.maxInputTokens: This field is used for context-window-aware routing and fallback logic [3][4]. 2. spec.modelInfo: This section also includes fields related to token management [1][3][4]. Recent operator updates have added support for maxTokens, maxTokensReasoning, and maxTokensNonReasoning, which are flattened into the model_info payload for the LiteLLM proxy [3][4]. For authoritative reference, the LiteLLM proxy itself defines these limits (max_input_tokens and max_output_tokens) as part of its internal model configuration [5][6]. The operator synchronizes these definitions with the LiteLLM REST API (specifically the /model/new and /model/update endpoints) to ensure the proxy's runtime state matches your Kubernetes-managed GitOps configuration [3][7][8]. If you are working with the PalenaAI-maintained operator, ensure you are referencing the latest documentation in their repository, as the CRD surface area has expanded significantly to include these fine-grained token controls [3][4][7].

Citations:


🌐 Web query:

site:github.com/BerriAI/litellm max_input_tokens max_output_tokens context window validation

💡 Result:

In Large Language Model (LLM) architectures and API integrations, max_input_tokens, max_output_tokens, and the context window serve distinct but interrelated roles [1][2][3]. Understanding their definitions and validation logic is critical for preventing request failures [4][5]. Definitions and Terminology - Context Window: The total number of tokens (input + output) that a model can process in a single interaction [6][1][7]. - Max Input Tokens: The maximum number of tokens allowed as prompt input [1][2]. Some models define this as the full context window, while others, particularly those with high reasoning capacity, reserve a portion of the total context window specifically for output [6][2]. - Max Output Tokens: The maximum number of tokens the model is permitted to generate in the completion [1][8]. This is often configurable via API parameters (e.g., max_tokens or max_completion_tokens) but is bounded by both the model's architectural output limit and the remaining available context window [4][8][9]. - Legacy max_tokens: Often a source of confusion, this term is increasingly deprecated in favor of explicit input/output limits [8][10][11]. Depending on the provider's implementation, it historically mapped to either the total context window or the maximum allowed output [3][7][10]. Validation and Interaction Robust LLM integrations validate these limits before sending a request to avoid ContextWindowExceededError or generic BadRequestError exceptions [12][13][5]. 1. Pre-call Token Counting: Developers typically estimate the token count of input messages and compare it against max_input_tokens (or the total context window) before dispatching the request [4][5]. 2. Dynamic Adjustment: When a user specifies a high max_output_tokens value, many client-side libraries dynamically adjust the request to ensure: - input_tokens + requested_output_tokens <= total_context_window [4][9]. - If the sum exceeds the window, the max_output_tokens is often clamped to total_context_window - input_tokens [4]. 3. Error Handling: Providers return varying error messages when limits are exceeded (e.g., "prompt is too long," "too many input tokens") [12][13]. Effective integrations centralize these error strings to normalize them into a standard ContextWindowExceededError, enabling automated recovery strategies like prompt compression or model fallback [12][13][14]. Because API metadata can sometimes be inconsistent or incomplete (e.g., legacy fields or incorrect documentation in provider-side model registries), it is best practice to rely on verified model documentation and implement conservative buffering (e.g., ensuring a small token buffer) to account for imprecision in tokenization [4][15][11][9].

Citations:


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 4 -i \
  'litellm|chart:|version:|repository:|kind: LiteLLMModel|maxInputTokens|maxOutputTokens' \
  kubernetes/apps/ai/litellm kubernetes/apps/ai/llmkube || true

git ls-files | grep -Ei 'crd|litellm' | head -200 || true
rg -n -i 'litellmmodel_v1alpha1|maxInputTokens|maxOutputTokens' --hidden . || true

Repository: Tanguille/cluster

Length of output: 50373


🏁 Script executed (no clone):

#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
import json
import urllib.request

def get(url):
    req = urllib.request.Request(url, headers={"User-Agent": "review-verifier"})
    with urllib.request.urlopen(req, timeout=20) as r:
        return json.load(r)

repos = [
    ("home-operations/litellm-operator", "main"),
    ("BerriAI/litellm", "v1.95.0"),
]
for repo, ref in repos:
    url = f"https://api.github.com/repos/{repo}/git/trees/{ref}?recursive=1"
    data = get(url)
    print(f"--- {repo}@{ref} ---")
    for item in data.get("tree", []):
        path = item.get("path", "")
        if any(term in path.lower() for term in ("litellmmodel", "model_controller", "model_info", "token_counter", "proxy_server", "model_management")):
            print(path)
PY

Length of output: 2445


🏁 Script executed (no clone):

#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
import json
import re
import urllib.request

def fetch(url):
    req = urllib.request.Request(url, headers={"User-Agent": "review-verifier"})
    with urllib.request.urlopen(url, timeout=20) as r:
        return r.read().decode()

# Search the pinned LiteLLM source archive without executing repository code.
url = "https://github.com/BerriAI/litellm/archive/refs/tags/v1.95.0.tar.gz"
import io, tarfile
raw = urllib.request.urlopen(urllib.request.Request(url, headers={"User-Agent": "review-verifier"}), timeout=60).read()
with tarfile.open(fileobj=io.BytesIO(raw), mode="r:gz") as tf:
    print("--- LiteLLM v1.95.0 token-limit source matches ---")
    for member in tf.getmembers():
        if not member.isfile() or not member.name.endswith((".py", ".md", ".yaml", ".yml")):
            continue
        text = tf.extractfile(member).read().decode("utf-8", "replace")
        if re.search(r"max[_A-Za-z]*input[_A-Za-z]*tokens|max[_A-Za-z]*output[_A-Za-z]*tokens", text, re.I):
            hits = []
            lines = text.splitlines()
            for i, line in enumerate(lines):
                if re.search(r"max[_A-Za-z]*input[_A-Za-z]*tokens|max[_A-Za-z]*output[_A-Za-z]*tokens", line, re.I):
                    lo, hi = max(0, i-3), min(len(lines), i+4)
                    hits.append((lo+1, hi, lines[lo:hi]))
            if hits:
                print(f"FILE: {member.name}")
                for lo, hi, block in hits[:12]:
                    print(f"LINES {lo}-{hi}")
                    print("\n".join(block))
PY

Length of output: 2412


🏁 Script executed (no clone):

#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
import json
import urllib.request

def fetch_json(url):
    req = urllib.request.Request(url, headers={"User-Agent": "review-verifier"})
    with urllib.request.urlopen(url, timeout=20) as r:
        return json.load(r)

repo = "home-operations/litellm-operator"
for ref in ("0.0.9", "main"):
    try:
        data = fetch_json(f"https://api.github.com/repos/{repo}/git/trees/{ref}?recursive=1")
    except Exception as exc:
        print(f"{ref}: {exc}")
        continue
    print(f"--- {repo}@{ref} candidate source files ---")
    for item in data.get("tree", []):
        path = item.get("path", "")
        if path.endswith((".go", ".yaml", ".yml", ".md")) and any(
            term in path.lower() for term in ("model", "crd", "controller", "litellm")
        ):
            print(path)
PY

Length of output: 408


🏁 Script executed (no clone):

#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
import io, json, re, tarfile, urllib.request

def request(url):
    return urllib.request.urlopen(
        urllib.request.Request(url, headers={"User-Agent": "review-verifier"}),
        timeout=60,
    )

for repo, ref in [
    ("home-operations/litellm-operator", "main"),
    ("BerriAI/litellm", "v1.95.0"),
]:
    data = json.load(request(f"https://api.github.com/repos/{repo}/git/trees/{ref}?recursive=1"))
    print(f"--- {repo}@{ref} ---")
    for item in data.get("tree", []):
        path = item.get("path", "")
        if any(x in path.lower() for x in ("litellmmodel", "model_info", "token_counter", "model_management")):
            print(path)

raw = request("https://github.com/BerriAI/litellm/archive/refs/tags/v1.95.0.tar.gz").read()
with tarfile.open(fileobj=io.BytesIO(raw), mode="r:gz") as archive:
    print("--- LiteLLM v1.95.0 token-limit matches ---")
    for member in archive.getmembers():
        if not member.isfile() or not member.name.endswith(".py"):
            continue
        text = archive.extractfile(member).read().decode("utf-8", "replace")
        if re.search(r"max[_A-Za-z]*input[_A-Za-z]*tokens|max[_A-Za-z]*output[_A-Za-z]*tokens", text, re.I):
            for i, line in enumerate(text.splitlines()):
                if re.search(r"max[_A-Za-z]*input[_A-Za-z]*tokens|max[_A-Za-z]*output[_A-Za-z]*tokens", line, re.I):
                    print(f"{member.name}:{i + 1}:{line.strip()}")
PY

Length of output: 2449


Reserve output tokens from the total context window.

LiteLLM treats maxInputTokens and maxOutputTokens as separate limits. If big-pickle has a 200,000-token total context window, set maxInputTokens to 191808 or document that 200,000 is input-only.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kubernetes/apps/ai/litellm/instance/models.yaml` around lines 81 - 82, Update
the big-pickle model configuration so maxInputTokens reserves the 8192
maxOutputTokens from the 200000-token context window, setting it to 191808;
alternatively, explicitly document that 200000 applies to input tokens only.

Reverts the big-pickle pin per feedback — auto's live per-request
scoring across all connected providers is preferred over pinning a
single undocumented free model. That also resolves CodeRabbit's
maxInputTokens/maxOutputTokens concern (auto has no fixed context
window to declare).
@Tanguille

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Tanguille
Tanguille dismissed coderabbitai[bot]’s stale review August 2, 2026 19:00

Underlying finding resolved in 4de58d7 (reverted the big-pickle pin, so the maxInputTokens/maxOutputTokens double-counting no longer applies). CodeRabbit's incremental re-scan on that commit passed clean.

@Tanguille
Tanguille merged commit 645fc2e into main Aug 2, 2026
15 checks passed
@Tanguille
Tanguille deleted the feat/omniroute-primary-qwen-fallback branch August 2, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant