Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 26, 2025

NVIDIA models were partially integrated (tokens defined, provider listed) but lacked the wrapper class pattern used by other providers, breaking consistency and making the integration incomplete.

Changes

New Nvidia wrapper class (scrapegraphai/models/nvidia.py):

  • Uses __new__ for lazy import since langchain-nvidia-ai-endpoints is optional
  • Converts api_keynvidia_api_key parameter automatically
  • Returns ChatNVIDIA instance on instantiation

Integration updates:

  • Export Nvidia from models/__init__.py
  • Simplified abstract_graph.py to use wrapper instead of inline import
  • Added nvidia optional dependency in pyproject.toml

Example usage (examples/smart_scraper_graph/nvidia/):

graph_config = {
    "llm": {
        "api_key": os.getenv("NVIDIA_API_KEY"),
        "model": "nvidia/meta/llama3-70b-instruct",
        "model_provider": "nvidia",
    },
}
smart_scraper_graph = SmartScraperGraph(
    prompt="Extract me the first article",
    source="https://www.wired.com",
    config=graph_config,
)

The integration now matches the pattern established by DeepSeek, XAI, and OneApi wrappers. 16 NVIDIA models already configured in models_tokens.py are now fully accessible.

Original prompt

This section details on the original issue you should resolve

<issue_title>Nvidia LLM is no longer supported in latest scrapegraphai versions</issue_title>
<issue_description></issue_description>

<agent_instructions>add the integration for nvidia</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits November 26, 2025 19:56
- Created Nvidia wrapper model class in scrapegraphai/models/nvidia.py
- Updated models/__init__.py to export Nvidia class
- Updated abstract_graph.py to use Nvidia wrapper instead of direct ChatNVIDIA import
- Added nvidia as optional dependency in pyproject.toml
- Created example usage file for NVIDIA in examples/smart_scraper_graph/nvidia/

Co-authored-by: VinciGit00 <88108002+VinciGit00@users.noreply.github.com>
Co-authored-by: VinciGit00 <88108002+VinciGit00@users.noreply.github.com>
Co-authored-by: VinciGit00 <88108002+VinciGit00@users.noreply.github.com>
Copilot AI changed the title [WIP] Add integration for Nvidia LLM in scrapegraphai Add NVIDIA LLM integration with wrapper class pattern Nov 26, 2025
Copilot AI requested a review from VinciGit00 November 26, 2025 20:05
Copilot finished work on behalf of VinciGit00 November 26, 2025 20:05
@VinciGit00 VinciGit00 marked this pull request as ready for review November 28, 2025 04:07
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Nov 28, 2025
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:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nvidia LLM is no longer supported in latest scrapegraphai versions

2 participants