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

# Llama Stack

> Llama Stack is a framework from Meta AI for building Agentic applications.

AgentOps integrates with Llama Stack via its python [client](https://github.com/meta-llama/llama-stack-client-python) to provide observability into applications that leverage it.

Llama Stack has comprehensive [documentation](https://llama-stack.readthedocs.io/) available as well as a great [quickstart](https://llama-stack.readthedocs.io/en/latest/getting_started/index.html) guide. You can use this guide to setup the Llama Stack server and client or alternatively use our Docker [compose](https://github.com/AgentOps-AI/agentops/blob/main/examples/llama_stack_client_examples/docker-compose.yml) file.

<iframe width="560" height="315" src="https://www.youtube.com/embed/OZgTN4SdQ2Y" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />

## Adding AgentOps to Llama Stack applications

<Steps>
  <Step title="Install the AgentOps SDK">
    <CodeGroup>
      ```bash pip  theme={null}
      pip install agentops
      ```

      ```bash poetry theme={null}
      poetry add agentops
      ```
    </CodeGroup>
  </Step>

  <Step title="Install the Llama Stack Client">
    <CodeGroup>
      ```bash pip theme={null}
      pip install llama-stack-client
      ```

      ```bash poetry theme={null}
      poetry add llama-stack-client
      ```
    </CodeGroup>
  </Step>

  <Step title="Add 3 lines of code">
    <Note>
      Make sure to call `agentops.init` before calling any `openai`, `cohere`, `crew`, etc models.
    </Note>

    <span className="api-key-container">
      <CodeGroup>
        ```python python theme={null}
        import agentops
        agentops.init(<INSERT YOUR API KEY HERE>)
        ```
      </CodeGroup>
    </span>

    <Tip>
      Set your API key as an `.env` variable for easy access.
    </Tip>

    <span className="api-key-container">
      <CodeGroup>
        ```python .env theme={null}
        AGENTOPS_API_KEY=<YOUR API KEY>
        ```
      </CodeGroup>

      Read more about environment variables in [Advanced Configuration](/v1/usage/advanced-configuration)
    </span>
  </Step>

  <Step title="Run your 🦙🥞 application">
    Execute your program and visit [app.agentops.ai/drilldown](https://app.agentops.ai/drilldown) to observe your waterfall! 🕵️

    <Tip>
      After your run, AgentOps prints a clickable url to console linking directly to your session in the Dashboard
    </Tip>
  </Step>
</Steps>

## Examples

An example notebook is available [here](https://github.com/AgentOps-AI/agentops/blob/main/examples/llama_stack_client_examples/notebook.ipynb) to showcase how to use the Llama Stack client with AgentOps.

<script type="module" src="/scripts/github_stars.js" />

<script type="module" src="/scripts/link_to_api_button.js" />

<script type="module" src="/scripts/scroll-img-fadein-animation.js" />

<script type="module" src="/scripts/button_heartbeat_animation.js" />

<script type="css" src="/styles/styles.css" />

<script type="module" src="/scripts/adjust_api_dynamically.js" />
