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

# Groq Llama Finance Agent

> Llama 4 Scout on Groq uses the think tool as a scratchpad while writing a finance report.

<Warning>
  For free and developer tiers, Groq will shut down `meta-llama/llama-4-scout-17b-16e-instruct` on July 17, 2026. Replace it with the vision-capable `qwen/qwen3.6-27b` before that date. See [Groq deprecations](https://console.groq.com/docs/deprecations).
</Warning>

```python groq_llama_finance_agent.py theme={null}
"""
Groq Llama Finance Agent
========================

Demonstrates this reasoning cookbook example.
"""

from textwrap import dedent

from agno.agent import Agent
from agno.models.groq import Groq
from agno.tools.reasoning import ReasoningTools
from agno.tools.websearch import WebSearchTools


# ---------------------------------------------------------------------------
# Create Example
# ---------------------------------------------------------------------------
def run_example() -> None:
    thinking_llama = Agent(
        model=Groq(id="meta-llama/llama-4-scout-17b-16e-instruct"),
        tools=[
            ReasoningTools(),
            WebSearchTools(),
        ],
        instructions=dedent("""\
        ## General Instructions
        - Always start by using the think tool to map out the steps needed to complete the task.
        - After receiving tool results, use the think tool as a scratchpad to validate the results for correctness
        - Before responding to the user, use the think tool to jot down final thoughts and ideas.
        - Present final outputs in well-organized tables whenever possible.

        ## Using the think tool
        At every step, use the think tool as a scratchpad to:
        - Restate the object in your own words to ensure full comprehension.
        - List the  specific rules that apply to the current request
        - Check if all required information is collected and is valid
        - Verify that the planned action completes the task\
        """),
        markdown=True,
    )
    thinking_llama.print_response("Write a report comparing NVDA to TSLA", stream=True)


# ---------------------------------------------------------------------------
# Run Example
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    run_example()
```

## Run the Example

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

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

  <Step title="Export your Groq API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export GROQ_API_KEY="your_groq_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:GROQ_API_KEY="your_groq_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Replace Llama 4 Scout">
    Replace `meta-llama/llama-4-scout-17b-16e-instruct` with `qwen/qwen3.6-27b` in the saved file.
  </Step>

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

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

Full source: [cookbook/10\_reasoning/tools/groq\_llama\_finance\_agent.py](https://github.com/agno-agi/agno/blob/main/cookbook/10_reasoning/tools/groq_llama_finance_agent.py)
