---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://catboost.ai/docs/en/features/export-model-to-python.md
  - href: en/features/export-model-to-python.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

# Export a model to Python or C++

The CatBoost model can be saved as standalone Python or C++ code. This solution simplifies the integration of resulting models to Python and C++ applications, allows to port models to architectures that are not directly supported by CatBoost (such as IBM z/Architecture) and allows advanced users to manually explore or edit the model parameters.

<!-- source: en/_includes/work_src/reusage-common-phrases/choose-the-required-implementation-for-more-details.md -->
Choose the implementation for more details.
<!-- endsource: en/_includes/work_src/reusage-common-phrases/choose-the-required-implementation-for-more-details.md -->

- [python](#python)
- [cli](#cli)

Depending on the output format the resulting file contains one of the following methods for applying the model:
- Python — [apply_catboost_model](https://catboost.ai/docs/en/concepts/python-reference_apply_catboost_model.md)
- C++ — [C++](https://catboost.ai/docs/en/concepts/c-plus-plus-api_applycatboostmodel.md)

{% note alert %}

- <!-- source: en/_includes/work_src/reusage-common-phrases/apply_catboost_model__performance.md -->
  The [`apply_catboost_model`](https://catboost.ai/docs/en/concepts/python-reference_apply_catboost_model.md) method is inferior in performance compared to the native CatBoost application methods, especially on large models and datasets.
  <!-- endsource: en/_includes/work_src/reusage-common-phrases/apply_catboost_model__performance.md -->

{% endnote %}

## Python package

The following parameters can be set for the corresponding methods and are used when the model is saved:

**Method**

- [save_model](https://catboost.ai/docs/en/concepts/python-reference_catboost_save_model.md) ([CatBoost](https://catboost.ai/docs/en/concepts/python-reference_catboost.md))
- [save_model](https://catboost.ai/docs/en/concepts/python-reference_catboostclassifier_save_model.md) ([CatBoostClassifier](https://catboost.ai/docs/en/concepts/python-reference_catboostclassifier.md))
- [save_model](https://catboost.ai/docs/en/concepts/python-reference_catboostregressor_save_model.md) ([CatBoostRegressor](https://catboost.ai/docs/en/concepts/python-reference_catboostregressor.md))


**Parameters**

`format`

**Description**

<!-- source: en/_includes/work_src/reusage/python__save__export-format__short_desc.md -->
The output format of the model.
<!-- endsource: en/_includes/work_src/reusage/python__save__export-format__short_desc.md -->

Set the value of this parameter to “python” or “cpp”.

## Command-line version

The following command keys can be specified for the corresponding commands and are used when the model is trained:

**Command** [catboost fit](https://catboost.ai/docs/en/references/training-parameters/index.md)

**Command keys**

`--model-format`

**Key description**

<!-- source: en/_includes/work_src/reusage/cli__mode-format__short-desc.md -->
A comma-separated list of output model formats.
<!-- endsource: en/_includes/work_src/reusage/cli__mode-format__short-desc.md -->

Set the value of this key to “Python” or “CPP”.
