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

# LiteLLM Tool Use

> Call YFinance tools from a LiteLLM agent with sync, streaming, and async runs.

```python tool_use.py theme={null}
"""
Litellm Tool Use
================

Cookbook example for `litellm/tool_use.py`.
"""

import asyncio

from agno.agent import Agent
from agno.models.litellm import LiteLLM
from agno.tools.yfinance import YFinanceTools

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

openai_agent = Agent(
    model=LiteLLM(
        id="gpt-5.6-luna",
        name="LiteLLM",
    ),
    markdown=True,
    tools=[YFinanceTools()],
)

# Ask a question that would likely trigger tool use

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    # --- Sync ---
    openai_agent.print_response("How is TSLA stock doing right now?")

    # --- Sync + Streaming ---
    openai_agent.print_response("Whats happening in France?", stream=True)

    # --- Async ---
    asyncio.run(openai_agent.aprint_response("What is happening in France?"))
```

## Run the Example

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

**1. Install dependencies**

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

**2. Export your LiteLLM API key**

```bash Mac/Linux theme={null}
export LITELLM_API_KEY="your_litellm_api_key_here"
```

```bash Windows theme={null}
$Env:LITELLM_API_KEY="your_litellm_api_key_here"
```

**3. Run the example**

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

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

Full source: [cookbook/90\_models/litellm/tool\_use.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/90_models/litellm/tool_use.py)


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