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 3.4 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. description: 'GPT vs Claude example'
  3. prompts:
  4. - file://prompt.yaml
  5. providers:
  6. - id: anthropic:claude-sonnet-4-20250514
  7. label: Claude Sonnet 4
  8. - openai:gpt-4.1-mini
  9. defaultTest:
  10. assert:
  11. - type: cost
  12. threshold: 0.01
  13. - type: latency
  14. threshold: 3000
  15. - type: javascript
  16. value: 'output.length <= 100 ? 1 : output.length > 1000 ? 0 : 1 - (output.length - 100) / 900'
  17. tests:
  18. - vars:
  19. riddle: 'I speak without a mouth and hear without ears. I have no body, but I come alive with wind. What am I?'
  20. assert:
  21. # Make sure the LLM output contains this word
  22. - type: icontains
  23. value: echo
  24. # Use model-graded assertions to enforce free-form instructions
  25. - type: llm-rubric
  26. value: Do not apologize
  27. - vars:
  28. riddle: "You see a boat filled with people. It has not sunk, but when you look again you don't see a single person on the boat. Why?"
  29. assert:
  30. - type: llm-rubric
  31. value: explains that the people are below deck, or they are all in a relationship
  32. - vars:
  33. riddle: 'The more of this there is, the less you see. What is it?'
  34. assert:
  35. - type: icontains
  36. value: darkness
  37. - vars:
  38. riddle: >-
  39. I have keys but no locks. I have space but no room. You can enter, but
  40. can't go outside. What am I?
  41. assert:
  42. - type: icontains
  43. value: keyboard
  44. - vars:
  45. riddle: >-
  46. I am not alive, but I grow; I don't have lungs, but I need air; I don't
  47. have a mouth, but water kills me. What am I?
  48. assert:
  49. - type: icontains-any
  50. value:
  51. - fire
  52. - flame
  53. - vars:
  54. riddle: What can travel around the world while staying in a corner?
  55. assert:
  56. - type: icontains
  57. value: stamp
  58. - vars:
  59. riddle: Forward I am heavy, but backward I am not. What am I?
  60. assert:
  61. - type: icontains
  62. value: ton
  63. - vars:
  64. riddle: >-
  65. The person who makes it, sells it. The person who buys it, never uses
  66. it. The person who uses it, doesn't know they're using it. What is it?
  67. assert:
  68. - type: icontains
  69. value: coffin
  70. - vars:
  71. riddle: I can be cracked, made, told, and played. What am I?
  72. assert:
  73. - type: icontains
  74. value: joke
  75. - vars:
  76. riddle: What has keys but can't open locks?
  77. assert:
  78. - type: icontains
  79. value: piano
  80. - vars:
  81. riddle: >-
  82. I'm light as a feather, yet the strongest person can't hold me for much
  83. more than a minute. What am I?
  84. assert:
  85. - type: icontains
  86. value: breath
  87. - vars:
  88. riddle: >-
  89. I can fly without wings, I can cry without eyes. Whenever I go, darkness
  90. follows me. What am I?
  91. assert:
  92. - type: icontains
  93. value: cloud
  94. - vars:
  95. riddle: >-
  96. I am taken from a mine, and shut up in a wooden case, from which I am
  97. never released, and yet I am used by almost every person. What am I?
  98. - vars:
  99. riddle: >-
  100. David's father has three sons: Snap, Crackle, and _____? What is the
  101. name of the third son?
  102. assert:
  103. - type: contains
  104. value: David
  105. - vars:
  106. riddle: >-
  107. I am light as a feather, but even the world's strongest man couldn't
  108. hold me for much longer than a minute. What am I?
  109. assert:
  110. - type: icontains
  111. value: breath
Tip!

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

Comments

Loading...