!GroqAPI
This repository contains code and examples related to integrating the Groq API into your applications. Groq provides fast and efficient language model inference, making it ideal for AI applications that require low latency.
-
What is Groq?: Groq is a platform that delivers exceptional compute speed, quality, and energy efficiency for AI inference.
-
Why Groq?: If you care about fast inference and want to leverage state-of-the-art large language models (LLMs), Groq is a great choice.
-
Getting Started: Follow the steps below to start using Groq:
-
Create an API Key: Visit here to create an API key.
-
Set Up Your API Key: Configure your API key as an environment variable:
export GROQ_API_KEY=<your-api-key-here>
-
Request a Chat Completion: Use the Groq Python library to perform a chat completion:
import os from groq import Groq client = Groq(api_key=os.environ.get("GROQ_API_KEY")) chat_completion = client.chat.completions.create( messages=[ {"role": "user", "content": "Explain the importance of fast language models."} ], model="llama3-8b-8192", ) print(chat_completion.choices[0].message.content)
-
Explore Other Endpoints: Now that you've received a chat completion, check out other endpoints in the API.
-
- GroqCloud Documentation: Explore more features and examples.
- Groq API Cookbook: Add your own how-to guides and share with the community.
This project is licensed under the MIT License - see the LICENSE file for details.