Skip to content

Conversation

@jamesbraza
Copy link
Collaborator

When using Nvidia DGX Cloud Lepton (added in #1218), we don't need 40 RPM limit

@jamesbraza jamesbraza self-assigned this Nov 22, 2025
Copilot AI review requested due to automatic review settings November 22, 2025 17:03
@jamesbraza jamesbraza added the enhancement New feature or request label Nov 22, 2025
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Nov 22, 2025
@dosubot
Copy link

dosubot bot commented Nov 22, 2025

Related Documentation

Checked 1 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

Copilot finished reviewing on behalf of jamesbraza November 22, 2025 17:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds the ability to disable rate limiting for the Nvidia API when using Nvidia DGX Cloud Lepton. The key change is making the rate limit configurable by adding a new rate_limit parameter to the _call_nvidia_api function, which defaults to the existing 40 RPM limit but can be set to None to disable rate limiting.

  • Added a configurable rate_limit parameter to _call_nvidia_api with default value maintaining backward compatibility
  • Renamed the rate limit constant to NVIDIA_API_NEMOTRON_PARSE_RATE_LIMIT for clarity
  • Added limits and numpy to the typing extra dependencies for proper type checking

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
packages/paper-qa-nemotron/src/paperqa_nemotron/api.py Added rate_limit parameter to _call_nvidia_api, renamed rate limit constant, and updated documentation
packages/paper-qa-nemotron/pyproject.toml Added limits and numpy to typing dependencies for type checking
uv.lock Updated lock file to reflect new typing dependencies
Comments suppressed due to low confidence (1)

packages/paper-qa-nemotron/src/paperqa_nemotron/api.py:203

  • The overload signature is missing the rate_limit parameter that was added to the main function implementation. This creates an inconsistency between the overload type hints and the actual function signature. Add rate_limit: \"RateLimitItem | str | None\" = ... to this overload (and the other two overloads at lines 207 and 218) to maintain API consistency.
async def _call_nvidia_api(
    image: "np.ndarray",
    tool_name: Literal["markdown_bbox"],
    api_key: str | None = None,
    api_base: str = ...,
    model_name: str = ...,
    **completion_kwargs,
) -> list[NemotronParseMarkdownBBox]: ...

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jamesbraza jamesbraza merged commit 0c0eed7 into main Nov 22, 2025
19 of 20 checks passed
@jamesbraza jamesbraza deleted the configurable-rate-limits branch November 22, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants