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 APIKeyConnection — Base configuration for providers authenticated by an API key.
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 GeminiConnection — Connection config for the Gemini Developer API.
class GeminiProviderConfig — Provider config for the Gemini Developer API.
class LlamaCppConnection — Connection config for llama-cpp direct library mode.
class LlamaCppProviderConfig — Provider config for llama-cpp direct library mode.
class MistralConnection — Connection config for the Mistral API.
class MistralProviderConfig — Provider config for the Mistral API.
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 OpenRouterConnection — Connection config for the OpenRouter API.
class OpenRouterProviderConfig — Provider config for the OpenRouter API.
class Providers — Top-level provider config loaded from ``yera.toml``.

AnthropicConnection

Connection config for the Anthropic API.

Fields

api_key_reference_type
type: Literal['environment', 'store'] (required)

Whether the API key is referenced through the environment or Yera's protected secret store.

api_key_reference
type: str (required)

Environment-variable name or opaque stored-secret identifier.

AnthropicProviderConfig

Provider config for the Anthropic API.

Fields

connections
type: dict[str, yera.config.schema.providers.AnthropicConnection] = <factory>

Named connection configs, each declaring credential names.

APIKeyConnection

Inherits: BaseConnection

Base configuration for providers authenticated by an API key.

Fields

api_key_reference_type
type: Literal['environment', 'store'] (required)

Whether the API key is referenced through the environment or Yera's protected secret store.

api_key_reference
type: str (required)

Environment-variable name or opaque stored-secret identifier.

AWSConnection

Inherits: BaseConnection

Connection config for AWS Bedrock.

Fields

region
type: str (required)

AWS region used by this connection.

profile
type: str (required)

Named profile from the local AWS configuration.

AWSProviderConfig

Provider config for AWS Bedrock.

Fields

connections
type: dict[str, yera.config.schema.providers.AWSConnection] = <factory>

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

AzureConnection

Inherits: BaseConnection

Connection config for Azure OpenAI.

Fields

resource_name
type: str (required)

Name of the Azure OpenAI resource.

resource_group
type: str (required)

Azure resource group containing the OpenAI resource.

subscription_id
type: str (required)

Azure subscription containing the OpenAI resource.

endpoint
type: str (required)

URL of the Azure OpenAI endpoint.

tenant_id
type: str (required)

Azure tenant used to authenticate this connection.

AzureProviderConfig

Provider config for Azure OpenAI.

Fields

connections
type: dict[str, yera.config.schema.providers.AzureConnection] = <factory>

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>.

Fields

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.

Fields

connections
type: dict[str, ~TConnection] = <factory>

Named connection configs for this provider.

GeminiConnection

Connection config for the Gemini Developer API.

Fields

api_key_reference_type
type: Literal['environment', 'store'] (required)

Whether the API key is referenced through the environment or Yera's protected secret store.

api_key_reference
type: str (required)

Environment-variable name or opaque stored-secret identifier.

GeminiProviderConfig

Provider config for the Gemini Developer API.

Fields

connections
type: dict[str, yera.config.schema.providers.GeminiConnection] = <factory>

Named Gemini connection configurations.

LlamaCppConnection

Inherits: BaseConnection

Connection config for llama-cpp direct library mode.

Fields

model_dirs
type: list[str] = <factory>

Directories searched for local GGUF model files.

LlamaCppProviderConfig

Provider config for llama-cpp direct library mode.

Fields

connections
type: dict[str, yera.config.schema.providers.LlamaCppConnection] = <factory>

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

MistralConnection

Connection config for the Mistral API.

Fields

api_key_reference_type
type: Literal['environment', 'store'] (required)

Whether the API key is referenced through the environment or Yera's protected secret store.

api_key_reference
type: str (required)

Environment-variable name or opaque stored-secret identifier.

MistralProviderConfig

Provider config for the Mistral API.

Fields

connections
type: dict[str, yera.config.schema.providers.MistralConnection] = <factory>

Named connection configs, each declaring credential names.

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.

Fields

base_url
type: str = 'http://localhost:11434'

Address of the Ollama service.

OllamaProviderConfig

Provider config for Ollama.

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

Fields

connections
type: dict[str, yera.config.schema.providers.OllamaConnection] = <factory>

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

OpenAIConnection

Connection config for the OpenAI API.

Fields

api_key_reference_type
type: Literal['environment', 'store'] (required)

Whether the API key is referenced through the environment or Yera's protected secret store.

api_key_reference
type: str (required)

Environment-variable name or opaque stored-secret identifier.

OpenAIProviderConfig

Provider config for the OpenAI API.

Fields

connections
type: dict[str, yera.config.schema.providers.OpenAIConnection] = <factory>

Named connection configs, each declaring credential names.

OpenRouterConnection

Connection config for the OpenRouter API.

Fields

api_key_reference_type
type: Literal['environment', 'store'] (required)

Whether the API key is referenced through the environment or Yera's protected secret store.

api_key_reference
type: str (required)

Environment-variable name or opaque stored-secret identifier.

http_referer
type: str | None = None

Optional application URL sent for OpenRouter attribution.

app_title
type: str | None = None

Optional application name sent for OpenRouter attribution.

OpenRouterProviderConfig

Provider config for the OpenRouter API.

Fields

connections
type: dict[str, yera.config.schema.providers.OpenRouterConnection] = <factory>

Named OpenRouter connection configurations.

Providers

Inherits: BaseModel

Top-level provider config loaded from yera.toml.

Each field is optional — only configured providers are present.

Fields

anthropic
type: yera.config.schema.providers.AnthropicProviderConfig | None = None

Anthropic API provider config.

openai
type: yera.config.schema.providers.OpenAIProviderConfig | None = None

OpenAI API provider config.

mistral
type: yera.config.schema.providers.MistralProviderConfig | None = None

Mistral API provider config.

aws
type: yera.config.schema.providers.AWSProviderConfig | None = None

AWS Bedrock provider config.

azure
type: yera.config.schema.providers.AzureProviderConfig | None = None

Azure OpenAI provider config.

ollama
type: yera.config.schema.providers.OllamaProviderConfig | None = None

Ollama provider config.

llama_cpp
type: yera.config.schema.providers.LlamaCppProviderConfig | None = None

llama-cpp direct library mode provider config.

openrouter
type: yera.config.schema.providers.OpenRouterProviderConfig | None = None

OpenRouter API provider config.

gemini
type: yera.config.schema.providers.GeminiProviderConfig | None = None

Gemini Developer API 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.

Parameters

model
type: BaseModelConfig

Model whose configured provider connection should be resolved.

Returns

type: BaseConnection

The connection configuration used by the model.

Raises

ValueError

If the model's provider or named connection is not configured.