Gradio is a powerful library for creating web interfaces for your applications that enables you to quickly build interactive demos for your fast Groq apps with features such as:
pip install groq-gradio
export GROQ_API_KEY="your-groq-api-key"
The following code creates a simple chat interface with llama-3.3-70b-versatile
that includes a clean UI.
import gradio as gr
import groq_gradio
import os
# Initialize Groq client
client = Groq(
api_key=os.environ.get("GROQ_API_KEY")
)
gr.load(
name='llama-3.3-70b-versatile', # The specific model powered by Groq to use
src=groq_gradio.registry, # Tells Gradio to use our custom interface registry as the source
title='Groq-Gradio Integration', # The title shown at the top of our UI
description="Chat with the Llama 3.3 70B model powered by Groq.", # Subtitle
examples=["Explain quantum gravity to a 5-year old.", "How many R are there in the word Strawberry?"] # Pre-written prompts users can click to try
).launch() # Creates and starts the web server!
Challenge: Enhance the above example to create a multi-modal chatbot that leverages text, audio, and vision models powered by Groq and displayed on a customized UI built with Gradio blocks!
For more information on building robust applications with Gradio and Groq, see: