Skip to content

Use NVIDIA Nemotron 3.5 Lightning (free) on OpenRouter, with reasoning - #2

Merged
Hussaincodes01 merged 2 commits into
mainfrom
claude/loving-ritchie-qc78k9
Oct 30, 2026
Merged

Hussaincodes01 merged 2 commits into
mainfrom
claude/loving-ritchie-qc78k9

Conversation

@Hussaincodes01

Copy link
Copy Markdown
Owner

Summary

  • The openrouter preset now leads both its analyze and codegen chains with nvidia/nemotron-3.5-lightning:free, the model chosen for drawing concept diagrams.
  • It sends reasoning: {"enabled": true}; LLM_REASONING=0 turns this off. The paid long-context models stay behind Nemotron as fallbacks.
  • Every pipeline call is a single turn, so there are no reasoning_details to pass back between requests.

Free-endpoint failures, handled instead of failing the call

  • No free host enforces the schema. With require_parameters set, OpenRouter answers 404 "No endpoints found that can handle the requested parameters" when no free host for the model supports response_format. That call is now retried with the schema in the prompt, on the same model. Before this change the 404 failed the whole call, so this fix has to be merged before production moves to OpenRouter.
  • The free endpoint is withdrawn. OpenRouter answers 404 "No endpoints found for ". The call now moves on to the next model in the chain.

Deployment context

The production env vars on arcvisual-api are already set:

  • ARCVISUAL_PROVIDER=openrouter
  • OPENROUTER_API_KEY (stored as a sensitive variable)
  • LLM_MODEL_CLASSIFY / LLM_MODEL_CODEGEN pinned to the Nemotron-first chain

The current production deployment is built from 457e11e, which predates the long-context provider. Once this is merged, main needs a production deploy.

Verification

  • pytest passes; there are 5 new tests in tests/test_longcontext.py:
    • Nemotron is sent first, with reasoning on.
    • Reasoning can be turned off, and is only sent to OpenRouter.
    • The 404 for missing schema support falls back to prompted JSON on the same model.
    • A withdrawn free endpoint falls through to the next model.
  • ruff check and ruff format --check are clean.
  • The key is not in any tracked file.

Not verified: no live call has been made to OpenRouter, because the development environment's network policy blocks openrouter.ai.


Generated by Claude Code

The openrouter preset now leads both its analyze and codegen chains with
nvidia/nemotron-3.5-lightning:free, the model chosen for drawing concept
diagrams, and sends `reasoning: {"enabled": true}` (LLM_REASONING=0 turns it
off). The paid long-context models stay behind it as fallbacks.

Two free-endpoint failure modes are handled instead of failing the call:
- under require_parameters, a free host without response_format support
  answers 404 "No endpoints found that can handle the requested parameters";
  that call is retried with the schema in the prompt on the same model;
- a withdrawn free endpoint (404 "No endpoints found for <model>") moves on to
  the next model in the chain.

Every pipeline call is a single turn, so there are no reasoning_details to
pass back between requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BgiEmhLGtyG2FWJkiiwD1M
Copilot AI balanced review requested due to automatic review settings October 30, 2026 06:25

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T06:27:22.812716Z 94c13ac PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 94c13ac09b

ℹ️ 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 arcvisual/config.py Resolved
OpenRouter caps ':free' models per day and answers 429 "Rate limit exceeded:
free-models-per-day". That body does not match is_daily_limit, so the shared
handler treated it as a per-minute limit and retried until it raised — never a
ModelUnavailable, so the paid models later in the chain were never tried and
every analyze/codegen call failed once the free quota ran out.

A `_model_exhausted` hook now runs on every 429; LongContextProvider raises
ModelUnavailable for a ':free' model whose 429 says "per-day", so the chain
moves on and skips the spent model for the rest of the process. Per-minute
429s and paid models' daily limits behave as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BgiEmhLGtyG2FWJkiiwD1M
@Hussaincodes01
Hussaincodes01 merged commit 9aab696 into main Oct 30, 2026
5 checks passed
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.

3 participants