{"id":99,"date":"2021-11-16T07:42:20","date_gmt":"2021-11-16T07:42:20","guid":{"rendered":"http:\/\/muenter.informatik.rwth-aachen.de\/dbis\/?page_id=99"},"modified":"2024-10-14T15:19:01","modified_gmt":"2024-10-14T13:19:01","slug":"resources","status":"publish","type":"page","link":"https:\/\/dbis.rwth-aachen.de\/dbis\/index.php\/research\/resources\/","title":{"rendered":"Resources"},"content":{"rendered":"\n<p>This document provides an overview of how to access and utilize resources for LLMs at DBIS or at RWTH Aachen University.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>RWTH Azure OpenAI<\/li>\n\n\n\n<li>RWTH HPC Cluster<\/li>\n\n\n\n<li>DBIS Warhol Server<\/li>\n\n\n\n<li>DBIS Corinth Server<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">RWTH Azure OpenAI<\/h2>\n\n\n\n<p>To request access to RWTH Azure OpenAI, you need to estimate the cost.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>To estimate the number of tokens you are using in a request, you can use the <a href=\"https:\/\/github.com\/openai\/openai-cookbook\/blob\/db3144982aa26b87a9bdfb692b4fbedfdf8a14d5\/examples\/How_to_count_tokens_with_tiktoken.ipynb\"><code>tiktoken<\/code><\/a> library, which is compatible with OpenAI models.<\/li>\n\n\n\n<li>The prices of different models are available <a href=\"https:\/\/azure.microsoft.com\/en-us\/pricing\/details\/cognitive-services\/openai-service\">online<\/a>. Please choose &#8220;Sweden Central&#8221; for the region.<\/li>\n\n\n\n<li>Please enter the information of the purpose to the <a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1MJkyplY1mdFioa4gSm_oidqzXw1dnVSWq6bqFEIHgIw\/edit?usp=sharing\">Google Sheet<\/a>, and then write an email to <a href=\"mou@dbis.rwth-aachen.de\" data-type=\"link\" data-id=\"mou@dbis.rwth-aachen.de\">Yongli Mou<\/a>. <\/li>\n<\/ol>\n\n\n\n<p>Endpoint: <a href=\"https:\/\/gpt-dbis.openai.azure.com\/\">https:\/\/gpt-dbis.openai.azure.com\/<\/a> <\/p>\n\n\n\n<p>The following models are deployed on RWTH Azure<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>GPT-3.5-turbo\n<ul class=\"wp-block-list\">\n<li>Deploy name: gpt-3.5-turbo<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>GPT-3.5-turbo-instruct<\/li>\n\n\n\n<li>GPT-4<\/li>\n\n\n\n<li>GPT-4o<\/li>\n\n\n\n<li>GPT-4o-mini<\/li>\n\n\n\n<li>Text-embedding-3-large<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><code>import os\nimport requests<\/code>import base64\nAZURE_OPENAI_API_KEY = \"YOUR_API_KEY\"\nIMAGE_PATH = \"YOUR_IMAGE_PATH\"\nencoded_image = base64.b64encode(open(IMAGE_PATH, 'rb').read()).decode('ascii')\nheaders = {\n    \"Content-Type\": \"application\/json\",\n    \"api-key\": AZURE_OPENAI_API_KEY,\n}\npayload = {\n  \"messages\": &#91;\n    {\n      \"role\": \"system\",\n      \"content\": &#91;\n        {\n          \"type\": \"text\",\n          \"text\": \"You are an AI assistant that helps people find information.\"\n        }\n      ]\n    },\n    {\n      \"role\": \"user\",\n      \"content\": &#91;\n        {\n          \"type\": \"text\",\n          \"text\": \"What'\\''s in this image?\"\n        },\n        {\n          \"type\": \"image_url\",\n          \"image_url\": {\n              \"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\"\n           }\n         }\n       ],\n\n  ],\n  \"temperature\": 0.7,\n  \"top_p\": 0.95,\n  \"max_tokens\": 800\n}\n\nENDPOINT = \"https:\/\/gpt-dbis.openai.azure.com\/openai\/deployments\/gpt-4o-mini\/chat\/completions?api-version=2024-02-15-preview\"\n\n# Send request\ntry:\n    response = requests.post(ENDPOINT, headers=headers, json=payload)\n    response.raise_for_status()  # Will raise an HTTPError if the HTTP request returned an unsuccessful status code\nexcept requests.RequestException as e:\n    raise SystemExit(f\"Failed to make the request. Error: {e}\")\n\n# Handle the response as needed (e.g., print or process)\nprint(response.json())print(response.json())\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This document provides an overview of how to access and utilize resources for LLMs at DBIS or at RWTH Aachen University. RWTH Azure OpenAI To request access to RWTH Azure OpenAI, you need to estimate the cost. Endpoint: https:\/\/gpt-dbis.openai.azure.com\/ The following models are deployed on RWTH Azure<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":123,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-99","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/dbis.rwth-aachen.de\/dbis\/index.php\/wp-json\/wp\/v2\/pages\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dbis.rwth-aachen.de\/dbis\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/dbis.rwth-aachen.de\/dbis\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/dbis.rwth-aachen.de\/dbis\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dbis.rwth-aachen.de\/dbis\/index.php\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":3,"href":"https:\/\/dbis.rwth-aachen.de\/dbis\/index.php\/wp-json\/wp\/v2\/pages\/99\/revisions"}],"predecessor-version":[{"id":5474,"href":"https:\/\/dbis.rwth-aachen.de\/dbis\/index.php\/wp-json\/wp\/v2\/pages\/99\/revisions\/5474"}],"up":[{"embeddable":true,"href":"https:\/\/dbis.rwth-aachen.de\/dbis\/index.php\/wp-json\/wp\/v2\/pages\/123"}],"wp:attachment":[{"href":"https:\/\/dbis.rwth-aachen.de\/dbis\/index.php\/wp-json\/wp\/v2\/media?parent=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}