Skip to content

feat(classifier): add judge image input controls - #790

Draft
ayushag-nv wants to merge 5 commits into
mainfrom
ayushag/judge-vision-routing-support
Draft

ayushag-nv wants to merge 5 commits into
mainfrom
ayushag/judge-vision-routing-support

Conversation

@ayushag-nv

@ayushag-nv ayushag-nv commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Why

Capability and custom classifiers already pass images from selected messages to vision-capable judges. They lacked an independent image limit for the judge, so clients could not configure text-only judging while preserving images for the answer model. Tracks SWITCH-1542.

What

  • Add judge_max_images to capability/custom classifiers, shared runner configuration, and Python bindings. Unset preserves current behavior; 0 omits judge images; N keeps the newest N in order.
  • Apply the limit before copying image payloads, while preserving the original answer request and existing message selection.
  • Add regression coverage, configuration documentation, and a reproducible Cosmos Nano judge / Cosmos-Astra answer demo using a VANTAGE still image.

How

Select messages by reference, then copy only content retained for the judge. Share the image budget across selected messages and nested tool results. Replace omitted images with text markers to keep image-only messages valid. Reuse existing custom prompts, verdict validation, model selection, and fallback behavior. Escalation mode rejects the image option.

Where to Start Review

Start with TaskInput and copy_judge_block in crates/libsy/src/algorithms/llm_class.rs, then the shared runner wiring and server payload-preservation test. examples/vision_judge/README.md documents reproduction and observed results.

Test Plan

  • Rust workspace: 857 passed, 1 ignored.
  • Python suite: 143 passed, 2 subtests passed.
  • Formatting, Clippy, Ruff, mypy, and strict MkDocs build passed.
  • Four live Inference Hub requests verified judge image counts, unchanged answer images, and agreement between verdicts and selected models before the allocation-only optimization. Offline regression tests cover the optimized path.
  • Local input-preparation measurement: eight 1 MiB inline payloads, 200 preparations per sample, median of five samples after warm-up in a debug build. Text-only preparation decreased from 147 ms to 0.20 ms; retaining one image decreased from 171 ms to 4.1 ms. These measurements exclude HTTP and inference.

The live checks establish integration behavior. Cosmos produced unreliable rationales in some cases; judge accuracy is not established. Judge-specific resizing/payload budgets, finer image selection, image-aware affinity, and per-target vision checks remain follow-on work. Route-level vision declarations already exist.

Signed-off-by: ayushag <ayushag@nvidia.com>
Signed-off-by: ayushag <ayushag@nvidia.com>
Signed-off-by: ayushag <ayushag@nvidia.com>
@github-actions

github-actions Bot commented Sep 19, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://NVIDIA-NeMo.github.io/Switchyard/pr-preview/pr-790/

Built to branch gh-pages at 2026-09-19 01:23 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Signed-off-by: ayushag <ayushag@nvidia.com>
Signed-off-by: ayushag <ayushag@nvidia.com>
@ayushag-nv ayushag-nv changed the title feat(classifier): support text-only and vision judge routing feat(classifier): add judge image input controls Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant