> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-docs-scavio-google-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

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

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno ollama
    ```
  </Step>

  <Step title="Prepare Ollama">
    Install and start Ollama, then pull the model used by this example:

    ```bash theme={null}
    ollama pull llama3.1:8b
    ```
  </Step>

  <Step title="Run the example">
    Save the code above as `set_client.py`, then run:

    ```bash theme={null}
    python set_client.py
    ```
  </Step>
</Steps>

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