---
title: models | CodeWeaver Docs
description: API reference for codeweaver.providers.env_registry.models
url: "https://docs.knitli.com/api/providers/env_registry/models"
type: static
generatedAt: "2026-04-17T17:21:09.236Z"
---

# models
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fmodels%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fmodels%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/api/providers/env_registry/models.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fmodels%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fmodels%2F&text=models)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fmodels%2F&text=models)[Share on Bluesky](https://bsky.app/intent/compose?text=models%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fmodels%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fmodels%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fmodels%2F&title=models)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fmodels%2F&t=models)[Share on Email](mailto:?subject=models&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fmodels%2F)[Share on WhatsApp](https://wa.me/?text=models%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fmodels%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fmodels%2F&text=models)
# `codeweaver.providers.env_registry.models`
[Section titled “codeweaver.providers.env_registry.models”](#codeweaverprovidersenv_registrymodels)
Lightweight dataclass models for provider environment configuration.

Uses frozen dataclasses with slots for performance and immutability. Validation happens at build-time, not runtime.

## Class: `EnvVarConfig`
[Section titled “Class: EnvVarConfig”](#class-envvarconfig)
Configuration for a single environment variable.

Immutable, lightweight, validated at build-time.

Attributes: env: Environment variable name (e.g., “OPENAI_API_KEY”) description: Human-readable description variable_name: Optional variable name in provider config variables: Optional tuple of VariableInfo for nested config is_secret: Whether this is a secret/sensitive value fmt: Optional format specification (e.g., EnvFormat.FILEPATH) choices: Optional frozenset of valid values default: Optional default value

Example: >>> EnvVarConfig( … env=“OPENAI_API_KEY”, … description=“Your OpenAI API Key”, … is_secret=True, … variable_name=“api_key”, … )

### Method: `to_dict`
[Section titled “Method: to_dict”](#method-to_dict)

**

```
to_dict()
```

Convert to dictionary for serialization.

Returns: dictionary suitable for JSON serialization

Example: >>> config = EnvVarConfig(…) >>> data = config.to_dict() >>> import json >>> json.dumps(data)

## Class: `ProviderEnvConfig`
[Section titled “Class: ProviderEnvConfig”](#class-providerenvconfig)
Complete environment configuration for a provider.

Represents one “set” of environment variables for a provider. Multi-client providers (like Azure) have multiple instances.

Attributes: provider: Provider name (lowercase) clients: Tuple of client SDK names (e.g., (“openai”,)) note: Optional note about the provider api_key: Optional API key configuration host: Optional host/base_url configuration endpoint: Optional endpoint configuration region: Optional region configuration port: Optional port configuration log_level: Optional log level configuration account_id: Optional account ID configuration tls_on_off: Optional TLS enable/disable configuration tls_cert_path: Optional TLS certificate path configuration tls_key_path: Optional TLS key path configuration other: Frozenset of custom/provider-specific fields as (key, EnvVarConfig) tuples inherits_from: Optional parent provider for inheritance

Example: >>> ProviderEnvConfig( … provider=“deepseek”, … clients=(“openai”,), … api_key=EnvVarConfig( … env=“DEEPSEEK_API_KEY”, description=“API Key”, is_secret=True … ), … inherits_from=“openai”, … )

### Method: `all_vars`
[Section titled “Method: all_vars”](#method-all_vars)

**

```
all_vars()
```

Get all environment variable configs including ‘other’.

Returns: Tuple of all EnvVarConfig instances (immutable and hashable)

Example: >>> config = ProviderEnvConfig(…) >>> all_vars = config.all_vars() >>> api_keys = [v for v in all_vars if v.is_secret]

### Method: `get_other`
[Section titled “Method: get_other”](#method-get_other)

**

```
get_other()
```

Get a custom field from ‘other’ by key.

Args: key: The key to look up in the ‘other’ dict

Returns: EnvVarConfig if found, None otherwise

Example: >>> config = ProviderEnvConfig(…) >>> webhook_secret = config.get_other(“webhook_secret”)

### Method: `to_dict`
[Section titled “Method: to_dict”](#method-to_dict-1)

**

```
to_dict()
```

Convert to dictionary for serialization (such as for MCP registry script).

Returns: dictionary suitable for JSON serialization

Example: >>> config = ProviderEnvConfig(…) >>> data = config.to_dict() >>> import json >>> json.dumps(data)