examples/provider-replicate/comprehensive/README.md
You can run this example with:
npx promptfoo@latest init --example provider-replicate/comprehensive
cd provider-replicate/comprehensive
This example demonstrates the full capabilities of the Replicate provider in promptfoo, including text generation and image generation.
This example requires:
REPLICATE_API_TOKEN - Your Replicate API key (get one at https://replicate.com/account/api-tokens)Set this in your environment:
export REPLICATE_API_TOKEN=r8_your_api_token_here
Set your Replicate API token:
export REPLICATE_API_TOKEN=your_token_here
Run the evaluation:
promptfoo eval
View the results:
promptfoo view
providers:
- id: replicate:meta/meta-llama-3-8b-instruct
config:
temperature: 0.5 # Balanced creativity
max_new_tokens: 200 # Limit response length
The example uses various assertion types:
contains-any: Checks for specific keywordsjavascript: Custom validation logicis-valid-openai-image-generation-response: Validates image URLsTry Different Models:
replicate:meta/meta-llama-3-70b-instruct (larger, more capable)replicate:image:playgroundai/playground-v2.5-1024px-aestheticAdjust Parameters:
temperature for more creative outputsnum_inference_steps for quality vs speed tradeoffAdd More Tests: