Step-by-Step Guide to Deploying and Using Llama 3 LLMs on TIR AI Studio

April 2, 2025

Table of Contents

The Llama 3 series of LLMs is being increasingly adopted by companies looking to build data-sovereign AI APIs, workflows, and applications on their cloud infrastructure. The latest models in the series, Llama 3.2-11B and Llama 3.2-90B, also incorporate vision capabilities and are multimodal. This means you can use them to build AI solutions that need to reason over both text and images in combination. Examples include invoice parsing and processing, document understanding, infographic explainers, and more.

There are multiple ways to use the Llama 3 series models, including Llama 3.2. You can deploy them using Ollama on an advanced cloud GPU on E2E Cloud, or you can use vLLM, which offers you more control.

However, the easiest approach is to use TIR AI Studio, where you can deploy the Llama 3 series of LLMs without the help of a DevOps engineer, and get going in less than 10 minutes. The biggest advantage to this approach is that you can use the cutting-edge cloud GPUs on E2E Cloud and get extreme performance out of your AI model. 

In this article, we will walk you through the steps to deploy and use the Llama 3 series on TIR. We will also show you how to query the endpoint, so that you can integrate it easily and build AI applications that are production ready. 

Let’s get started! 

Understanding the Llama 3 Series of LLMs

The Llama 3 series, including Llama 3.1, Llama 3.2 (11B and 90B), and the original Llama 3, bring several architectural improvements that optimize both inference and fine-tuning for developers working with diverse computational resources. Let’s first take a quick look at them. We will skip the original Llama 3, as it has been replaced by Llama 3.1 and Llama 3.2. 

Llama 3.1 Series

The Llama 3.1 series introduced several powerful enhancements over its previous versions. Notably, it offered an expanded context length of up to 128,000 tokens, allowing it to manage longer inputs and maintain coherence over extended text generation. This feature is critical for applications where you need in-depth conversations, long-form summarization, and detailed content creation.

Llama 3.1 variants come in different sizes, such as 8B, 70B, and the massive 405B, with each variant optimized for various tasks like zero-shot learning, fine-tuning, and multi-modal applications. For developers, these models are available for deployment via platforms like E2E Cloud and TIR, and they support efficient inference through 8-bit quantization, significantly reducing computational demands during deployment​

The Llama 3.1 models also support multilingual tasks, covering eight languages, which makes it versatile for global applications. The largest model in the series, the 405B parameter variant, is one of the most advanced open-source models available today, capable of high-level reasoning, coding, and tool usage.

Llama 3.2 Series

The recently launched Llama 3.2 introduced significant advancements over its predecessors, primarily through its multimodal and vision capabilities. 

This series includes the 11B and 90B Vision Instruct models, designed to integrate both image and text inputs. These models enable complex image reasoning tasks, such as visual question answering, chart interpretation, and document visual analysis, positioning Llama 3.2 as a huge step up on other platform models like GPT-4 and Claude on multimodal benchmarks. 

This is the best-in-class model you can use if you want to incorporate multimodality into your AI. Similar to the previous Llama models, they also feature 128K-token context windows and multilingual features.

Understanding TIR AI Studio

TIR AI Studio is a powerful AI/ML development platform designed to streamline the training, deployment, and management of large AI models. It provides users with access to high-performance GPU containers and pre-configured environments for frameworks like PyTorch, TensorFlow, and Triton. The platform includes an easy-to-use Jupyter Notebook interface.

TIR also supports end-to-end pipelines for training and deployment, enabling users to handle the entire model lifecycle, from data ingestion to inference. It integrates with popular tools such as Qdrant and PGVector for building RAG applications, making it a comprehensive solution for both research and production environments.

Using Llama 3 on TIR

To start with, first sign up or sign in to TIR. Once that’s done, on the left sidebar, click on Model Endpoints. 

Step 1: Select Endpoint

Then click on the CREATE ENDPOINT button as shown below. 

Next, you need to select the right model endpoint. You will have options for Llama 3.2, Llama 3.1 and Llama 3. 

Alternatively, you can choose the vLLM option as well, and then select any model you want that vLLM supports. 

Step 2: Download the Model and Launch

To simplify things, you can simply select ‘Download from Hugging Face’ as the option.  

You’ll need to add your hf_token from Hugging Face for this step. We will assume that you have applied for access to the Llama 3.2 or Llama 3.1 model of your choosing already. 

Provide the token below. 

 

You will also need to choose the GPU node. You will have to select this based on the number of parameters your model has. We will choose the Llama 3.1-8B with the L4 series of cloud GPUs.

__wf_reserved_inherit

Once that’s done, select the Plan Details. You should select a minimum 30GB disk replica size (however, we recommend a minimum 100GB, if you are going to train the model). 

Finally, you can set up the environment variables if required. 

You can now launch the endpoint. 

Step 3: Verify Endpoint

Verify if the endpoint is working. Check the list of endpoints here: 

Now, confirm if your model endpoint is working. You can look at the logs of the endpoint you created.

Step 4: Generate Your API_TOKEN

Now, you will need to generate the API token for accessing the model from your application. To do that, create a token. 

Once created, you’ll be able to see the list of API Tokens containing the API Key and Auth Token. You will need this Auth Token in the next step.

You will need the following that you can save and create environment variables out of: 

  • Base Endpoint URL
  • Auth Token

Step 5: Model Inference

We now have a running model endpoint and an API token to access it. How do you use it in your notebook or code? 

Since the model endpoint is compatible with the OpenAI client Python library, you can create a virtual environment and install the client. 


!pip install -q openai

Next, test the model inference in the following way: 


import openai

token = os.getenv("AUTH_TOKEN_FROM_API_TOKEN_SECTION")   # You can get auth token from API Token section on TIR Dashboard

openai.api_key = token
openai.base_url = ""

completion = openai.chat.completions.create(
    model="meta-llama/Meta-Llama-3-8B-Instruct",
    messages=[
        {
            "role": "user",
            "content": "Explain LLMs?",
        },
    ],
     
)
print(completion.choices[0].message.content)

Here’s the response we received from the model endpoint we just made at TIR.

Response: 


LLMs stand for Large Language Models, which are a type of artificial intelligence (AI) model specifically designed to process and generate human-like language. These models have revolutionized the field of natural language processing (NLP) and have many applications in various industries.

Here's a brief overview:

**What are LLMs?**

LLMs are neural network-based models that are trained on large amounts of text data, typically in the form of books, articles, websites, and other digital content. The goal is to learn patterns, relationships, and structures within language, enabling the model to generate text that is coherent, natural-sounding, and often indistinguishable from human-written text.

**How do LLMs work?**

LLMs are typically trained using a combination of supervised and unsupervised learning techniques. Supervised learning involves feeding the model labeled data, such as text with corresponding meanings or tasks (e.g., classification, sentiment analysis). Unsupervised learning involves training the model on large amounts of unlabeled data to learn patterns and relationships within the language.

The training process typically involves the following steps:

1. **Text Preprocessing**: The text data is cleaned, tokenized, and converted into a numerical representation.
2. **Model Architecture**: The LLM is designed using a specific architecture, such as transformer-based models (e.g., BERT, RoBERTa) or recurrent neural networks (RNNs).
3. **Training**: The model is trained on the preprocessed text data, using techniques like masked language modeling, next sentence prediction, and sentiment analysis.
4. **Fine-tuning**: The trained model is fine-tuned for specific tasks, such as text classification, language translation, or text generation.

**Applications of LLMs**

LLMs have numerous applications across industries, including:

1. **Natural Language Processing (NLP)**: LLMs can be used for tasks like text classification, sentiment analysis, entity recognition, and language translation.
2. **Chatbots and Virtual Assistants**: LLMs can be used to power chatbots and virtual assistants, enabling them to understand and respond to user queries.
3. **Language Translation**: LLMs can be used for machine translation, enabling the translation of text from one language to another.
4. **Content Generation**: LLMs can be used to generate content, such as articles, blog posts, or social media posts, reducing the need for human writers.
5. **Question Answering**: LLMs can be used to answer questions, providing accurate and relevant information.
6. **Language Understanding**: LLMs can be used to analyze and understand human language, enabling applications like sentiment analysis, topic modeling, and text summarization.

**Challenges and Limitations**

While LLMs have achieved remarkable success, they also face challenges and limitations, including:

1. **Data Quality**: The quality of the training data can significantly impact the model's performance.
2. **Domain Adaptation**: LLMs may struggle to generalize to new domains or topics that are outside the scope of their training data.
3. **Language Understanding**: LLMs may not fully understand the nuances of human language, leading to errors in interpretation.
4. **Explainability**: LLMs may not provide clear explanations for their decisions or outputs, making it challenging to understand their reasoning.

Overall, LLMs have revolutionized the field of NLP, enabling applications that were previously unimaginable. However, there are still challenges and limitations to be addressed, and ongoing research is focused on improving the performance, robustness, and explainability of these models.

That’s it! You can now use the Llama 3 series to build applications. Throughout the entire process of launching the LLM, there was no need for any system administration or coding. The best part is that it’s backed by a powerful L4 cloud GPU, all at a fraction of the cost compared to other hyperscalers

Conclusion

TIR AI Studio simplifies the process of deploying and using large language models (LLMs). Backed by powerful yet affordable cloud GPUs, the platform allows you to easily build production-grade AI applications.

Sign up today and start building. 

Latest Blogs

A vector illustration of a tech city using latest cloud technologies & infrastructure