> ## 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.

# Switch Model • AI Agent SDK

> switch_model: Switch the agent's LLM model while preserving conversation history.

# switch\_model

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**Agent**](../classes/Agent) class in the [**agent**](../modules/agent) module.

Switch the agent's LLM model while preserving conversation history.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def switch_model(new_model: str) -> None
```

## Parameters

<ParamField query="new_model" type="str" required={true}>
  The new model name to switch to (e.g., "gpt-4o", "claude-3-sonnet")
</ParamField>

## Uses

* `LLM`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/agent.py#L6087">
  `praisonaiagents/agent/agent.py` at line 6087
</Card>
