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

# IBM watsonx

> Learn how to integrate IBM watsonx with HoneyHive

export const integrationType_1 = "IBM watsonx"

export const integrationType_0 = "IBM watsonx"

IBM watsonx is a comprehensive, integrated AI platform designed to facilitate end-to-end AI application development. It provides access to a diverse range of enterprise-grade models that are not only performant and trusted but also cost-effective. Users can leverage IBM Granite models, select open-source models from Hugging Face, third-party models from strategic partners, and even custom foundation models, making it a versatile solution for various AI needs.

With HoneyHive, you can trace all your {integrationType_0} operations using a single line of code. Find a list of all supported integrations [here](/introduction/troubleshooting#latest-package-versions-tested).

## HoneyHive Setup

Follow the [HoneyHive Installation Guide](/integrations/integration-prereqs) to get your API key and initialize the tracer.

## watsonx Setup

Go to your Profile in [IBM Cloud](https://cloud.ibm.com/iam/apikeys) to get your IBM watsonx IAM API key. Then, go to your Project and get your IBM project ID, which is a UUID.

## Example

Here is an example of how to trace your {integrationType_1} code in HoneyHive.

<CodeGroup>
  ```python Python theme={null}
  from ibm_watson_machine_learning.foundation_models import Model
  from honeyhive import HoneyHiveTracer

  HoneyHiveTracer.init(
      api_key="MY_HONEYHIVE_API_KEY",
      project='MY_HONEYHIVE_PROJECT_NAME',
  )


  def get_credentials():
      return {
          "url": "https://us-south.ml.cloud.ibm.com", # or another region
          "apikey": "MY_IBM_IAM_API_KEY",
      }

  model_id = "ibm/granite-3-2b-instruct"
  parameters = {
      "decoding_method": "sample",
      "max_new_tokens": 60,
      "min_new_tokens": 10,
      "random_seed": 42,
      "temperature": 0.9,
      "top_k": 50,
      "top_p": 1,
      "repetition_penalty": 2
  }

  model = Model(
      model_id=model_id,
      params=parameters,
      credentials=get_credentials(),
      project_id="MY_IBM_PROJECT_ID",
  )

  prompt_input = "Which IBM model beat Gary Kasparov in chess?"
  generated_response = model.generate(prompt=prompt_input)

  print(generated_response['results'][0]['generated_text'])
  ```
</CodeGroup>

## View your Traces

Once you run your code, you can view your execution trace in the HoneyHive UI by clicking the `Log Store` tab on the left sidebar.
