yera.config.schema.providers

Provider config — one entry per provider type, each holding named connections.

Symbols

class AnthropicConnection — Connection config for the Anthropic API.
class AnthropicProviderConfig — Provider config for the Anthropic API.
class AWSConnection — Connection config for AWS Bedrock.
class AWSProviderConfig — Provider config for AWS Bedrock.
class AzureConnection — Connection config for Azure OpenAI.
class AzureProviderConfig — Provider config for Azure OpenAI.
class BaseConnection — Base class for all provider connections.
class BaseProviderConfig — Common structure for all provider configs.
class LlamaCppConnection — Connection config for llama-cpp direct library mode.
class LlamaCppProviderConfig — Provider config for llama-cpp direct library mode.
class OllamaConnection — Connection config for an Ollama instance.
class OllamaProviderConfig — Provider config for Ollama.
class OpenAIConnection — Connection config for the OpenAI API.
class OpenAIProviderConfig — Provider config for the OpenAI API.
class Providers — Top-level provider config loaded from ``yera.toml``.

AnthropicConnection

Inherits: BaseConnection

Connection config for the Anthropic API.

No connection config beyond credentials — the endpoint is fixed.

Attributes

credentials_map

Names of secrets required by this connection.

AnthropicProviderConfig

Provider config for the Anthropic API.

Attributes

connections
type: dict[str, AnthropicConnection]

Named connection configs, each declaring credential names.

AWSConnection

Inherits: BaseConnection

Connection config for AWS Bedrock.

Attributes

region
type: str

AWS region to connect to, e.g. "eu-west-1".

profile
type: str

Underlying AWS named profile from ~/.aws/config. If None, the default AWS profile is used.

credentials_map
type: str

Names of secrets required by this connection.

AWSProviderConfig

Provider config for AWS Bedrock.

Attributes

connections
type: dict[str, AWSConnection]

Named connection configs, each declaring a region, optional AWS profile name, and credential names.

AzureConnection

Inherits: BaseConnection

Connection config for Azure OpenAI.

Attributes

endpoint
type: str

Azure OpenAI endpoint URL.

api_version
type: str

Azure OpenAI API version string, e.g. "2024-02-01".

credentials_map
type: str

Names of secrets required by this connection.

AzureProviderConfig

Provider config for Azure OpenAI.

Attributes

connections
type: dict[str, AzureConnection]

Named connection configs, each declaring an endpoint, API version, and credential names.

BaseConnection

Inherits: BaseModel

Base class for all provider connections.

credentials declares the names of secrets this connection requires. The retrieval method resolves each name from the keyring using the path providers.<provider_type>.<connection_name>.<credential_name>.

Attributes

credentials_map

Names of secrets required by this connection.

BaseProviderConfig

Inherits: BaseModel, Generic[TConnection]

Common structure for all provider configs.

Each provider holds a named collection of connections. The active connection is always determined by the active Yera profile's provider map — never by the provider itself.

Attributes

connections
type: dict[str, TConnection]

Named connection configs for this provider.

LlamaCppConnection

Inherits: BaseConnection

Connection config for llama-cpp direct library mode.

Attributes

model_dirs
type: list[str]

Filesystem paths to directories containing local GGUF model files.

LlamaCppProviderConfig

Provider config for llama-cpp direct library mode.

Attributes

connections
type: dict[str, LlamaCppConnection]

Named connection configs, each declaring one or more local model directory paths.

OllamaConnection

Inherits: BaseConnection

Connection config for an Ollama instance.

Supports both local and remote instances via base_url. Credentials are optional — only needed for secured remote instances.

Attributes

base_url
type: str

URL of the Ollama instance.

credentials_map
type: str

Names of secrets required by this connection.

OllamaProviderConfig

Provider config for Ollama.

Supports both local and remote instances via per-connection base_url.

Attributes

connections
type: dict[str, OllamaConnection]

Named connection configs, each declaring a base URL and optional credential names.

OpenAIConnection

Inherits: BaseConnection

Connection config for the OpenAI API.

No connection config beyond credentials — the endpoint is fixed.

Attributes

credentials_map

Names of secrets required by this connection.

OpenAIProviderConfig

Provider config for the OpenAI API.

Attributes

connections
type: dict[str, OpenAIConnection]

Named connection configs, each declaring credential names.

Providers

Inherits: BaseModel

Top-level provider config loaded from yera.toml.

Each field is optional — only configured providers are present.

Attributes

anthropic
type: AnthropicProviderConfig | None

Anthropic API provider config.

openai
type: OpenAIProviderConfig | None

OpenAI API provider config.

aws
type: AWSProviderConfig | None

AWS Bedrock provider config.

azure
type: AzureProviderConfig | None

Azure OpenAI provider config.

ollama
type: OllamaProviderConfig | None

Ollama provider config.

llama_cpp
type: LlamaCppProviderConfig | None

llama-cpp direct library mode provider config.

Methods

connection_for_model — Get the provider connection used by a given model.

Providers.connection_for_model

connection_for_model(
    model: BaseModelConfig,
) → BaseConnection

Get the provider connection used by a given model.

The connection object represents all the data needed to call the provider and use the given model.

Returns

type: BaseConnection

the connection config object representing the connection.