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

# Weave integration guide

[Weights & Biases (W\&B) Weave](https://weave-docs.wandb.ai/) is a framework for tracking, experimenting with, evaluating, deploying, and improving LLM-based applications. Designed for flexibility and scalability, Weave supports every stage of your LLM application development workflow.

<Info>
  The SambaNova Weave integration setup is detailed in the [weave integration repository](https://github.com/sambanova/integrations/tree/main/weave).
</Info>

## Prerequisites

* A [SambaCloud account](https://cloud.sambanova.ai/?utm_source=weave\&utm_medium=external\&utm_campaign=cloud_signup) and API key
* [Weights & Biases account](https://wandb.ai/) and API key
* Python 3.10 or later
* [Jupyter](https://jupyter.org/install) (to run the example notebook)

## Setup

<Steps>
  <Step title="Install required packages">
    ```bash theme={}
    pip install weave langchain-sambanova litellm openai python-dotenv
    ```
  </Step>

  <Step title="Set your API keys">
    ```bash theme={}
    export SAMBANOVA_API_KEY="your-sambanova-key"
    export WANDB_API_KEY="your-wandb-key"
    export SAMBANOVA_URL="https://api.sambanova.ai/v1"
    ```

    <Note>
      `SAMBANOVA_URL` is required by the notebook's OpenAI SDK connector. Without it,
      the OpenAI client falls back to its own default endpoint and your SambaNova key
      is rejected.
    </Note>
  </Step>

  <Step title="Download and run the example notebook">
    Download the [Weave@SambaNova notebook](https://github.com/sambanova/integrations/blob/main/weave/Weave%40SambaNova.ipynb) and launch it with Jupyter:

    ```bash theme={}
    curl -L -o 'Weave@SambaNova.ipynb' \
      https://raw.githubusercontent.com/sambanova/integrations/main/weave/Weave%40SambaNova.ipynb
    jupyter notebook Weave@SambaNova.ipynb
    ```

    The notebook demonstrates three connectors:

    * SambaNova LangChain chat object
    * LiteLLM
    * OpenAI SDK
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="SAMBANOVA_API_KEY not set or authentication error">
    * Verify the key is exported: `echo "${SAMBANOVA_API_KEY:0:10}..."`
    * Regenerate your key in the [SambaCloud portal](https://cloud.sambanova.ai/apis?utm_source=weave\&utm_medium=external\&utm_campaign=cloud_signup)
    * Re-export and restart your terminal or notebook kernel
  </Accordion>

  <Accordion title="WANDB_API_KEY not set or W&B authentication error">
    * Verify the key is exported: `echo "${WANDB_API_KEY:0:10}..."`
    * Retrieve your key from the [W\&B settings page](https://wandb.ai/settings)
    * Re-export and restart your terminal or notebook kernel
  </Accordion>

  <Accordion title="Jupyter not found">
    * Install Jupyter: `pip install jupyter`
    * Or run the notebook with: `pip install jupyterlab && jupyter lab`
  </Accordion>
</AccordionGroup>
