# load_recent_models

> **Function** in `deepagents_code`

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

Read the most-recent-first list of `provider:model` specs.

Missing or malformed files yield an empty list rather than raising; the
recent section is a non-essential UI affordance and must not block the
selector from rendering.

## Signature

```python
load_recent_models(
    state_dir: Path | None = None,
) -> list[str]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `state_dir` | `Path \| None` | No | Override for the state directory (test hook). (default: `None`) |

## Returns

`list[str]`

Ordered list of recent `provider:model` specs, most recent first.
Capped at `RECENT_MODELS_LIMIT` and de-duplicated.

---

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