# save_auto_classifier_model

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/model_config/save_auto_classifier_model)

Persist the model the Auto approval classifier reviews actions with.

Writes `[models].auto_classifier`, the persistent counterpart of the
session-only `/auto model` switch. Both `--auto-classifier-model` and a
`DEEPAGENTS_CODE_AUTO_CLASSIFIER_MODEL` export outrank the stored value at
launch (flag > env > this key), so a successful write does not guarantee the
next launch reviews with it.

## Signature

```python
save_auto_classifier_model(
    model_spec: str,
    config_path: Path | None = None,
) -> bool
```

## Description

**Note:**

This function does not preserve comments in the config file.

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `model_spec` | `str` | Yes | The classifier model in `provider:model` format. |
| `config_path` | `Path \| None` | No | Path to config file.  Defaults to `~/.deepagents/config.toml`. (default: `None`) |

## Returns

`bool`

True if save succeeded, False if it failed due to I/O errors.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e4c1ffe9ee63d7854147de490ca27495ef157a7b/libs/code/deepagents_code/model_config.py#L4177)