Add input argument overrides for pipeline runs via CLI and SDK #832
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enables dynamic parameter injection for pipeline runs without creating new PipelineVersions. Users can override orchestration parameters (e.g., Argo Workflow arguments) at runtime, supporting use cases like prompt injection for Agentic AI and multi-tenant configurations.
Changes
CLI
--set key=valuefor inline parameter overrides (repeatable)--overrides-file path.jsonfor file-based overridesSDK
input_args_override: Dict[str, str]parameter toPipeline.run()PipelineVersionRun.input_args_overrideUtilities
clarifai/utils/pipeline_overrides.py: Parse, load, merge, validate, and build override structuresTesting
Usage
CLI:
SDK:
Compatibility
Fully backward compatible—
input_args_overrideis optional. Implementation detects proto field availability at runtime and adapts accordingly.Original prompt
This section details on the original issue you should resolve
<issue_title>Enable Input Arguments Override through CLI & CLI</issue_title>
<issue_description>## Overview
This document describes the required changes to the Python CLI and CLI to support input arguments override when running a pipeline via PipelineVersionRun. This enables users to dynamically override orchestration-specific input parameters (e.g., Argo Workflow arguments) for each run, supporting use-cases such as prompt injection for Agentic AI without requiring new PipelineVersions.
API Feature Summary (Reference Only; Already Implemented)
input_args_overridefield inPipelineVersionRun(acceptsOrchestrationArgsOverride)orchestration_specfield inPipelineVersionRunfor the merged, final specArgoArgsOverrideandArgoParameterOverrideSemantics
input_args_override.CLI Changes
1. Command Updates
clarifai pipeline runto accept input argument overrides for each run.2. Input Override Methods
Inline via
--set:File-based via
--overrides-file:overrides.json:{ "prompt": "Summarize this research paper", "temperature": "0.7" }Support both inline and file-based overrides for flexibility.
3. Output Formatting
orchestration_spec) for the run.SDK Changes
1. Proto/Model Updates
OrchestrationArgsOverrideArgoArgsOverrideArgoParameterOverridePipelineVersionRunwith new fields2. Client Method Updates
Pipeline.run()(or equivalent) to accept aninput_args_overrideargument.PipelineVersionRunresponses expose the mergedorchestration_spec.3. Helper Methods (Optional)
build_arg_override(parameters: dict[str, str]) -> OrchestrationArgsOverridevalidate_arg_override(override: OrchestrationArgsOverride, pipeline_version: PipelineVersion) -> bool4. Example SDK Usage
Backward Compatibility
input_args_overrideis optional.Testing Requirements
1. Unit Tests
2. Integration Tests
3. Example Code & Documentation
Security & Traceability
PipelineVersionRunfor accurate auditing and debugging.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.