Core concepts
Configuration
Learn how to configure Language Models (LLMs) and general settings in Dendrite
Configuring Dendrite
General Configuration
The Config
class in Dendrite handles all configuration settings, including caching, authentication sessions, and LLM configurations. Here’s how to use it:
Configuration Options
Option | Default | Description |
---|---|---|
root_path | .dendrite | Base directory for all Dendrite files |
cache_path | cache | Directory for caching extraction results and selectors |
auth_session_path | auth | Directory for storing authentication sessions |
The configuration system manages several caches:
- Extract cache: Stores script extraction results
- Element cache: Stores element selectors
- Storage cache: Stores browser storage states
Language Model Configuration
Dendrite uses various AI agents powered by Large Language Models (LLMs) to interact with web browsers. While the library defaults to using Anthropic’s Claude 3.5 Sonnet model, you have full flexibility to configure different models for each agent.
By default, Dendrite uses the following configuration for its agents:
Agent | Default Model |
---|---|
extract_agent | claude-3-5-sonnet-20241022 |
scroll_agent | claude-3-5-sonnet-20241022 |
ask_page_agent | claude-3-5-sonnet-20241022 |
segment_agent | claude-3-haiku-20240307 |
select_agent | claude-3-5-sonnet-20241022 |
verify_action_agent | claude-3-5-sonnet-20241022 |
Customizing Models
You can customize the models used by each agent in several ways:
1. During Initialization
2. Registering Agents at Runtime
Supported Models
Dendrite uses LiteLLM under the hood for calling the LLMs, which supports:
- OpenAI models (GPT-4, GPT-3.5)
- Anthropic models (Claude 3 Opus, Sonnet, Haiku)
- Local models (LlamaCPP, vLLM deployments)
- Many other providers through LiteLLM’s integrations
Important Notes
- The default configuration uses Claude 3.5 Sonnet as it provides a good balance of performance and cost
- While you can use any supported model, the framework’s performance and accuracy might vary with different models
- The
segment_agent
defaults to GPT-4 as it has shown better performance for this specific task - Consider the following when choosing models:
- Token context window requirements
- Cost per token
- Inference speed
- Model capabilities for specific tasks