POST /mltk/upload_model

POST /mltk/upload_model

Upload an ONNX model.

  • upload_lookup_files
  • upload_onnx_model_file

Description. Upload an ONNX model. Validates the schema in an Anaconda sub-process, base64-encodes the binary, writes a CSV lookup __mlspl_{model_name}.mlmodel, and moves it from staging into the lookup directory.

Content-Type. multipart/form-data.

Form fields.

Field Required Notes
model_name yes Must be a valid Python identifier.
file yes ONNX binary.
features yes Comma-separated input feature column names.
targets yes Comma-separated output column names.

Capabilities. upload_lookup_files and upload_onnx_model_file.

Limits. Max model size is max_model_size_mb from mlspl.conf.

Response (200).

{ "model_name": "my_model", "algo_name": "onnx", "message": "Model uploaded successfully" }

Example.

curl -sk -u "$SPLUNK_USER:$SPLUNK_PASSWORD" -X POST 
  -F "model_name=my_model" 
  -F "file=@/path/to/my_model.onnx" 
  -F "features=cpu,memory" 
  -F "targets=score" 
  "$SPLUNK_HOST/servicesNS/nobody/Splunk_ML_Toolkit/mltk/upload_model?output_mode=json"

Press Cmd/Ctrl+K to focus search. Esc to close.

Type to search the portal.