Skip to content

fix(providers): activate vision sidecar for NVIDIA NIM text-only models - #964

Closed
Yuxin-Qiao wants to merge 1 commit into
lidge-jun:devfrom
Yuxin-Qiao:codex/260804-issue956-nvidia-novision
Closed

fix(providers): activate vision sidecar for NVIDIA NIM text-only models#964
Yuxin-Qiao wants to merge 1 commit into
lidge-jun:devfrom
Yuxin-Qiao:codex/260804-issue956-nvidia-novision

Conversation

@Yuxin-Qiao

@Yuxin-Qiao Yuxin-Qiao commented Aug 3, 2026

Copy link
Copy Markdown

Summary

Fixes #956. The built-in nvidia provider entry in src/providers/registry.ts did not declare noVisionModels, so the vision sidecar never activated for NVIDIA NIM text-only models (deepseek-ai/deepseek-v4-flash, z-ai/glm-5.2, minimaxai/minimax-m3, moonshotai/kimi-k2.6, nvidia/nemotron-3-ultra-550b-a55b, ...). Raw image parts were forwarded to a text-only upstream (400 / silently ignored) or the catalog advertised the model as text-only, making the Codex app block attachments client-side.

NIM's /v1/models carries no input-modality metadata, so the registry is the only source of truth for capability classification.

Changes

  • src/providers/registry.ts: add NVIDIA_NIM_NO_VISION_MODELS and wire it into the nvidia entry as noVisionModels.
    • Snapshot of text-only chat/code families from the live NIM catalog (fetched 2026-08-04, 102 models) plus the documented kimi family.
    • Vision-capable models stay out: meta/llama-3.2-11b/90b-vision-instruct, microsoft/phi-3-vision-128k-instruct, adept/fuyu-8b, google/deplot, microsoft/kosmos-2, nvidia/llama-3.1-nemotron-nano-vl-8b-v1, nvidia/nemotron-nano-12b-v2-vl, nvidia/neva-22b, nvidia/vila, nvidia/nemotron-3-nano-omni-30b-a3b-reasoning (multimodal), plus non-chat endpoints (embeddings, guards, translators, detectors, image/video generators).
    • modelInList semantics: exact-id matching for slash-namespaced NIM ids; new text-only ids must be appended individually (same convention as the existing NIM kimi lists).

With the list in place, planVisionSidecar returns a plan for image-carrying requests to these models and the catalog advertises inputModalities including "image" (so the app lets attachments reach the sidecar).

Tests

  • tests/nvidia-nim-hardening.test.ts: 4 new regression tests
    • registry list contains the issue's text-only families and excludes the vision-capable models
    • bare persisted config inherits noVisionModels via the router merge
    • planVisionSidecar plans for a text-only NIM model with an image, stays undefined without an image, and stays undefined for a vision-capable NIM model
    • catalog hints advertise image input for text-only models and not for vision-capable ones

Verification

  • bun test tests/nvidia-nim-hardening.test.ts → 18 pass / 0 fail
  • bun test tests/provider-registry-parity.test.ts tests/vision-anthropic.test.ts tests/claude-sidecar-override.test.ts tests/codex-catalog.test.ts tests/nvidia-nim-hardening.test.ts → 176 pass / 0 fail
  • bun x tsc --noEmit → clean
  • Full suite (522 files): 7210 pass / 541 fail / 7 errors on this branch vs 7206 pass / 541 fail / 7 errors on unmodified dev in the same sandbox — the failures are identical and environmental (sandbox blocks outbound network and socket binds; e.g. OAuth replay, /v1/live relay, and EADDRINUSE on ephemeral ports), so this change introduces no regressions.

Notes

The NIM catalog is dynamic; new text-only ids added upstream must be appended to NVIDIA_NIM_NO_VISION_MODELS (noted in a registry comment). Vision-capable NIM models keep their previous behavior.

Summary by CodeRabbit

  • New Features

    • Improved NVIDIA NIM model capability detection for text-only models.
    • Image requests for models without native vision support are now routed through the vision processing fallback.
    • Model listings now accurately indicate supported image modalities.
  • Bug Fixes

    • Improved handling of image and non-image requests across NVIDIA NIM models.
  • Tests

    • Added coverage for model classification, image handling, and capability reporting.

Add noVisionModels to the nvidia registry entry (issue lidge-jun#956). The NIM
/v1/models catalog carries no input-modality metadata, so the registry is
the only source of truth: without the list, the vision sidecar never runs
and text-only NIM models either 400 on raw image parts upstream or are
advertised text-only so the app blocks attachments client-side.

Covers the text-only chat/code families from the live catalog (2026-08-04)
plus the documented kimi family. Vision-capable NIM models (llama-3.2-*-
vision-instruct, phi-3-vision, neva-22b, vila, nemotron-*-vl, ...) and
non-chat endpoints stay out.

Regression tests: registry list contents/exclusions, bare-config router
inheritance, planVisionSidecar activation, and catalog inputModalities
advertisement.
@github-actions github-actions Bot added the bug Something isn't working label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The NVIDIA NIM registry now classifies text-only models through noVisionModels. Tests cover registry inheritance, vision-sidecar planning, and catalog image modality hints.

Changes

NVIDIA NIM vision routing

Layer / File(s) Summary
NIM model capability metadata
src/providers/registry.ts
Adds NVIDIA_NIM_NO_VISION_MODELS and assigns it to the NVIDIA NIM registry entry.
Vision routing and catalog validation
tests/nvidia-nim-hardening.test.ts
Tests text-only model classification, persisted configuration inheritance, sidecar planning for image requests, and catalog modality advertising.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Request
  participant NVIDIA_NIM_Registry
  participant Vision_Sidecar_Planner
  participant Catalog
  Request->>Vision_Sidecar_Planner: Submit parsed request
  NVIDIA_NIM_Registry->>Vision_Sidecar_Planner: Provide noVisionModels
  Vision_Sidecar_Planner->>Vision_Sidecar_Planner: Plan sidecar when images target text-only models
  NVIDIA_NIM_Registry->>Catalog: Provide model capability metadata
  Catalog-->>Request: Advertise image input for text-only routed models
Loading

Possibly related PRs

Suggested reviewers: lidge-jun, ingwannu

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes adding NVIDIA NIM text-only model handling for the vision sidecar.
Linked Issues check ✅ Passed The registry update classifies NVIDIA NIM text-only models, preserves vision models, and adds regression tests for sidecar and catalog behavior required by issue #956.
Out of Scope Changes check ✅ Passed The changes are limited to NVIDIA NIM registry classification and related regression tests, which directly support issue #956.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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 `@src/providers/registry.ts`:
- Line 555: Remove minimaxai/minimax-m3, moonshotai/kimi-k2.6, and
thinkingmachines/inkling from NVIDIA_NIM_NO_VISION_MODELS in the provider
registry. Update the corresponding nvidia-nim-hardening tests so all three model
IDs are asserted as excluded from the no-vision classification and therefore
retain native image handling.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4f6170b5-d339-4ff4-abf8-e683f8a62dac

📥 Commits

Reviewing files that changed from the base of the PR and between 6eb1c0c and 220b4f7.

📒 Files selected for processing (2)
  • src/providers/registry.ts
  • tests/nvidia-nim-hardening.test.ts

Comment thread src/providers/registry.ts
"meta/llama-3.3-70b-instruct",
"meta/llama2-70b",
"microsoft/phi-3.5-moe-instruct",
"minimaxai/minimax-m3",

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 | 🟠 Major | ⚡ Quick win

Remove native vision models from NVIDIA_NIM_NO_VISION_MODELS.

minimaxai/minimax-m3, moonshotai/kimi-k2.6, and thinkingmachines/inkling accept image input. Their current classification activates planVisionSidecar and routes image requests through the sidecar instead of the model’s native vision path. It also contradicts the stated exclusion rule for vision-capable models. NVIDIA documents image input for all three models. (build.nvidia.com)

Remove these IDs. Update tests/nvidia-nim-hardening.test.ts so MiniMax M3, Kimi K2.6, and Inkling are asserted as exclusions.

Proposed fix
-  "minimaxai/minimax-m3",
...
-  "moonshotai/kimi-k2.6",
...
-  "thinkingmachines/inkling",

Also applies to: 563-563, 588-588

🤖 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 `@src/providers/registry.ts` at line 555, Remove minimaxai/minimax-m3,
moonshotai/kimi-k2.6, and thinkingmachines/inkling from
NVIDIA_NIM_NO_VISION_MODELS in the provider registry. Update the corresponding
nvidia-nim-hardening tests so all three model IDs are asserted as excluded from
the no-vision classification and therefore retain native image handling.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 220b4f728a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/providers/registry.ts
"openai/gpt-oss-20b",
"poolside/laguna-xs-2.1",
"stepfun-ai/step-3.7-flash",
"thinkingmachines/inkling",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep vision-native NIM models out of noVisionModels

When an NVIDIA user sends an image to thinkingmachines/inkling, this entry makes planVisionSidecar replace the native image with a lossy description—or strip it entirely when no sidecar is available—even though the same exact model ID is already recorded as text,image in BASE10_MODEL_INPUT_MODALITIES at src/providers/registry.ts:638-643. Remove image-capable entries such as Inkling from this list and add a regression that verifies their images remain untouched.

Useful? React with 👍 / 👎.

Comment thread src/providers/registry.ts
// Free pricing, but an API key is still required (free key from build.nvidia.com).
freeTier: true,
parallelToolCalls: false,
noVisionModels: NVIDIA_NIM_NO_VISION_MODELS,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document NVIDIA's automatic vision-sidecar behavior

This registry flag changes visible NVIDIA behavior: affected models now advertise image input and may consume a configured OpenAI or Anthropic vision sidecar before every image-bearing request, but the NVIDIA provider documentation remains only a base-URL table entry. Add an NVIDIA-specific note identifying the classified model families and the sidecar/auth implications so users are not surprised by the extra upstream call.

AGENTS.md reference: src/AGENTS.md:L28-L28

Useful? React with 👍 / 👎.

Comment thread src/providers/registry.ts
"nvidia/nemotron-4-340b-instruct",
"nvidia/nemotron-mini-4b-instruct",
"nvidia/nemotron-nano-3-30b-a3b",
"nvidia/nvidia-nemotron-nano-9b-v2",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Correct the doubled NVIDIA namespace

For the live text-only model nvidia/nemotron-nano-9b-v2, this entry never matches because it contains an extra nvidia- segment. modelInList performs exact matching for slash-namespaced IDs, so image requests to this model continue bypassing the sidecar and reach the text-only upstream unchanged; correct the ID and add it to the registry coverage test.

Useful? React with 👍 / 👎.

@Wibias

Wibias commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Please put your Pull-Request on Ready for Review, once you are finished.

@lidge-jun

Copy link
Copy Markdown
Owner

Confirmed as a real defect and left open for its own review rather than folded into the current review stack (#951#973).

The reasoning: this is a provider-registry change — nvidia lacks noVisionModels, so the vision sidecar never activates and raw image parts reach a text-only upstream. That is a genuine bug with a clear fix, but it shares no theme, files, or risk surface with the stack, and carrying it would only make the stack harder to review while delaying yours behind five other layers.

Worth flagging for whoever reviews it: the registry change is small, but the blast radius is every NIM text-only model listed in the PR, so the useful evidence is a live NIM request with an image part before and after. Fixes #956.

@lidge-jun

Copy link
Copy Markdown
Owner

Superseded by #980 (stack 7/7), commit f557f9173. Closing this one — reopening is one click if you disagree with anything below.

Your finding is correct and it is now fixed. The nvidia entry had no noVisionModels, so planVisionSidecar never fired and the catalog never advertised image input. Your diagnosis of the mechanism was exactly right.

What I changed, and why I owe you the detail. Six ids in the submitted list are natively image-capable per NVIDIA's own documentation:

Id listed as NVIDIA documents
thinkingmachines/inkling text-only text, image, audio
minimaxai/minimax-m3 text-only Text, Image, Video
moonshotai/kimi-k2.6 text-only text, image, video (with a published image_url example)
moonshotai/kimi-k2.5 text-only text, image, video
stepfun-ai/step-3.7-flash text-only text + image, documented as a VLM
mistralai/mistral-medium-3.5-128b text-only text + image

Listing a vision-capable model there is a silent defect: the model could read the image, but the proxy substitutes another model's text description instead. No error, worse answers, extra cost, and no test fails.

This is not a lapse on your part. Issue #956's own body lists minimax-m3 and kimi-k2.6 as text-only, so the reporter and the PR shared the same premise, and review passed it through. It is what an unaudited list does over an open domain.

So every id was verified individually against NVIDIA per-model documentation (devlog/_plan/260804_stack7_service_vision/011_nim_id_audit.md): 26 confirmed text-only shipped, 6 moved to a vision list, 32 dropped for having no current NVIDIA page. That last set includes nvidia/nemotron-nano-3-30b-a3b, a reversed-name typo of nvidia/nemotron-3-nano-30b-a3b which the same list also spells correctly.

The 16 vision-capable ids also needed explicit modelInputModalities. Removing them from noVisionModels alone is not enough — the catalog advertises image input only for list members, so they would have been published as text-only and the Codex app would block attachments before the native path ran. Your PR would have left those models unusable in a different way.

Where I did worse than you. My first two replacement designs were falsified at the audit gate. I proposed deriving text-only as the complement of a vision list (an unclassified id still ends up in neither list, so nothing changes), then a provider-level default-on rule (which would have advertised image input for every embedding, reranker, guard and OCR endpoint NIM serves, since shouldExposeRoutedModel filters only media-generation names). The list shape was not the fixable part; the audit was.

What still is not fixed: an id NVIDIA ships after this snapshot stays unclassified. NIM publishes no modality metadata, so an unknown id carries no signal at all. #956 closes with that bounded scope stated rather than implied.

Thank you for the report — the underlying bug was real and is fixed for every model named in the issue.

@lidge-jun lidge-jun closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants