Configuration

This section contains auto-generated documentation for configuration modules.

Config Module

Pydantic models for service configuration.

class routir.config.config.ServiceConfig(*, name, engine, config, processor='BatchQueryProcessor', cache=-1, batch_size=32, cache_ttl=600, max_wait_time=0.05, cache_key_fields=<factory>, cache_redis_url=None, cache_redis_kwargs=<factory>, scoring_disabled=False)[source]

Bases: BaseModel

Configuration for a search/ranking service.

name

Service identifier

Type:

str

engine

Engine class to use; can be defined in external scripts or extensions (e.g., ‘PLAIDX’, ‘LSR’, ‘Qwen3’)

Type:

str

config

Engine-specific configuration parameters

Type:

Dict[str, Any]

processor

Processor class name for handling requests

Type:

str

cache

Cache size (-1 to disable)

Type:

int

batch_size

Number of requests to batch together

Type:

int

cache_ttl

Time-to-live for cache entries in seconds

Type:

int

max_wait_time

Maximum time to wait for batching in seconds

Type:

float

cache_key_fields

Fields to use for cache key generation

Type:

List[str]

cache_redis_url

Redis URL for distributed caching

Type:

str | None

cache_redis_kwargs

Additional Redis configuration parameters

Type:

Dict[str, Any] | None

scoring_disabled

Whether to disable scoring functionality

Type:

bool

name: str
engine: str
config: Dict[str, Any]
processor: str
cache: int
batch_size: int
cache_ttl: int
max_wait_time: float
cache_key_fields: List[str]
cache_redis_url: str | None
cache_redis_kwargs: Dict[str, Any] | None
scoring_disabled: bool
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class routir.config.config.ColllectionConfig(*, name, doc_path, offset_source='offsetfile', id_field='id', content_field='text', id_to_lang_mapping=None, cache_path=None)[source]

Bases: BaseModel

Configuration for a document collection.

name

Collection identifier

Type:

str

doc_path

Path to the document file (typically JSONL)

Type:

str

offset_source

Method for generating document offsets

Type:

Literal[‘msmarco_seg’, ‘offsetfile’]

id_field

JSON field name for document IDs

Type:

str

content_field

JSON field name(s) for document content

Type:

str | List[str]

id_to_lang_mapping

Optional path to language mapping file

Type:

str | None

cache_path

Optional path for offset map cache

Type:

str | None

name: str
doc_path: str
offset_source: Literal['msmarco_seg', 'offsetfile']
id_field: str
content_field: str | List[str]
id_to_lang_mapping: str | None
cache_path: str | None
model_post_init(_ColllectionConfig__context)[source]

Ensure content_field is always a list.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class routir.config.config.Config(*, services=<factory>, collections=<factory>, server_imports=<factory>, file_imports=<factory>, dynamic_pipeline=True)[source]

Bases: BaseModel

Main configuration for the routir service.

services

List of engine service configurations

Type:

List[routir.config.config.ServiceConfig]

collections

List of document collection configurations

Type:

List[routir.config.config.ColllectionConfig]

server_imports

List of remote servers to import services from

Type:

List[str]

file_imports

List of Python files to import for custom extensions

Type:

List[str]

dynamic_pipeline

Whether to enable dynamic pipeline creation

Type:

bool

services: List[ServiceConfig]
collections: List[ColllectionConfig]
server_imports: List[str]
file_imports: List[str]
dynamic_pipeline: bool
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Config Loader