Groq API Interaction Examples

This repository contains examples demonstrating how to interact with the Groq API using Node.js. Each example is based on a tutorial from a YouTube video that guides you through the process of setting up and making the most of Groq's inference API, the OpenAI SDK, Langchain, Llama Index, and Vercel AI SDK.

Tutorial Video

For a step-by-step guide, watch the tutorial on YouTube that walks you through each example: YouTube Video Link

Prerequisites

Before you begin, make sure you have the following installed:

  • Node.js / Bun

You'll also need API keys from:

Getting Started

To get started with the examples, clone this repository to your local machine:

git clone [[repository-url]](https://github.com/developersdigest/Groq-API-Quick-Guide-with-Examples-Groq-SDK-Langchain-LlamaIndex-OpenAI-SDK-Vercel)
cd [Groq-API-Quick-Guide-with-Examples-Groq-SDK-Langchain-LlamaIndex-OpenAI-SDK-Vercel]

Install the required dependencies for each example:

cd 1-groq-sdk
bun install

Examples

The repository is structured with separate directories for each example, as outlined below:

1. Groq SDK Example

Located in 1-groq-sdk. This example covers the basics of setting up and using the Groq SDK.

2. OpenAI SDK Example

Located in 2-openai-sdk. This example demonstrates how to utilize the OpenAI SDK in conjunction with Groq.

3. Langchain Integration

Located in 3-langchain. Here, we show how to integrate Langchain with the Groq API.

4. Llama Index Usage

Located in 4-llamaindex. Explore how to use Llamaindex to enhance your applications with Groq.

5. Vercel AI SDK Example

Located in 5-vercel-ai-sdk. Learn to set up and use the Vercel AI SDK with Groq.

Documentation

For more detailed information about the Groq API and related SDKs, refer to the following resources: