Prompt Chain

Query Groq with Promptfoo

Promptfoo example workflow demonstrating how to configure and evaluate prompts using the Groq AI provider with environment-based API key authentication.

Works with groqpromptfoo

75
Spark score
out of 100
Updated 10 days ago
Version 0.121.19

Add to Favorites

Why it matters

Integrate with the Groq API using promptfoo to execute and evaluate LLM prompts. This asset demonstrates how to leverage promptfoo's capabilities for testing and managing LLM interactions with a specific provider.

Outcomes

What it gets done

01

Configure promptfoo to use the Groq provider.

02

Define and execute prompt chains against the Groq API.

03

Analyze and compare the outputs from different prompts.

04

Facilitate data extraction and summarization from LLM responses.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/pfoo-provider-groq | bash

Steps

Steps in the chain

01
Set GROQ_API_KEY environment variable
02
Edit promptfooconfig.yaml
03
Run prompt evaluation
04
View results

Overview

Provider Groq

This is a reference example that demonstrates how to integrate Groq as an AI provider within the Promptfoo prompt evaluation framework. It includes the necessary configuration files, environment setup instructions, and command-line workflows to run prompt evaluations against Groq's inference API. Use this example when you need to set up Groq provider integration in Promptfoo for the first time, or when you want a working reference for configuring API authentication and evaluation workflows with Groq's infrastructure.

What it does

This prompt chain provides a working example configuration for integrating Groq as an AI provider within the Promptfoo evaluation framework. It demonstrates the setup process, environment variable configuration, and evaluation workflow needed to test prompts against Groq's inference API.

When to use - and when NOT to

Use this example when you need to set up Groq as your LLM provider in Promptfoo for the first time, when migrating existing prompt evaluations to Groq's infrastructure, or when you want a reference implementation for Groq provider configuration.

Inputs and outputs

You provide a GROQ_API_KEY environment variable for authentication and edit the promptfooconfig.yaml file to define your prompt evaluation parameters. The workflow outputs evaluation results that can be viewed through Promptfoo's built-in viewer interface after running the evaluation command.

Integrations

This example integrates Groq's AI inference API with the Promptfoo prompt evaluation framework. It uses Promptfoo's provider system to route evaluation requests to Groq's endpoints.

Who it's for

This asset serves developers and prompt engineers who want to evaluate LLM prompts using Groq's infrastructure.

Quick start

Initialize the example with:

npx promptfoo@latest init --example provider-groq
cd provider-groq

Set your Groq API key as an environment variable, edit the promptfooconfig.yaml file with your prompt configurations, then run:

promptfoo eval

After evaluation completes, view results by running promptfoo view to launch the interactive results viewer.

Source README

provider-groq (Groq)

You can run this example with:

npx promptfoo@latest init --example provider-groq
cd provider-groq

Usage

To get started, set your GROQ_API_KEY environment variable.

Next, edit promptfooconfig.yaml.

Then run:

promptfoo eval

Afterwards, you can view the results by running promptfoo view

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.