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

# Model Parameter

> One model parameter, one canonical name — model=

`model=` is the canonical name for the model on every agent class; `llm=` is a deprecated alias for it.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    subgraph "One parameter, one name"
        M[✅ model=&quot;gpt-4o&quot;] --> OK[🤖 Agent runs]
        L[⚠️ llm=&quot;gpt-4o&quot;] --> OK
        B[❌ llm= and model=] --> Err[🚫 TypeError]
    end

    classDef canonical fill:#10B981,stroke:#7C90A0,color:#fff
    classDef deprecated fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef both fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef agent fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef error fill:#6366F1,stroke:#7C90A0,color:#fff

    class M canonical
    class L deprecated
    class B both
    class OK agent
    class Err error
```

## Quick Start

<Steps>
  <Step title="Use the canonical name">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent

    agent = Agent(
        instructions="Summarise the given article in three bullets.",
        model="gpt-4o",
    )

    agent.start("<article text>")
    ```
  </Step>

  <Step title="The deprecated alias still works">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent

    agent = Agent(
        instructions="Summarise the given article.",
        llm="gpt-4o",
    )
    ```

    <Note>
      `llm=` still works but emits a `DeprecationWarning`. Move to `model=` at your convenience.
    </Note>
  </Step>

  <Step title="Passing both is refused">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent

    # ❌ Passing both is refused
    Agent(instructions="…", llm="gpt-4o", model="gpt-3.5-turbo")
    # TypeError: Agent() received both llm= and model=. They are the same
    #   parameter, so passing both is ambiguous. Pass only one; model= is
    #   the canonical name (llm= is a deprecated alias).
    ```
  </Step>
</Steps>

***

## How It Works

Every agent class routes `llm=` and `model=` through one resolver so the rule is identical everywhere.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph TB
    Start{Both llm= and model= set?} -->|Yes| Raise[🚫 raise TypeError]
    Start -->|No| Pick[Pick the non-None one]
    Pick --> Wrap{LLMConfig on a media/specialised agent?}
    Wrap -->|Yes| Unwrap[Unwrap to the bare .model string]
    Wrap -->|No| Use[Use the value as-is]

    classDef question fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef error fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef action fill:#10B981,stroke:#7C90A0,color:#fff

    class Start,Wrap question
    class Raise error
    class Pick,Unwrap,Use action
```

| Call                                         | Result                                                                   |
| -------------------------------------------- | ------------------------------------------------------------------------ |
| `Agent(model="gpt-4o")`                      | ✅ Canonical. Preferred everywhere.                                       |
| `Agent(llm="gpt-4o")`                        | ⚠️ Deprecated alias. Works, emits a `DeprecationWarning`.                |
| `Agent(llm="gpt-4o", model="gpt-3.5-turbo")` | ❌ `TypeError` — same parameter, so passing both is ambiguous.            |
| `Agent(model=LLMConfig(model="gpt-4o", …))`  | ✅ Accepted. Media/specialised agents unwrap it to the bare model string. |

***

## Where It Applies

The `llm=` / `model=` pair resolves the same way on every class below.

| Class            | Accepts `model=` | Accepts `llm=` (deprecated) |
| ---------------- | :--------------: | :-------------------------: |
| `Agent`          |         ✅        |              ✅              |
| `AgentTeam`      |         ✅        |              ✅              |
| `AgentFlow`      |         ✅        |              ✅              |
| `VisionAgent`    |         ✅        |              ✅              |
| `AudioAgent`     |         ✅        |              ✅              |
| `OCRAgent`       |         ✅        |              ✅              |
| `VideoAgent`     |         ✅        |              ✅              |
| `EmbeddingAgent` |         ✅        |              ✅              |
| `ImageAgent`     |         ✅        |              ✅              |
| `ContextAgent`   |         ✅        |              ✅              |
| `CodeAgent`      |         ✅        |              ✅              |
| `RealtimeAgent`  |         ✅        |              ✅              |

<Note>
  `manager_llm=` on `AgentTeam` / `AgentFlow` is **separate** and unchanged — it is the hierarchical manager's model and never touches the members.
</Note>

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent, AgentTeam, Task

# Default model for members that did not name one themselves
team = AgentTeam(
    agents=[Agent(instructions="Researcher"), Agent(instructions="Writer")],
    tasks=[Task(description="Write a two-paragraph brief on quantum sensing.")],
    model="gpt-4o-mini",
)

team.start()
```

***

## Migration

<AccordionGroup>
  <Accordion title="I use llm= in every example">
    No code change is required — `llm=` still works. Move to `model=` at your convenience; it is the canonical name.
  </Accordion>

  <Accordion title="I pass both llm= and model= today">
    Pick one. `model=` is the canonical name. Passing both now raises `TypeError` because the two are the same parameter and guessing a winner could change which vendor is billed.
  </Accordion>

  <Accordion title="I pass an LLMConfig to a specialised agent">
    On `VisionAgent`, `AudioAgent`, `OCRAgent`, `VideoAgent`, `EmbeddingAgent`, `CodeAgent`, `RealtimeAgent`, `ImageAgent`, and `ContextAgent` you no longer need to unwrap an `LLMConfig` yourself. The class stores its `.model` string and keeps its own `base_url=` / `api_key=`.
  </Accordion>

  <Accordion title="I use CodeAgent(llm=…), RealtimeAgent(llm=…), AgentTeam(llm=…), or AgentFlow(llm=…)">
    Those four now also accept `model=` (canonical). The alias `llm=` still works.
  </Accordion>
</AccordionGroup>

***

## Related

<CardGroup cols={2}>
  <Card title="LLM Config" icon="sliders" href="/docs/features/llm-config">
    Pass an `LLMConfig` object to `model=` for `base_url`, `api_key`, and fallbacks.
  </Card>

  <Card title="Legacy Agent Parameters" icon="arrow-right-arrow-left" href="/docs/features/agent-legacy-params">
    Other deprecated `Agent()` parameters and their replacements.
  </Card>
</CardGroup>
