Introduction
ScrapeGraphAI provides custom model classes that wrap various AI services and extend functionality for specific use cases. These models integrate seamlessly with the graph-based scraping pipeline, enabling advanced features like image-to-text conversion, text-to-speech generation, and support for multiple LLM providers.Available Models
LLM Providers
ScrapeGraphAI includes wrapper classes for several LLM providers that use OpenAI-compatible APIs:- DeepSeek - DeepSeek language models with OpenAI-compatible API
- XAI - xAI Grok models with OpenAI-compatible API
- Nvidia - NVIDIA AI Foundation models
- OneApi - Generic OpenAI-compatible API wrapper
- CLoD - CLōD language models with OpenAI-compatible API
Specialized Models
- OpenAIImageToText - Convert images to text descriptions using OpenAI vision models
- OpenAITextToSpeech - Generate speech audio from text using OpenAI TTS models
Model Integration
All custom models integrate with ScrapeGraphAI’s graph-based architecture. Models are configured through the graph’sconfig dictionary and can be used in nodes throughout the scraping pipeline.
Basic Usage Pattern
Direct Model Usage
You can also instantiate and use models directly:Configuration
LLM Configuration
LLM wrapper models (DeepSeek, XAI, Nvidia, etc.) accept standard LangChain ChatOpenAI parameters:The model identifier to use (e.g., “deepseek-chat”, “grok-beta”)
API key for authentication (automatically mapped to provider-specific key)
Controls randomness in model outputs (0.0 to 1.0)
Maximum number of tokens to generate in responses
Enable streaming responses
Specialized Model Configuration
Specialized models like OpenAIImageToText and OpenAITextToSpeech have their own configuration requirements. See individual model pages for details.Architecture
Wrapper Pattern
Most LLM models use a wrapper pattern that:- Extends LangChain’s
ChatOpenAIclass - Automatically maps
api_keyto provider-specific parameter names - Sets provider-specific base URLs
- Inherits all LangChain functionality
Lazy Loading
Some models (like Nvidia) use lazy loading to avoid import errors when optional dependencies aren’t installed:Graph Integration Examples
Image-to-Text in OmniScraperGraph
Text-to-Speech in SpeechGraph
Next Steps
OpenAI Models
Image-to-text and text-to-speech models
DeepSeek
DeepSeek language models integration
NVIDIA
NVIDIA AI Foundation models
xAI
xAI Grok models integration
