Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

promptfooconfig.yaml 1.3 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. description: LiteLLM provider example - unified interface for multiple LLMs
  3. # This example demonstrates the LiteLLM provider, which provides a unified
  4. # interface to 400+ LLMs through a proxy server.
  5. #
  6. # REQUIREMENTS:
  7. # 1. LiteLLM proxy server must be running (use ./start-proxy.sh)
  8. # 2. Set API keys: OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_AI_API_KEY
  9. prompts:
  10. - 'Translate this to {{language}}: {{text}}'
  11. - 'Write a haiku about {{topic}}'
  12. providers:
  13. # All providers use the litellm: prefix and connect through the proxy
  14. - litellm:gpt-4.1
  15. - litellm:claude-sonnet-4-20250514
  16. - litellm:gemini-2.5-pro
  17. # Configure embedding provider for similarity assertions
  18. # This also goes through the LiteLLM proxy
  19. defaultTest:
  20. options:
  21. provider:
  22. embedding: litellm:embedding:text-embedding-3-large
  23. tests:
  24. - vars:
  25. language: French
  26. text: 'Hello, world!'
  27. assert:
  28. - type: contains
  29. value: 'Bonjour'
  30. - type: similar
  31. value: 'Bonjour, le monde!'
  32. threshold: 0.8
  33. - vars:
  34. topic: 'artificial intelligence'
  35. assert:
  36. - type: javascript
  37. value: |
  38. // Check if output is a haiku (3 lines)
  39. const lines = output.trim().split('\n').filter(line => line.trim());
  40. return lines.length === 3;
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...