> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tai42.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Settings (tai42_kit.settings)

> The base settings class and the settings registry.

Settings machinery: the base class + the cache-reset registry. Leaf settings
live next to the impl they configure (`tai42_kit.llm`, `tai42_kit.clients`,
`tai42_kit.logging`).

## SettingsClassInfo

`tai42_kit.settings.registry.SettingsClassInfo`

```python theme={null}
class SettingsClassInfo(BaseModel)
```

A registered settings class, identified by its qualified name.

**Attributes**

| Attribute  | Type                      |
| ---------- | ------------------------- |
| `name`     | `str`                     |
| `module`   | `str`                     |
| `qualname` | `str`                     |
| `fields`   | `list[SettingsFieldInfo]` |

## SettingsFieldInfo

`tai42_kit.settings.registry.SettingsFieldInfo`

```python theme={null}
class SettingsFieldInfo(BaseModel)
```

One env-configurable field on a settings class, as plain data.

**Attributes**

| Attribute      | Type          |
| -------------- | ------------- |
| `name`         | `str`         |
| `env_var`      | `str`         |
| `type`         | `str`         |
| `default`      | `Any \| None` |
| `required`     | `bool`        |
| `secret`       | `bool`        |
| `description`  | `str \| None` |
| `nested_group` | `str \| None` |

## TaiBaseSettings

`tai42_kit.settings.base.TaiBaseSettings`

```python theme={null}
class TaiBaseSettings(BaseSettings)
```

**Attributes**

| Attribute      | Type |
| -------------- | ---- |
| `model_config` | —    |

### Members

#### with\_fallbacks

`tai42_kit.settings.base.TaiBaseSettings.with_fallbacks`

```python theme={null}
with_fallbacks(self, user_config: dict) -> dict
```

Return a dict with defaults added for missing keys (never override user config).

**Parameters**

| Parameter     | Type   | Default | Description |
| ------------- | ------ | ------- | ----------- |
| `user_config` | `dict` | —       | —           |

#### load\_with\_fallbacks

`tai42_kit.settings.base.TaiBaseSettings.load_with_fallbacks`

```python theme={null}
load_with_fallbacks(self, user_config: str) -> dict
```

**Parameters**

| Parameter     | Type  | Default | Description |
| ------------- | ----- | ------- | ----------- |
| `user_config` | `str` | —       | —           |

## register\_settings\_reset

`tai42_kit.settings.cache_registry.register_settings_reset`

```python theme={null}
register_settings_reset(fn: Callable[[], None]) -> Callable[[], None]
```

Register a hook that resets settings-derived state on global reset.

**Parameters**

| Parameter | Type                 | Default | Description |
| --------- | -------------------- | ------- | ----------- |
| `fn`      | `Callable[[], None]` | —       | —           |

## registered\_settings

`tai42_kit.settings.registry.registered_settings`

```python theme={null}
registered_settings() -> list[SettingsClassInfo]
```

Snapshot of every registered settings group, in registration order.

Returns model copies so callers cannot mutate the registry's internals.

## reset\_all\_settings

`tai42_kit.settings.cache_registry.reset_all_settings`

```python theme={null}
reset_all_settings() -> None
```

Drop every registered settings cache, then run the reset hooks.

## settings\_cache

`tai42_kit.settings.cache_registry.settings_cache`

```python theme={null}
settings_cache(fn: F) -> F
```

Cache a zero-arg settings accessor and register it for global reset.

**Parameters**

| Parameter | Type | Default | Description |
| --------- | ---- | ------- | ----------- |
| `fn`      | `F`  | —       | —           |
