> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Import models from MLflow

> Register READY MLflow model versions and mirror promotions back to MLflow aliases.

MLflow keeps training runs; the [ML library](https://docs.bijection.com/models/review-and-serving.md)
keeps the versions your app serves. Give `ml({...})` an `mlflow` option to
connect the two.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
export const models = ml({
  label: lab,
  // ...
  mlflow: { endpoint: "https://mlflow.example.com", bearer: mlflowToken, mirrorAliases: true },
});
```

`mlflow.import({ model, name, version, artifact, metadata })` asks the
tracking server for the registered model version
(`GET /api/2.0/mlflow/model-versions/get`). If it answers `READY` for
exactly that name and version, the library registers it as a version with
its MLflow provenance (`run_id`, `source`). The files are still the
Datasets artifact your capture job published. `mlflow.status({ import })`
reads an import.

With `mirrorAliases`, promoting an imported version also sets the MLflow
alias of the same name (`POST /api/2.0/mlflow/registered-models/alias`).
The alias fact's `mirror` records `pending`, `mirrored` or `failed`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.