For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).
Use the ML-in-a-Box Template For Machine Learning Applications
Last verified 22 Jan 2026
Machines are Linux and Windows virtual machines with persistent storage, GPU options, and free unlimited bandwidth. They’re designed for high-performance computing (HPC) workloads.
ML-in-a-Box is a Linux-based machine template with a pre-installed data science stack, including popular tools like PyTorch, TensorFlow, Hugging Face Transformers, DeepSpeed, JupyterLab, NumPy, Pandas, XGBoost, and Scikit-learn. It comes with full machine learning support (CUDA, cuDNN, NVIDIA Docker). You can use this template to run machine learning software, develop and train models, or install additional tools as needed.
ML-in-a-Box includes several directory-specific commands located in /usr/bin, /usr/local/bin, /home/paperspace/.local/bin, and /usr/local/cuda/bin, allowing you to access and run machine learning software or install additional tools. These directories are already included in your system’s PATH, so no manual configuration is needed.
ML-in-a-Box also has Python libraries commonly used in data science, machine learning, and deep learning projects pre-installed.
To use the ML-in-a-Box template, you need to choose this template when first creating your machine. In the Create a new machine page, under the Machine section, under the OS Template sub-section, click the drop-down menu, in the search bar, type “ML-in-a-Box”, then select it.
Note
For machines created after 17 January 2024, the ML-in-a-Box template automatically includes a NCCL configuration file to improve performance on hardware like NVIDIA H100s.
On older machines, you can manually add this configuration by creating a /etc/nccl.conf file with the following contents:
Afterwards, continue configuring your machine as needed, then click CREATE MACHINE.
Connect to Your Machine
Machines created with ML-in-a-Box only have terminal access, so you need to connect to your machine using SSH. After connecting to your machine, your home directory is set to /home/paperspace and the shell is set to /bin/bash.
If you need to verify your PyTorch environment on your machine, start by displaying your machine’s GPU specifications by running python on your terminal. Your PyTorch environment is set up properly if torch.cuda.is_available() returns True.
Python 3.11.7 (main, Dec 8 2023, 18:56:58)[GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license"for more information.
>>> import torch
>>> torch.cuda.is_available()True
>>> torch.cuda.get_device_name(0)'NVIDIA H100 80GB HBM3'
If needed, run python -m torch.utils.collect_env for more information on your machine’s environment.
If the PyTorch environment on your machine is not set up properly, you may receive an error indicating that torch is not found:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'torch'
If you need to verify your TensorFlow environment on your machine, start by displaying your machine’s GPU specifications by running python on your terminal.
Your TensorFlow environment is set up properly if tf.config.list_physical_devices('GPU') isn’t an empty list and tf.test.is_built_with_cuda() returns True.
python
>>> import tensorflow as tf
>>> x= tf.config.list_physical_devices('GPU')>>> for i in range(len(x)): print(x[i])PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')PhysicalDevice(name='/physical_device:GPU:1', device_type='GPU')...
>>> tf.test.is_built_with_cuda()True
We can't find any results for your search.
Try using different keywords or simplifying your search terms.