Skip to main content
Graphiti uses large language models (LLMs) to extract entities, relationships, and generate summaries from your content. Configure your preferred LLM provider to power these operations.

Supported Providers

OpenAI

GPT-4o, GPT-4o-mini, GPT-5, and more

Azure OpenAI

Enterprise OpenAI models on Azure

Anthropic

Claude 3.5 Sonnet, Claude 3 Opus, and more

Google Gemini

Gemini Pro and Gemini Flash

Groq

Fast inference with Llama, Mixtral, and more

Default Provider (OpenAI)

By default, Graphiti uses OpenAI’s GPT-4o-mini:

OpenAI Configuration

Basic Setup

Configuration Options

Environment Variables

  • gpt-4o - Best quality for complex extraction
  • gpt-4o-mini - Balanced performance and cost
  • gpt-5-mini - Fast extraction with good quality
  • o1-mini - Reasoning model for complex relationships

Azure OpenAI

Use OpenAI models deployed on Azure:

Environment Variables

Anthropic (Claude)

Use Claude models for extraction:

Environment Variables

  • claude-3-5-sonnet-20241022 - Best quality and reasoning
  • claude-3-5-haiku-20241022 - Fast and cost-effective
  • claude-3-opus-20240229 - Maximum capability

Google Gemini

Use Google’s Gemini models:

Environment Variables

  • gemini-1.5-pro - Best quality
  • gemini-1.5-flash - Fast inference
  • gemini-2.0-flash - Latest fast model

Groq

Use Groq for ultra-fast inference:

Environment Variables

  • llama-3.3-70b-versatile - Best Llama model
  • llama-3.1-8b-instant - Fast inference
  • mixtral-8x7b-32768 - Good for long contexts

Custom Base URLs

Use custom endpoints for OpenAI-compatible APIs:
This works with:
  • OpenRouter
  • Together AI
  • Local LLM servers (Ollama, vLLM, etc.)
  • Any OpenAI-compatible API

Token Tracking

Graphiti tracks token usage across all LLM calls:

Model Selection Strategy

Graphiti uses two model types:
Used for:
  • Entity extraction
  • Relationship extraction
  • Complex reasoning
Recommended:
  • OpenAI: gpt-4o
  • Anthropic: claude-3-5-sonnet-20241022
  • Gemini: gemini-1.5-pro

Cost Optimization

Use Small Models

Set small_model to a cost-effective option like gpt-4o-mini or claude-3-5-haiku-20241022

Batch Episodes

Use add_episode_bulk() to process multiple episodes efficiently

Lower Temperature

Use temperature=0.0 for deterministic, focused outputs

Track Usage

Monitor token usage with token_tracker to identify optimization opportunities

Reasoning Models

For OpenAI’s reasoning models (o1, o3 series), configure reasoning effort:
Reasoning models don’t support the temperature parameter. It’s automatically set to None.

Caching

Enable LLM response caching to reduce costs and latency:
Caching stores responses in memory. Use with caution in production environments.

Error Handling

Next Steps

Embeddings

Configure embedding providers for semantic search

Graph Drivers

Choose and configure your graph database

Adding Episodes

Start adding content to your knowledge graph