Model support
GraphRAG uses LiteLLM to support 100+ language models from various providers. This includes:- OpenAI (GPT-4, GPT-4 Turbo, GPT-4o, o1)
- Azure OpenAI
- Anthropic (Claude)
- Google (Gemini)
- AWS Bedrock
- Local models via Ollama or LiteLLM Proxy
GraphRAG has been most thoroughly tested with OpenAI’s GPT-4 series models. Other models are supported but may require additional prompt tuning.
Basic configuration
OpenAI models
The default configuration uses OpenAI models:Azure OpenAI
For Azure-hosted models:Azure Managed Identity
For production environments using managed identity:Other providers
Configure other providers using LiteLLM’s format:See LiteLLM’s documentation for provider-specific configuration. The
model_provider is the prefix before / and model is the suffix after /.Model configuration options
Required parameters
The model provider (e.g.,
openai, azure, anthropic, gemini)The specific model name (e.g.,
gpt-4.1, claude-3-5-sonnet-20241022)Authentication method:
api_key or azure_managed_identityOptional parameters
LLM provider type:
litellm or mock (for testing)API key for authentication (use environment variables)
Base URL for API requests (required for Azure and custom endpoints)
API version (Azure only)
Azure deployment name if different from model name
Default arguments sent with every request (e.g.,
temperature, max_tokens, n)Call arguments
Set default parameters for all model calls:Retry configuration
Configure automatic retry behavior for failed requests:Retry strategy:
exponential_backoff or immediateMaximum number of retry attempts
Base delay in seconds for exponential backoff
Maximum delay between retries (no limit if not specified)
Add random jitter to retry delays
Rate limiting
Control request rate to avoid hitting API limits:Rate limiting strategy (currently only
sliding_window supported)Time window for rate limiting in seconds
Maximum requests per time window
Maximum tokens per time window
Metrics configuration
Track model usage and performance:Where to write metrics:
log (console) or fileDirectory for metrics files (when using
file writer)Multiple model configuration
Define different models for different tasks:Model selection considerations
GPT-4 series (recommended)
GraphRAG has been thoroughly tested with:gpt-4- Original GPT-4 modelgpt-4-turbo- Faster GPT-4 with larger contextgpt-4o- Optimized multimodal modelgpt-4o-mini- Smaller, faster, more affordable
o-series models (reasoning)
The o-series models include built-in reasoning:o1- Advanced reasoning modelo1-mini- Smaller reasoning model
Structured output requirements
Your chosen model must support structured outputs with JSON schema validation. Most modern models support this, but verify before using custom models.
Using custom models
Via proxy servers
Use Ollama or LiteLLM Proxy to connect unsupported models:Via model protocol (library usage)
For programmatic use, implement the model protocol:Custom model implementations are only supported when using GraphRAG as a Python library, not via the CLI.
Best practices
Next steps
Settings reference
Complete configuration options
Storage
Configure storage and caching
Prompt tuning
Optimize prompts for your models
Start indexing
Begin processing documents