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.
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.
Next, test the model inference in the following way:
Here’s the response we received from the model endpoint we just made at TIR.
Response:
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.