# Palantir models migration FAQ ## Why might a dataset-backed model not appear on the campaign page? Which models are considered in use, and which are ignored? The upgrade page displays all dataset-backed models that: * were built on the [default branch](../../code-repositories/branch-settings/index.md#default-branch) in the past 90 days, or, * were an input to a build on the default branch within the past 90 days (including batch deployment builds governed by a modeling objective), or, * are the latest release on a modeling objective with an active live deployment. As part of this intervention, dataset-backed models that do not meet these criteria are marked as `Ignored`, and are filtered out by default from the campaign view. Models for which a replacement model was selected have their status set to `Completed`, which also filters them out from the campaign view by default. ## What happens after the deprecation date? Models developed with `foundry_ml` will no longer be supported in modeling objectives, Python transforms, or modeling objective deployments. More concretely: * It will no longer be possible to publish new `foundry_ml` models * Code using `foundry_ml` will no longer be editable and checks will fail for any code importing `foundry_ml` * Any jobs or live deployments using `foundry_ml` models may break and will no longer be supported by Palantir ## Can a model be migrated without re-training? It is possible to migrate a model without re-training it. To do so, load the model and write it to an output dataset from a Code Repository with `foundry_ml` installed and using Python 3.9: ```python from transforms.api import Input, Output, transform # Pickle may not be the right choice depending on the class of the models. # Refer to the documentation of the modeling library you are using to select a serialization method. import pickle from foundry_ml import Model @transform( output_dataset=Output(""), source_model=Input(""), ) def compute(output_dataset, source_model): MODEL_STAGE_ID = model = Model.load(source_model) # Select the relevant model stage. model_stage = model.stages[MODEL_STAGE_ID].model # Write it to the output dataset. with output_dataset.filesystem().open("model.pkl", 'wb') as f: pickle.dump(model_stage, f) ``` From this output dataset, you can then publish a model from a separate repository using `palantir_models` and a more recent Python version. Refer to [this tutorial to learn more](../../integrate-models/model-asset-files/index.md). ## How are AIP-powered code suggestions generated? What is the resource usage of code suggestions? AIP-powered code suggestions are automatically generated via AIP and powered by GPT-4o, if enabled on your environment. In order to reduce unnecessary or duplicative calls to the LLM, AIP-powered code suggestions are generated on an as-needed basis and cached for repeat viewing. In particular: * Code suggestion prompts to the LLM are executed the first time a resource is seen in the Upgrade Assistant resource list. The results are then cached and available for anyone who accesses that resource. * As users scroll down the Upgrade Assistant resource list, any new resources that come into view will, if no cached results already exist, trigger a call to AIP to generate their associated code suggestions. * If desired, users can override existing cached results on a resource and re-prompt AIP for a fresh response by opening the existing AIP code suggestion and selecting **Regenerate fixes**. Resource usage from AIP-powered code suggestions is based on the [standard AIP compute measurement](../../aip/aip-compute-usage/index.md#usage-based-pricing-compute-translation-for-aip). ## Why is AIP not able to provide suggestions? AIP may not be able to provide LLM-generated suggestions in the following cases: * The code for the model was not found on the default branch (called `master` on most environments), most likely because this branch is empty. This can be verified by navigating to the model on the default branch: if Foundry cannot find code for the model, there will be no `View Code` option. * The model is a [TypeScript Function that was submitted to an objective](../../manage-models/submit-model/index.md). These models are identifiable by the **Model execution plan** on the model page showing `foundryFunctionV2` as its type. * AIP might have failed to produce a suggestion due to incorrect LLM output. If the problem persists after reloading the page, contact Palantir support.