Skip to content

Allow None or Empty benchmark_id similar to the behavior with provider_id. #4453

Description

@Elbehery

🚀 Describe the new functionality needed

In run.yaml configurations, the conditional syntax ${env.VAR:+value} works for provider_id (entries with None/empty provider_id are filtered out before validation), but does NOT work for benchmark_id in registered_resources.benchmarks.

When KUBEFLOW_LLAMA_STACK_URL is not set, this config:

registered_resources:
  benchmarks:
  - benchmark_id: ${env.KUBEFLOW_LLAMA_STACK_URL:+trustyai_garak::owasp_llm_top10}
    dataset_id: garak
    scoring_functions:
      - garak_scoring
    provider_id: trustyai_garak_remote
    provider_benchmark_id: owasp_llm_top10

Causes this validation error:

pydantic_core._pydantic_core.ValidationError: 6 validation errors for StackRunConfig
registered_resources.benchmarks.0.benchmark_id
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]

💡 Why is this needed? What if we don't build it?

Upon adding Garak provider , I had this PR blocked

Other thoughts

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions