Q14: Promptfoo Config Generator
Build a YAML config for Promptfoo with required models and settings
1
How to Submit Your Answer
  1. Select a company from the dropdown (used in the prompt)
  2. For each model, toggle max_tokens if needed and set value
  3. Click Copy on the generated YAML
  4. Paste the YAML into the answer field on the exam website
  5. Click Check to submit your answer
2
Configure Your Promptfoo YAML
3
Generated YAML

✅ Configuration includes all required elements in the correct format

prompts:
  - |
    Generate a curl command that fetches ONLY the top 9 most-starred repositories from the "slack" organization using the GitHub API.
    Use descending order for sorting by stars.
    The command must include authorization using a placeholder token: $API_KEY.

providers:
  - id: openrouter:openai/gpt-4o-mini
  - id: openrouter:openai/gpt-4.1-nano
  - id: openrouter:google/gemini-2.0-flash-lite-001

tests:
  - name: correct_github_api_endpoint
    vars: {}
    assert:
      type: contains
      value: "https://api.github.com/orgs/"

  - name: limits_to_9_repos
    vars: {}
    assert:
      type: contains
      value: "per_page=9"

  - name: sorts_by_stars
    vars: {}
    assert:
      type: contains
      value: "sort=stars"

  - name: descending_order
    vars: {}
    assert:
      type: contains
      value: "direction=desc"

  - name: uses_authorization_header
    vars: {}
    assert:
      type: contains
      value: "Authorization: Bearer $API_KEY"

  - name: rubric_eval_correctness
    vars: {}
    assert:
      type: llm-rubric
      rubric: |
        Evaluate the correctness of the generated curl command for the following:
        - API endpoint: Does it use the correct GitHub endpoint for listing org repositories?
        - Parameters: Are `per_page=9`, `sort=stars`, and `direction=desc` included?
        - Authorization: Does it include the correct authorization header using $API_KEY?

        Score each of the following from 1 (poor) to 5 (excellent):
        - endpoint_correctness
        - parameter_accuracy
        - auth_usage

# Random number a (1-20) for decorative purposes
a: 17