Categories
Pages
-

DBIS

Resources

This document provides an overview of how to access and utilize resources for LLMs at DBIS or at RWTH Aachen University.

  • RWTH Azure OpenAI
  • RWTH HPC Cluster
  • DBIS Warhol Server
  • DBIS Corinth Server

RWTH Azure OpenAI

To request access to RWTH Azure OpenAI, you need to estimate the cost.

  1. To estimate the number of tokens you are using in a request, you can use the tiktoken library, which is compatible with OpenAI models.
  2. The prices of different models are available online. Please choose “Sweden Central” for the region.
  3. Please enter the information of the purpose to the Google Sheet, and then write an email to Yongli Mou.

Endpoint: https://gpt-dbis.openai.azure.com/

The following models are deployed on RWTH Azure

  • GPT-3.5-turbo
    • Deploy name: gpt-3.5-turbo
  • GPT-3.5-turbo-instruct
  • GPT-4
  • GPT-4o
  • GPT-4o-mini
  • Text-embedding-3-large
import os
import requestsimport base64
AZURE_OPENAI_API_KEY = "YOUR_API_KEY"
IMAGE_PATH = "YOUR_IMAGE_PATH"
encoded_image = base64.b64encode(open(IMAGE_PATH, 'rb').read()).decode('ascii')
headers = {
    "Content-Type": "application/json",
    "api-key": AZURE_OPENAI_API_KEY,
}
payload = {
  "messages": [
    {
      "role": "system",
      "content": [
        {
          "type": "text",
          "text": "You are an AI assistant that helps people find information."
        }
      ]
    },
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "What'\''s in this image?"
        },
        {
          "type": "image_url",
          "image_url": {
              "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
           }
         }
       ],

  ],
  "temperature": 0.7,
  "top_p": 0.95,
  "max_tokens": 800
}

ENDPOINT = "https://gpt-dbis.openai.azure.com/openai/deployments/gpt-4o-mini/chat/completions?api-version=2024-02-15-preview"

# Send request
try:
    response = requests.post(ENDPOINT, headers=headers, json=payload)
    response.raise_for_status()  # Will raise an HTTPError if the HTTP request returned an unsuccessful status code
except requests.RequestException as e:
    raise SystemExit(f"Failed to make the request. Error: {e}")

# Handle the response as needed (e.g., print or process)
print(response.json())print(response.json())