Retrying nemotron-parse API calls receiving 408 timeouts#1276
Merged
jamesbraza merged 1 commit intomainfrom Jan 27, 2026
Merged
Retrying nemotron-parse API calls receiving 408 timeouts#1276jamesbraza merged 1 commit intomainfrom
nemotron-parse API calls receiving 408 timeouts#1276jamesbraza merged 1 commit intomainfrom
Conversation
17a23b3 to
954774a
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds retry logic to handle 408 (Request Timeout) status codes from the nemotron-parse API when served via vLLM on Modal. According to the PR description, litellm version 1.81.1 casts these 408 responses to litellm.exceptions.Timeout exceptions, and the new retry logic ensures these timeout errors are retried along with the existing rate limit timeouts.
Changes:
- Added a helper function to detect litellm timeout exceptions with 408 status codes
- Extended the retry decorator on
_call_nvidia_apito retry on inference timeouts (408) in addition to rate limit timeouts
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sidnarayanan
approved these changes
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When serving
nemotron-parseusingvllm==0.14.1on Modal with an Nvidia H200 with a FastAPI proxy to make vLLM match Nvidia NIM, we see 408 status codes coming back sometimes.litellm==1.81.1casts these 408 tolitellm.exceptions.TimeoutError: https://github.com/BerriAI/litellm/blob/v1.81.1-nightly/litellm/exceptions.py#L243This PR moves us to also retry those 408 errors.
Note
Expands retry logic for
_call_nvidia_apito handle 408 Request Timeout surfaced by LiteLLM._is_litellm_timeout_with_408and updates Tenacity decorator toretry_if_exception(_is_litellm_timeout_with_408)alongsideTimeoutErrorhttpandretry_if_exceptionto support new conditionWritten by Cursor Bugbot for commit 954774a. Configure here.