Skip to main content

create_driver

Function create_driver 

Source
pub fn create_driver(config: &ModelConfig) -> PunchResult<Arc<dyn LlmDriver>>
Expand description

Create an LlmDriver from a ModelConfig.

Reads the API key from the environment variable specified in config.api_key_env. Returns an error if the env var is missing (except for Ollama which does not require auth). Create a driver from config, optionally using a shared HTTP client.

If shared_client is Some, the driver will use that client for connection pooling. Otherwise it creates its own client (backward compat).