Run LLM Providers with Promptfoo
Promptfoo example comparing two fal.ai image generation models side by side across 7 creative prompts.
Why it matters
Integrate and execute language models from various providers using the Promptfoo framework. This asset allows for streamlined testing and comparison of different LLM outputs.
Outcomes
What it gets done
Configure and run LLM provider integrations.
Execute prompt chains against selected providers.
Extract and summarize results from LLM interactions.
Generate code based on LLM outputs.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/pfoo-provider-fal | bash Steps
Steps in the chain
Overview
Provider Fal
A promptfoo example comparing two fal.ai image generation models side by side across 7 creative prompts with fixed seeds for reproducibility. Use when comparing fal.ai image generation models on quality, settings, and performance before choosing one for production.
What it does
This example demonstrates how to evaluate and compare image generation models using promptfoo via fal.ai. It compares two different fal.ai models side by side across 7 creative test-case prompts spanning artistic styles, uses fixed seeds for reproducible outputs, and applies different configuration settings per model. The evaluation produces a comparison table showing model performance across prompts, generated images rendered in markdown format, and execution time/caching behavior.
When to use - and when NOT to
Use this example when you need to compare image generation quality, settings, and performance across fal.ai models before choosing one for a product feature. It is not a fal.ai account or model-catalog guide beyond what's needed to run the comparison - it assumes an existing fal.ai API key and only documents the promptfoo-side eval wiring.
Inputs and outputs
Get an API key from the fal.ai dashboard, set it as FAL_KEY, and install the client:
npx promptfoo@latest init --example provider-fal
cd provider-fal
export FAL_KEY=your-fal-key-here
npm install @fal-ai/client
Run with promptfoo eval and view results with promptfoo view, which opens the web interface to browse generated images and compare model outputs. Edit promptfooconfig.yaml to try different models from fal.ai's model catalog, add custom prompts, adjust model parameters, add output-quality assertions, or route SDK requests through a proxy via config.client.proxyUrl where required.
Integrations
Integrates fal.ai's image generation API (via the @fal-ai/client npm package) as a promptfoo provider, comparing multiple fal.ai models within one eval config, with an optional proxy setting for restricted network environments.
Who it's for
Teams evaluating fal.ai image generation models who need a reproducible, side-by-side comparison of output quality, settings, and performance before selecting a model for production use.
Source README
provider-fal (fal.ai Image Generation Example)
You can run this example with:
npx promptfoo@latest init --example provider-fal
cd provider-fal
Demonstrates how to evaluate and compare image generation models using promptfoo.
Setup
- Get your API key from fal.ai dashboard
- Set environment variable:
export FAL_KEY=your-fal-key-here - Install client:
npm install @fal-ai/client - Run the evaluation:
promptfoo eval
What This Example Shows
- Model comparison: Two different fal.ai models side-by-side
- Creative prompts: 7 test cases with artistic styles
- Reproducible results: Fixed seeds for consistent outputs
- Configuration options: Different settings per model
Example Output
The evaluation generates a comparison table showing:
- Model performance across different prompts
- Generated images in markdown format
- Execution time and caching behavior
View Results
promptfoo view
Opens the web interface to browse generated images and compare model outputs.
Customize the Example
Edit promptfooconfig.yaml to:
- Try different models from fal.ai/models
- Add your own prompts
- Adjust model parameters
- Add assertions to test output quality
- Route SDK requests through a proxy with
config.client.proxyUrlwhen your environment requires it
Documentation
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.