Here is a step-by-step guide on using GenAI API models.

Introduction

A GenAI API is an interactive and user-friendly platform to selects models,configure parameters and observe the results, designed for experimenting with machine learning AI models. It provides a space where users, including data scientists, researchers, and developers, can explore, test, and Open Source machine learning models without the need for extensive coding or infrastructure setup.

What is GenAI API?

Model Playground offers a fully managed service to access Foundation Models (Llama-2-13b-chat, Stable Diffusion 2.1, Code Llama 13b) through a single API. GenAI API offers a fully managed service to access Foundation Models (Llama-2-13b-chat, Stable Diffusion 2.1, Code Llama 13b, Whisper-large-v3, e5-mistral-7b-instruct) through a single API.

../_images/model_playground_intro1.png

TIR GenAI API AI Studio helps in two ways:

1. API based Access: Instead of having to deal with infrastructure or deployment hassles, customers will be able to directly access a ready to use, highly scalable API (provided by TIR). Customers don’t have to plan or worry about infrastructure.

../_images/model_intro2.png

2. Cost Effectiveness: Reduce the upfront investment. Instead of launching infrastructure like high end GPU machines (which generative models require), TIR supports usage based pricing. Customers pay based on API calls.

../_images/model_intro3.png

Key features of a GenAI API include:

  1. User Interface : An intuitive interface that allows users to easily upload datasets, select models, and configure parameters.

  2. Experimentation : The ability to experiment with different machine learning algorithms, architectures, and hyperparameters to understand their impact on model performance.

  3. Learning Environment : A space that facilitates learning and exploration, where users can gain hands-on experience with machine learning concepts and techniques.

How to use GenAI API?

To initiate the Model Playground process, first, the user should navigate to the sidebar section and select “Foundation Studio.” Upon selecting Foundation Studio, a dropdown menu will appear, featuring an option labeled “Model Playground”.

Upon clicking the “Model Playground” option, the user will be directed to the “Models” page.

../_images/openpage_modelplayground.png

After redirect to the “Models” of GenAI API, On this page, users can select the models.

  1. Llama-2-13b-chat

  2. Stable Diffusion 2.1

  3. Code Llama 13b

  4. Whisper-large-v3

  5. e5-mistral-7b-instruct

“Llama-2-13b-chat” model

If you select “Llama-2-13b-chat” model.

../_images/selectLlama2.png

Playground

After clicking “Llama-2-13b-chat” model, you will be redirected to playground page Form tab. In the ‘Prompt’ section, you can raise any query to Control the output of the model, fill advanced parameters and click on “GENERATE RESPONSE” button. In the ‘Preview’ section, you’ll see the output.

../_images/openpageLlama.png

Advanced Parameters You can set the advanced parameters fields and you can see the chnages on output.

../_images/Llama_advanced_parameters1.png ../_images/Llama_python.png

In HTTP tab section, you can set the environment variables and you will get the CURL.

../_images/Llama_Html.png

API

In API section, you can see the details of run the models for that you get the commands and the details of advanced parameters.

../_images/Llama_API.png

Usage

In Usage section, you can see the pricing of current month by default.you can change the interval and see the pricing according to selection.

../_images/Llama_usage.png

You can select the interval by clicking the dropdown.

../_images/Llama_selects_interval.png

You can customize the interval by selecting custom and set the “from” and “to” details.

../_images/Llama_custom.png

“Stable Diffusion 2.1” model

If you select “Stable Diffusion 2.1” model.

../_images/select_stable.png

Playground

After clicking “Stable Diffusion 2.1” model, you will be redirected to playground page ‘Form’ tab. In the ‘Prompt’ section, you can ask for any picture to Control the output of the model, fill advanced parameters and click on “GENERATE RESPONSE” button. In the ‘Preview’ section, you’ll see the picture of it on output.

../_images/open_stable.png

Advanced Parameters You can set the advanced parameters fields, click on “GENERATE RESPONSE” button and you can see the chnages on output.

../_images/stable_advanced_para.png ../_images/stable_python.png

In HTTP tab section, you can set the environment variables and you will get the CURL.

../_images/Http_stable.png

API

In API section, you can see the details of run the models for that you get the commands and the details of advanced parameters.

../_images/Stable_API.png

Usage

In Usage section, you can see the pricing of current month by default.you can change the interval and see the pricing according to selection.

../_images/Llama_usage.png

You can select the interval by clicking the dropdown.

../_images/Llama_selects_interval.png

You can customize the interval by selecting custom and set the “from” and “to” details.

../_images/Llama_custom.png

“Code Llama 13b” model

If you select “Code Llama 13b” model.

../_images/select_codelama.png

Playground

After clicking “Code Llama 13b” model, you will be redirected to playground page ‘Form’ tab. In the ‘Prompt’ section, you can query about any code to Control the output of the model, fill advanced parameters and click on “GENERATE RESPONSE”. In the ‘Preview’ section, you’ll see the output of it.

../_images/open_codelama.png

Actions You can set the actions before clicking on “GENERATE RESPONSE” button, according to selected actions you can see the output.

../_images/actions_codelama.png

Advanced Parameters You can set the advanced parameters fields click on “GENERATE RESPONSE” button and you can see the chnages on output.

../_images/codellama_advancepara.png ../_images/code_llama_python.png

In HTTP tab section, you can set the environment variables and you will get the CURL.

../_images/http_codellama.png

API

In API section, you can see the details of run the models for that you get the commands and the details of advanced parameters.

../_images/API_codellama.png

Usage

In Usage section, you can see the pricing of current month by default.you can change the interval and see the pricing according to selection.

../_images/Llama_usage.png

You can select the interval by clicking the dropdown.

../_images/Llama_selects_interval.png

You can customize the interval by selecting custom and set the “from” and “to” details.

../_images/Llama_custom.png

“Whisper-large-v3” model

If you select “Whisper-large-v3” model.

../_images/select_codelama.png

Playground

After clicking “Whisper-large-v3” model, you will be redirected to playground page ‘Form’ tab.”In the ‘Input’ section, you can start recording by clicking the ‘START RECORDING’ button. After you click the ‘START RECORDING’ button, you can stop recording at any time, and it will automatically save. Alternatively, you can upload files by clicking ‘Drop a file or click to upload.’ It accepts only .wav, .flac, and .mp3 formats of files.

../_images/start_recording.png

Stop Recording

../_images/stop_recording.png

After clicking on ‘Stop Recording’ button , you can see the file as below.

../_images/after_click_stop_recording.png

Click on Upload button.

../_images/whisper_click_upload.png

Task After uploading the file, you can select the task. Transcribe or Translate.

../_images/task.png
  • Transcribe If you select the Transcribe task, you can convert this file to any selected language. To choose a language, you can click on the language.

    ../_images/language.png
  • Translate If you select Translate task, It translate the text into english.

Advanced Parameters You can set the advanced parameters fields click on “GENERATE RESPONSE” button and you can see the chnages on output.

../_images/whisper_advancepara.png ../_images/python_whisper.png

In HTTP tab section, you can set the environment variables and you will get the CURL.

../_images/whisper_html.png

API

In API section, you can see the details of run the models for that you get the commands and the details of advanced parameters.

../_images/api_whisper.png

Usage

In Usage section, you can see the pricing of current month by default.you can change the interval and see the pricing according to selection.

../_images/Whisper_usage.png

You can select the interval by clicking the dropdown.

../_images/Whisper_selects_interval.png

You can customize the interval by selecting custom and set the “from” and “to” details.

../_images/Llama_custom.png

“e5-mistral-7b-instruct” model

If you select “e5-mistral-7b-instruct” model.

../_images/select_e5mistral.png

Playground

After clicking “Code Llama 13b” model, you will be redirected to playground page ‘Form’ tab. In the ‘Prompt’ section, you can query about any code to Control the output of the model, fill advanced parameters and click on “GENERATE RESPONSE”. In the ‘Preview’ section, you’ll see the output of it.

../_images/open_e5mistral.png ../_images/e5mistral_python.png

In HTTP tab section, you can set the environment variables and you will get the CURL.

../_images/http_e5mistral.png

API

In API section, you can see the details of run the models for that you get the commands and the details of advanced parameters.

../_images/API_e5mistral.png

Usage

In Usage section, you can see the pricing of current month by default.you can change the interval and see the pricing according to selection.

../_images/e5mistral_usage.png

You can select the interval by clicking the dropdown.

../_images/e5_mistral_interval.png

You can customize the interval by selecting custom and set the “from” and “to” details.

../_images/Llama_custom.png