Generative AI Examples

Introduction

GenAIExamples are designed to give developers an easy entry into generative AI, featuring microservice-based samples that simplify the processes of deploying, testing, and scaling GenAI applications. All examples are fully compatible with both Docker and Kubernetes, supporting a wide range of hardware platforms such as Gaudi, Xeon, NVIDIA GPUs, and other hardwares including AMD GPUs, ensuring flexibility and efficiency for your GenAI adoption.

Architecture

GenAIComps is a service-based tool that includes microservice components such as llm, embedding, reranking, and so on. Using these components, various examples in GenAIExample can be constructed including ChatQnA, DocSum, etc.

GenAIInfra is part of the OPEA containerization and cloud-native suite and enables quick and efficient deployment of GenAIExamples in the cloud.

GenAIEval measures service performance metrics such as throughput, latency, and accuracy for GenAIExamples. This feature helps users compare performance across various hardware configurations easily.

Use Cases

Below are some highlighted GenAI use cases across various application scenarios:

Scenario

Use Case

Question Answering

ChatQnA ✨: Chatbot with Retrieval Augmented Generation (RAG).
VisualQnA ✨: Visual Question-answering.

Image Generation

Text2Image ✨: Text-to-image generation.

Content Summarization

DocSum: Document Summarization Application.

Code Generation

CodeGen: Gen-AI Powered Code Generator.

Information Retrieval

DocIndexRetriever: Document Retrieval with Retrieval Augmented Generation (RAG).

Fine-tuning

InstructionTuning: Application of Instruction Tuning.

For the full list of the available use cases and their supported deployment type, please refer here.

Documentation

The GenAIExamples documentation contains a comprehensive guide on all available examples including architecture, deployment guides, and more. Information on GenAIComps, GenAIInfra, and GenAIEval can also be found there.

Getting Started

GenAIExamples offers flexible deployment options that cater to different user needs, enabling efficient use and deployment in various environments. Three primary methods are presently used to do this: Python startup, Docker Compose, and Kubernetes.

Users can choose the most suitable approach based on ease of setup, scalability needs, and the environment in which they are operating.

Deployment Guide

Deployment is based on released docker images by default - check docker image list for detailed information. You can also build your own images following instructions.

Prerequisite

  • For Docker Compose-based deployment, you should have docker compose installed. Refer to docker compose install for more information.

  • For Kubernetes-based deployment, you can use Helm or GMC-based deployment.

    • You should have a kubernetes cluster ready for use. If not, you can refer to k8s install to deploy one.

    • (Optional) You should have Helm (version >= 3.15) installed if you want to deploy with Helm Charts. Refer to the Helm Installation Guide for more information.

    • (Optional) You should have GMC installed to your kubernetes cluster if you want to try with GMC. Refer to GMC install for more information.

  • Recommended Hardware Reference

    Based on different deployment model sizes and performance requirements, you may choose different hardware platforms or cloud instances. Here are some of the reference platforms:

    Use Case

    Deployment model

    Reference Configuration

    Hardware access/instances

    Xeon

    Intel/neural-chat-7b-v3-3

    64 vCPUs, 365 GB disk 100 GB RAM, and Ubuntu 24.04

    visit the [Intel Tiber Developer Cloud].

    Gaudi

    Intel/neural-chat-7b-v3-3

    1 or 2 Gaudi Card, 16vCPUs, 365 GB disk 100 GB RAM, and Ubuntu 24.04

    visit the [Intel Tiber Developer Cloud].

    Xeon

    Intel/neural-chat-7b-v3-3

    64 vCPUs, 100 GB disk 64 GB RAM, and Ubuntu 24.04

    AWS Cloud/c7i.16xlarge

Deploy Examples

Note: Check for sample guides first for your use case. If it is not available, then refer to the table below:

Use Case

Docker Compose
Deployment on Xeon

Docker Compose
Deployment on Gaudi

Docker Compose
Deployment on ROCm

Kubernetes with Helm Charts

Kubernetes with GMC

ChatQnA

Xeon Instructions

Gaudi Instructions

ROCm Instructions

ChatQnA with Helm Charts

ChatQnA with GMC

CodeGen

Xeon Instructions

Gaudi Instructions

ROCm Instructions

CodeGen with Helm Charts

CodeGen with GMC

CodeTrans

Xeon Instructions

Gaudi Instructions

ROCm Instructions

CodeTrans with Helm Charts

CodeTrans with GMC

DocSum

Xeon Instructions

Gaudi Instructions

ROCm Instructions

DocSum with Helm Charts

DocSum with GMC

SearchQnA

Xeon Instructions

Gaudi Instructions

Not Supported

SearchQnA with Helm Charts

SearchQnA with GMC

Translation

Xeon Instructions

Gaudi Instructions

ROCm Instructions

Not Supported

Translation with GMC

AudioQnA

Xeon Instructions

Gaudi Instructions

ROCm Instructions

AudioQnA with Helm Charts

AudioQnA with GMC

VisualQnA

Xeon Instructions

Gaudi Instructions

ROCm Instructions

VisualQnA with Helm Charts

VisualQnA with GMC

MultimodalQnA

Xeon Instructions

Gaudi Instructions

ROCm Instructions

Not supported

Not supported

ProductivitySuite

Xeon Instructions

Not Supported

Not Supported

Not Supported

Not Supported

Text2Image

Xeon Instructions

Gaudi Instructions

Not Supported

Text2Image with Helm Charts

Not Supported

Supported Examples

Check here for detailed information of supported examples, models, hardwares, etc.

Contributing to OPEA

Welcome to the OPEA open-source community! We are thrilled to have you here and excited about the potential contributions you can bring to the OPEA platform. Whether you are fixing bugs, adding new GenAI components, improving documentation, or sharing your unique use cases, your contributions are invaluable.

Together, we can make OPEA the go-to platform for enterprise AI solutions. Let’s work together to push the boundaries of what’s possible and create a future where AI is accessible, efficient, and impactful for everyone.

Please check the Contributing guidelines for a detailed guide on how to contribute a GenAI component and all the ways you can contribute!

Thank you for being a part of this journey. We can’t wait to see what we can achieve together!

Additional Content