> ## Documentation Index
> Fetch the complete documentation index at: https://client-integrations-api-dev.sequen.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Artifacts and getting models into production

> What a hosted RRI session produces, and how to take it into your own training and serving infrastructure.

A hosted RRI session produces three kinds of output. Each reaches you differently.

| Output | What it is | How you get it |
| - | - | - |
| **Code and configuration changes** | The change an experiment made to your model code and config | A pull request on your repository |
| **Experiment records** | Each experiment's metrics, configuration and commit, plus the knowledge base the agents wrote | The session and Model Class pages in Sequen |
| **Published artifacts** | Trained checkpoints, exported models and reusable data derivatives | The artifacts location of the Model Class |

Sequen does not deploy to your infrastructure. You run training and serving in your own stack, and there are no runtime calls to Sequen.

## Pull requests

Productionizing an experiment opens a pull request from a branch named `sequen/<model-class>/<experiment-id>`. It contains the code and configuration the experiment changed, with a description of what it did to the metrics.

Trained weights are not part of the pull request. See [Connecting repositories](https://client-integrations-api-dev.sequen.ai/rri/connecting-repositories.md#what-comes-back) for how the diff is built and when a pull request is refused.

## Published artifacts

A run can publish a directory it wrote to the output directory. Everything in the directory is uploaded, so each artifact is a directory holding exactly the artifact and nothing else. There are two scopes:

| Scope | Use it for |
| - | - |
| `experiment` | One run's own output, such as a checkpoint or an exported model. The experiment id is the artifact's name. |
| `dataset` | Something later sessions on the same Model Class and dataset can reuse, such as a pre-baked cache, a parsed rebuild or a vocabulary. It has a name, and a later session asks for it by that name. |

* **Artifacts are never replaced.** A name that already holds an artifact is refused, and nothing can overwrite or delete a published artifact. To correct one, publish a new name, for example `sessions-arrow-v2`.
* **A dataset artifact can carry a cache key.** The key lists everything a later run must match for the artifact to be the right one, for example the preprocessing version and each setting that changed the bytes. A later session that asks for the artifact with a different key is refused before anything is transferred.
* **Provenance is recorded.** A published artifact records the experiment, branch and commit that produced it.
* **A Model Class publishes only if it has an artifacts location.** It is a storage prefix set on the Model Class, separate from the dataset's path so that derivatives and raw inputs are never mixed. Your Sequen contact sets it up with you.

## Take a model into your serving stack

Two things move into your infrastructure: the code and the trained artifact.

**1. Review and merge the pull request**

Your review, your CI and your merge rules apply. After the merge, your repository holds the code and configuration that produced the improvement.

**2. Retrain or fetch the artifact**

Because everything that defines a run is in version control, the merged code reproduces the result with one command. You can retrain with your own pipeline. If you need the exact weights that produced the reported metrics, ask your Sequen contact how to retrieve the experiment's published artifact.

**3. Export and deploy**

Turn the model into whatever your serving stack runs, and deploy it like your other models.

## Export formats

RRI does not convert models. A model's exported form is whatever your model code writes to the output directory and publishes. The model code is yours, so it can write a checkpoint in your framework's format, or an exported graph in the format your serving stack loads.

If your serving stack needs a format your model code cannot produce on its own, talk to your Sequen contact before you plan around it.

## Sequen-hosted serving

Hosted RRI with Sequen serving is planned. In that option you would deploy models from RRI to Sequen, and your ranking service would call the [Ranking API](https://client-integrations-api-dev.sequen.ai/api-reference/recommendations.md). It is not available yet, and nothing on this page depends on it.


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