Overview
Configure your R2R deployment
R2R was built with configuration in mind and utilizes TOML configuration files to define server-side variables.
The levels of configuration that are supported are:
- Server-side Configuration: Define default configuration for your R2R deployment.
- Runtime Settings: Dynamically override configuration settings when making API calls.
Server-side Configuration
R2R’s configuration format works by override. Default configuration values are defined in the r2r.toml
file.
A number of pre-defined configuration files ship with R2R, detailed below. For a complete list of configurable parameters and their defaults, refer to our all_possible_config.toml
file.
Custom Configuration Files
To create your own custom configuration:
- Create a new file named
my_r2r.toml
in your project directory. - Add only the settings you wish to customize. For example:
- Launch the R2R server with your custom configuration:
R2R will use your specified settings, falling back to the defaults defined in the main configuration files for any unspecified options.
Runtime Settings
When calling endpoints, such as retrieval/search
or retrieval/rag
, you can override server-side configurations on-the-fly. This allows for dynamic control over search settings, model selection, prompt customization, and more.
For example, using the Python SDK:
Refer here to learn more about configuring and dynamically setting your retrieval system.