Class LlmConnectionFactory

Namespace: redb.Route.Llm
Assembly: redb.Route.Llm.dll

Connection factory configuration for the LLM connector. Register in the route
registry and reference by name in endpoint URIs (connectionFactory=myFactory
or as the URI host: llm://myFactory).

Centralises model identity, version, credentials and per-provider tuning so
they are kept out of the URI.

public sealed class LlmConnectionFactory

Inheritance

Object→LlmConnectionFactory

Properties

ApiKey

API key. Prefer for production deployments.

public string? ApiKey { get; set; }

ApiKeySecretRef

Reference to a secret store entry — resolved at time.

public string? ApiKeySecretRef { get; set; }

BaseUrl

Optional base URL override (Azure OpenAI, OpenAI-compatible servers, local Ollama).

public Uri? BaseUrl { get; set; }

Effort

Effort level for models that think by default (Anthropic Claude 4.6+ / Sonnet 5 / Opus 5:

public string? Effort { get; set; }

LoggerFactory

Logger factory used by built providers for diagnostics (e.g. Anthropic sampling-knob

public ILoggerFactory? LoggerFactory { get; set; }

MaxTokens

Default max output tokens.

public int? MaxTokens { get; set; }

ModelContractTier

Optional Anthropic contract-tier override (legacy/transitional/modern).

public string? ModelContractTier { get; set; }

ModelId

Model identifier passed to the provider (e.g. "claude-haiku-4.5", "gpt-4o-mini").

public string ModelId { get; set; }

Name

Logical name of this factory (the registry key, e.g. "claude").

public string Name { get; set; }

PrebuiltProvider

Optional pre-built provider instance. When set, returns it

public ILlmProvider? PrebuiltProvider { get; set; }

Provider

Provider identifier: "anthropic", "openai", "azure-openai", "ollama", "stub".

public string Provider { get; set; }

RequestTimeoutMs

Limit of one call to the model, in milliseconds (default: 600 000, ten minutes, like the official Anthropic

public int RequestTimeoutMs { get; set; }

StreamIdleTimeoutMs

Longest silence of a streamed call, in milliseconds: how long the provider may send nothing at all — no text,

public int? StreamIdleTimeoutMs { get; set; }

Temperature

Default sampling temperature.

public double? Temperature { get; set; }

TopP

Default top-p sampling parameter.

public double? TopP { get; set; }

Methods

Build()

Builds an from this configuration. Resolution order:

public ILlmProvider Build()