Importing Models
Chariot supports importing and deploying models from various machine learning frameworks. Each framework has specific requirements and capabilities. This section provides detailed guidance for working with different model types.
Supported Model Types
- Chariot models: Models trained within Chariot and exported/imported between instances
- PyTorch Models: PyTorch models packaged as TorchServe
.mar
files - Hugging Face models: Models from Hugging Face Hub, including LLMs
- Scikit-learn models: Traditional machine learning models
- ONNX Models: Open Neural Network Exchange format models
Runtime | File type accepted (SDK) | File type accepted (UI) |
---|---|---|
Chariot | .tar.gz , as exported by Chariot | .tar.gz , as exported by Chariot |
PyTorch | .mar file, .tar.gz or directory (with .mar ) (TorchServe model archive) | .tar.gz , .mar file |
scikit-learn | .joblib file, .tar.gz or directory (with .joblib ) (scikit-learn docs) | .tar.gz , .joblib file |
Hugging Face | .tar.gz or directory (with config.json and singular or sharded weights) (Hugging Face docs) | .tar.gz (with config.json and singular or sharded weights) |
ONNX | .onnx file, .tar.gz or directory (with .onnx file) (ONNX docs) | Not supported |
For Hugging Face models, "singular weights" refers to having a single weights file (named either pytorch_model.bin
or model.safetensors
) while "sharded weights" refers to having multiple weights files. If you are uploading sharded weights (typically only done for very large models such as LLMs), then be sure they follow the standardized format. If they are .bin
files, then they should all be named like pytorch_model-{number}-of-{total}.bin
, and there should be a pytorch_model.bin.index.json
file. If they are .safetensors
files, then they should all be named like model-{number}-of-{total}.safetensors
, and there should be a model.safetensors.index.json
file as well. Virtually all models on the Hugging Face Hub follow this format.
Importing via UI
To import a model using the Chariot UI, click the Upload Model button on the Models page. When prompted, provide a name and version for your model, along with a brief summary for that model's purpose. Additionally, you can add tags to make your model easier to find or organize within the catalog. To add tags, click the Add Tags button and select the tags you wish to associate with this imported model.
Next, select the file you wish to upload. Different frameworks (also known as artifact types) support different file types.
For example, an exported Chariot model will be in either a .tar.gz
or .tgz
file format.
Packaging and Importing via the SDK
To import a model using the SDK, you will need to manually specify several parameters to register your model within the catalog when calling the chariot.models.import_model
function.
For detailed examples of packaging and importing different model types, see the appropriate model-specific page.