What's in the Artifact
Ask AI
What is it?
Section titled “What is it?”An Artifact is a bundle of documents and ready-to-run scripts that Corridor builds for a registered object. Any object you register - a Data Element, Feature, Model, or Policy - can be exported as an Artifact and run somewhere else entirely.
The idea is simple: the Artifact takes the logic you built inside Corridor and hands it to you as a standalone package. It runs on its own, in an isolated test environment or in production, with no live connection to Corridor.
An Artifact is built to:
- Carry the full logic - so the object you registered in Corridor can run outside it.
- Be self-sufficient - everything the object needs is packed inside the bundle.
- Stay lightweight - it leans on the runtime environment as little as possible.
Which objects can produce an Artifact?
Section titled “Which objects can produce an Artifact?”You can export an Artifact for any of these four objects:
- Data Element
- Feature
- Model
- Policy
An Artifact can be exported at any stage - draft, pending approval, approved, or rejected. When the object is still in progress, Corridor builds the bundle on the spot at export time. Once the object is Approved, Corridor keeps a finalized bundle ready, and that is the one you download.
What’s inside an Artifact
Section titled “What’s inside an Artifact”At its heart, an Artifact exposes a Python function you can call to run the whole object end to end - starting from your input tables and producing the final result. Alongside that logic, the bundle carries the metadata and version details needed to reproduce the object’s behavior exactly.
A bundle broadly contains:
| File | What it holds |
|---|---|
metadata.json |
Information about the object in the bundle - its inputs, version, group, permissible purpose, and other registered details. |
input_info.json |
The input tables and columns the object expects, so you know exactly what to feed the main() function. |
python_dict/ |
The Python-dictionary version of the logic, for low-latency runs. Contains the runnable code (__init__.py) and a versions.json listing the library versions used. |
pyspark_dataframe/ |
The PySpark version of the same logic, for running on large data. Also contains __init__.py and its own versions.json. |
Because the Artifact pins the exact versions of every dependency it was built with, a production run stays reproducible - what you approved is exactly what runs.
How to run an Artifact
Section titled “How to run an Artifact”The Artifact ships with two ways to run the same logic. Both expose a main() function - you pick the one that fits your data and environment:
python_dict- for low-latency runs. You send data as a Python dictionary. Best for scoring one record or a small batch quickly.pyspark_dataframe- for large data. You send data as a Spark DataFrame. Best for running over big tables at scale.
Whichever you use, the call is the same. You pass your input tables to main(), and it returns two things: the output data and an errors callback.
out_data, out_errs = main(in_data, runtime_params={})errors = out_errs() # call the callback to get any runtime errorsresult = out_data['final_data']The keys in in_data are the input table references (for example, data_table_8). You will find the exact references your object expects in the bundle’s input_info.json.
Running with a Python dictionary
Section titled “Running with a Python dictionary”Send each input table as a dictionary of columns, where every column carries its type and values.
import syssys.path.insert(0, 'policy_2.15/') # the bundle folder, named <object>_<id>.<bundle_id>
from python_dict import main
in_data = { 'data_table_8': { 'id': {'type': 'str', 'values': ['1750036']}, 'annual_income': {'type': 'float', 'values': [50000.0]}, 'fico': {'type': 'float', 'values': [676.0]}, 'requested_amount': {'type': 'float', 'values': [30000.0]}, 'create_time': {'type': 'str', 'values': ['2019-06-29 04:34:00']}, 'state': {'type': 'str', 'values': ['TX']}, # ... }}
out_data, out_errs = main(in_data, runtime_params={})errors = out_errs()if len(dict(errors).get('errors', [])) > 0: print("Runtime error occurred while running policy:") print(str(errors))else: print("Policy Output:") print(out_data['final_data'])Running with a Spark DataFrame
Section titled “Running with a Spark DataFrame”Send each input table as a Spark DataFrame. This is the option to use when the data is too large to hold in memory.
import syssys.path.insert(0, 'policy_2.15/') # the bundle folder, named <object>_<id>.<bundle_id>
from pyspark_dataframe import main
in_data = { 'data_table_8': spark.read.parquet("/data/application_jan2020.parquet")}
out_data, out_errs = main(in_data, runtime_params={})errors = out_errs()if len(dict(errors).get('errors', [])) > 0: print("Runtime error occurred while running policy:") print(str(errors))else: print("Policy Output:") print(out_data['final_data']) # a Spark DataFrameHow to export an Artifact
Section titled “How to export an Artifact”
Open the Object
Section titled “Open the Object”
Open the Object
Section titled “Open the Object”- Open the module the object lives in - Underwriting, for example.
- Open the object you want to export (a Policy, Model, Feature, or Data Element).
Choose an Export Option
Section titled “Choose an Export Option”
Choose an Export Option
Section titled “Choose an Export Option”- Open the object’s actions menu and click Export Artifact.
- A dialog opens with a card for each export option available in your environment.
- Pick the option you want, then click Export to download the bundle.
The list of options depends on how your Corridor environment is set up. Common ones include:
- Python Artifact - the standard bundle with the
python_dictandpyspark_dataframecode, ready to run in your own Python environment. - Bureau packages (for example, TransUnion, Experian, Equifax) - packaged for submission to that credit bureau.
- Cloud deployment (for example, GCP Cloud Run, AWS Lambda) - packaged to deploy the object as a cloud service.
Each option shows its own next steps after the download, guiding you through unpacking and running or deploying the bundle.
What’s Next
Section titled “What’s Next”- Approve an Object: approving an object finalizes the Artifact that ships to production.
- Monitor your Model or Policy once the Artifact is running in production.
Was this page helpful?
Thanks for the feedback.