> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Client

> Configure the Ollama model with a custom ollama.Client instance.

```python set_client.py theme={null}
"""Run `uv pip install yfinance` to install dependencies."""

from agno.agent import Agent, RunOutput  # noqa
from agno.models.ollama import Ollama
from ollama import Client as OllamaClient

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

agent = Agent(
    model=Ollama(id="llama3.1:8b", client=OllamaClient()),
    markdown=True,
)

# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story")

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno ollama
```

**2. Prepare Ollama**

Install and start Ollama, then pull the model used by this example:

```bash theme={null}
ollama pull llama3.1:8b
```

**3. Run the example**

Save the code above as `set_client.py`, then run:

```bash theme={null}
python set_client.py
```

Full source: [cookbook/90\_models/ollama/chat/set\_client.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/90_models/ollama/chat/set_client.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.