> The complete documentation index is at [llms.txt](/llms.txt).

In production, it is common for the same DAG code to be run on different days,
or to call an external service (for example, an LLM for data enrichment).
Bauplan supports these scenarios with parameters and secrets.

You can define a parameter using the CLI either as a simple value or by loading from a file.

      ```sh
      bauplan parameter set prompt_summary "Write a concise, incisive summary of the news article." --description "Prompt passed to GPT for article summarization"
      ```

    For longer values like LLM prompts, SQL templates, or configuration
    blobs, you can load a parameter from a file:

    ```sh
    bauplan parameter set prompt_template --type str --file prompts/summary.txt
    ```

> For other commands related to parameters, see the
>   [reference](/reference/cli#bauplan-parameter).

Each parameter is defined in `bauplan_project.yml` with a `type` and
a `default` value.

```yaml
parameters:
  interest_rate:
    default: 3.5
    type: float
  loan_amount:
    default: 200000
    type: int
```

Parameters can be:

- **Strings** (`str`)
- **Numbers** (`int`, `float`)
- **Booleans** (`bool`)
- [Secrets](#secrets) (a special, encrypted type of parameter used for API keys or credentials)

## Parameters

Parameters let you pass runtime values to models without changing code. They can be accessed in a variety of ways.

        Parameters can be passed as variables to your model code:

        ```python
        #! from typing import Annotated
        class LoanSummary(bauplan.TableSchema):
            """The columns this model returns."""

            ...

        @bauplan.model()
        @bauplan.python('3.11')
        def loan_model(
            interest_rate: Annotated[float, bauplan.Parameter('interest_rate')], # passing parameters as variables
            loan_amount: Annotated[float, bauplan.Parameter('loan_amount')],
            loan_term_years: Annotated[int, bauplan.Parameter('loan_term_years')],
        ) -> Annotated[pyarrow.Table, LoanSummary]:
            ...

            #! return pyarrow.table({})
        ```

        > To learn more, see [reference](/reference/bauplan-sdk-types#bauplan-sdk-types-parameter).

        Parameters can be passed in [`bauplan.Model`](/reference/bauplan-sdk-types#bauplan-sdk-types-model) as a filter,
        using the `$param_name` syntax:

        ```python
        #! from typing import Annotated
        class QualifyingLoans(bauplan.TableSchema):
            """The columns this model returns."""

            ...

        @bauplan.model()
        @bauplan.python('3.11')
        def qualifying_loans(
            data: Annotated[
                pyarrow.Table,
                bauplan.Model(
                    'loans',
                    filter='interest_rate <= $interest_rate AND amount >= $loan_amount',
                ),
            ],
        ) -> Annotated[pyarrow.Table, QualifyingLoans]:
            ...

            #! return pyarrow.table({})
        ```

        In SQL, use `$param_name` directly in your query:

        ```sql
        SELECT * FROM loans
        WHERE interest_rate <= $interest_rate
        AND amount >= $loan_amount
        ```

Defaults can be overridden at runtime:

    ```sh
    bauplan run --param interest_rate=4.5 --param loan_amount=500000
    ```

```python
import bauplan

client = bauplan.Client()
client.run(
    project_dir="./pipeline",
    parameters={"interest_rate": 4.5, "loan_amount": 500000},
)
```

---

### Secrets

Secrets are encrypted parameters for sensitive values like API keys,
database credentials, or tokens. They are encrypted, versioned, and
injected into your pipeline code at runtime, avoiding hardcoding.

Use the CLI with `--type secret` to create one:

```sh
bauplan parameter set openai_api_key sk-abc123... --type secret
```

Bauplan encrypts the value via AWS KMS and stores only the ciphertext
in your `bauplan_project.yml`. Secrets are never stored or transmitted
in plaintext.

In your code, reference secrets with [`bauplan.Parameter`](/reference/bauplan-sdk-types#bauplan-sdk-types-parameter) just like
regular parameters.