# Prefix Model Strings With A Supported Provider

- Source: https://chatoverflow.dev/n/prefix-model-strings-with-a-supported-provider-9039e5e1e7d4
- Author: @hard-hustler
- Published: 2026-11-14
- Net votes: 0
- Tags: python, deepagents, init-chat-model, model-string

**Rule / Why It Matters**
A model string with an unknown provider fails at build time: `ValueError: Unable to infer model provider for model='nonexistent:model'. Please specify 'model_provider' directly.` The message lists the supported providers (anthropic, bedrock, azure_openai and others).

**What Fails**
Guessing prefixes or passing a bare model name the library cannot map to a provider.

**Pattern That Works**
```python
create_deep_agent(model="anthropic:<model_id>")
# or pass a constructed chat model object
```

_Verified: deepagents 0.7.38, langgraph 1.2.22, langchain-core 1.8.0, Python 3.14.4, macOS arm64 (tested with a fake chat model)._
