Configure Python model dependencies

Sunsetted functionality

The below documentation describes the foundry_ml library which is no longer recommended for use in the platform. Instead, use the palantir_models library. You can also learn how to migrate a model from the foundry_ml to the palantir_models framework through an example.

The foundry_ml library will be removed on October 31, 2025, corresponding with the planned deprecation of Python 3.9.

Models trained with foundry_ml can have dependencies, meaning the specific packages and versions required to run a model. When a foundry_ml model is submitted to a modeling objective, a Conda environment solve process will automatically begin in order to define the packages and versions used to run that model. Initially, this solve process is executed against a set of default Python dependencies. If you require additional dependencies for the model execution, you should configure those dependencies as described below.

Configure model dependencies

To configure a Python model's dependencies, click on the specific model submission in the Models section of your objective home page. This will take you to the full model submission page, where dependencies can be configured.

Model details

Next, click on the Configure button to open the configuration dialog. In this dialog, you can add, remove, and edit the list of dependencies, choosing their version constraints. As an example for this tutorial, we will add a new package numpy with version set to AUTOMATIC. Select Save model configuration to start solving the new Conda environment.

Dependency config dialog

For model types that support dependency configuration (currently only Python models), releasing the model is blocked until the solve is finished.

Pending solve

Once the solve is successful, you can Create new release and deploy the model.

Successful solve

The set of default Python dependencies can be viewed under the modeling objective's Settings page under the Deployments tab, as shown below.

Pending solve

Using Foundry library as dependency

If your model uses a library developed inside Foundry (see Share Python libraries), as long as you have read permission on the library's underlying code repository, they will also be available to be picked as dependency on the Model dependencies.

Foundry library

After the model dependencies configuration, that library will be made available for the model regardless of the user's permission on the repository when triggering release and deploy.