4.2.1.5.1 Install OML4Py Slim Client Modules

Install the OML4Py Slim Client Modules to access only the ONNX model conversion feature. This lightweight client is ideal when you need ONNX model conversion without the full set of OML4Py functionalities.

Starting with version 2.1.1, OML4Py offers a lightweight OML4Py client that supports only ONNX model conversion.

Note:

If you plan to install both the full and slim versions of the OML4Py client, make sure to use separate <install_folder> directories for each version. Set the PYTHONPATH environment variable so that only one version is loaded at a time.
  1. There are two options for installing the supporting packages for the OML4Py Slim Client:
    • Option 1: Install from the oml4py-supporting-linux-x86_64-2.1.1.zip archive.

      Note:

      The torch-2.9.0 package bundled within oml4py-supporting-linux-x86_64-2.1.1.zip requires the GNU C++ standard library (libstdc++.so.6) on your system to be built with GLIBCXX_3.4.29 or newer.If this version is not available, you may encounter an error such as:
      ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by .../torch/lib/libtorch_python.so)
      On Linux, you can check which GLIBCXX versions are supported by running:
      nm -D /lib64/libstdc++.so.6 | grep GLIBCXX
      If your system does not include GLIBCXX_3.4.29 or newer, resolve the issue by copying a compatible libstdc++.so.6 to $PYTHONHOME/lib.The torch-2.9.0 package includes a suitable version in torch/lib/libstdc++.so.6.

      Create a file named requirements-slim.txt with the following content:

      numpy==2.1.0
      pillow==10.4.0
      onnxruntime==1.20.0
      onnxruntime-extensions==0.12.0
      onnx==1.17.0
      torch==2.9.0
      transformers==4.56.1
      sentencepiece==0.2.0

      After unzipping the archive, install the supporting packages listed in requirements-slim.txt by running:

      pip3.13 install --target <install_folder> --no-index --find-links=supporting/ --upgrade -r requirements-slim.txt

      Replace <install_folder> with your installation directory.

    • Option 2: Install from the PyPI repository.

      Create a file named requirements-slim.txt with the following contents:

      --extra-index-url https://download.pytorch.org/whl/cpu
      numpy==2.1.0
      pillow==10.4.0
      onnxruntime==1.20.0
      onnxruntime-extensions==0.14.0
      onnx==1.18.0
      torch==2.9.0
      transformers==4.56.1
      sentencepiece==0.2.1
      Install the supporting packages with requirements-slim.txt.
      pip3.13 install --target <install folder> --upgrade -r requirements-slim.txt –-only-binary:all:
  2. Next, install the OML4Py Slim Client:

    Use the following wheel file from the oml4py-client-linux-x86_64-2.1.1.zip archive:

    client/slim/oml-2.1.1-cp313-cp313-linux_x86_64.whl

    Run the following command to install:

    pip3.13 install --target <install_folder> --no-index --upgrade --no-deps client/slim/oml-2.1.1-cp313-cp313-linux_x86_64.whl

    Replace <install_folder> with your desired installation directory.