Skip to content

Setup

infra.llm.setup

Summary

LLM pool factories resolved from configuration.


Import and instantiate the provider-specific synchronous or asynchronous pool selected by the LLM_PROVIDER environment variable.

Classes

Functions

setup_async_pool

setup_async_pool(provider: str = None) -> AsyncPoolAdaptor

Build an asynchronous pool for the selected provider.

Parameters:

Name Type Description Default
provider str

Provider key; defaults to LLM_PROVIDER or open_router.

None

Returns:

Name Type Description
AsyncPoolAdaptor AsyncPoolAdaptor

Configured asynchronous pool.

setup_sync_pool

setup_sync_pool(provider: str = None) -> PoolAdaptor

Build a synchronous pool for the selected provider.

Parameters:

Name Type Description Default
provider str

Provider key; defaults to LLM_PROVIDER or open_router.

None

Returns:

Name Type Description
PoolAdaptor PoolAdaptor

Configured synchronous pool.