Install MAX
Welcome to the MAX install guide!
The MAX SDK includes everything you need to develop and deploy low-latency AI inference pipelines into production and build other programs with Mojo. Read about what's included.
If you already installed MAX, instead see the update guide.
Requirements
- Mac
- Linux
- Windows
- Apple silicon (M1/M2/M3 processor)
- macOS Ventura (13) or later
- Python 3.9 - 3.11
- Xcode or Xcode Command Line Tools
- Homebrew
- Ubuntu 20.04/22.04 LTS
- x86-64 CPU (with SSE4.2 or newer) or AWS Graviton2/3 CPU
- Minimum 8 GiB RAM
- Python 3.8 - 3.11
- g++ or clang++ C++ compiler
Windows support is still in development.
In the meantime, you can use MAX on Windows with WSL, using a compatible version of Ubuntu (see our requirements for Linux).
Install MAX
By downloading the MAX SDK, you understand and agree to the MAX software license.
The MAX SDK is available as either a stable build or a nightly build. We strive to release stable builds once a month and release nightly builds as often as possible (not necessarily every day).
- Stable
- Nightly
Open a terminal and install the
modular
command line tool with this helper script:curl -s https://get.modular.com | sh -
Or, click here to see the manual install commands.
- Mac
- Linux
brew update && brew install modularml/packages/modular
apt-get install -y apt-transport-https &&
keyring_location=/usr/share/keyrings/modular-installer-archive-keyring.gpg &&
curl -1sLf 'https://dl.modular.com/bBNWiLZX5igwHXeu/installer/gpg.0E4925737A3895AD.key' | gpg --dearmor >> ${keyring_location} &&
curl -1sLf 'https://dl.modular.com/bBNWiLZX5igwHXeu/installer/config.deb.txt?distro=debian&codename=wheezy' > /etc/apt/sources.list.d/modular-installer.list &&
apt-get update &&
apt-get install -y modularCreate a virtual environment:
- venv
- conda
For most users, we recommend venv (it's included with Python). Also make sure you're using a compatible version of Python. For example:
python3.11 -m venv max-venv && source max-venv/bin/activate
Only if you already use conda as your preferred environment, we suggest you use that (and make sure you use a compatible version of Python):
conda create -n max python=3.11 -y && conda activate max
Create or sign into your Modular account:
modular auth
Install the MAX SDK (it includes Mojo):
modular install max
Install the MAX Engine Python package:
MAX_PATH=$(modular config max.path) \
&& python3 -m pip install --find-links $MAX_PATH/wheels max-engineIf you encounter an error here, make sure you have a compatible Python version (see the requirements).
Set environment variables so you can access the
mojo
andmax
tools:- Bash
- ZSH
- fish
If you're using Bash, run this command:
MAX_PATH=$(modular config max.path) \
&& BASHRC=$( [ -f "$HOME/.bash_profile" ] && echo "$HOME/.bash_profile" || echo "$HOME/.bashrc" ) \
&& echo 'export MODULAR_HOME="'$HOME'/.modular"' >> "$BASHRC" \
&& echo 'export PATH="'$MAX_PATH'/bin:$PATH"' >> "$BASHRC" \
&& source "$BASHRC"If you're using ZSH, run this command:
MAX_PATH=$(modular config max.path) \
&& echo 'export MODULAR_HOME="'$HOME'/.modular"' >> ~/.zshrc \
&& echo 'export PATH="'$MAX_PATH'/bin:$PATH"' >> ~/.zshrc \
&& source ~/.zshrcIf you're using fish, run this command:
set MAX_PATH (modular config max.path) \
&& set -Ux MODULAR_HOME $HOME/.modular \
&& fish_add_path $MAX_PATH/binOnly if you're using conda, you need to re-activate your environment because it gets deactivated when you source the shell configuration files (the previous command):
conda activate max
Open a terminal and install the
modular
command line tool with this helper script (this is the same for stable and nightly builds):curl -s https://get.modular.com | sh -
Or, click here to see the manual install commands.
- Mac
- Linux
brew update && brew install modularml/packages/modular
apt-get install -y apt-transport-https &&
keyring_location=/usr/share/keyrings/modular-installer-archive-keyring.gpg &&
curl -1sLf 'https://dl.modular.com/bBNWiLZX5igwHXeu/installer/gpg.0E4925737A3895AD.key' | gpg --dearmor >> ${keyring_location} &&
curl -1sLf 'https://dl.modular.com/bBNWiLZX5igwHXeu/installer/config.deb.txt?distro=debian&codename=wheezy' > /etc/apt/sources.list.d/modular-installer.list &&
apt-get update &&
apt-get install -y modularCreate a virtual environment for nightly builds:
- venv
- conda
For most users, we recommend venv (it's included with Python). Also make sure you're using a compatible version of Python. For example:
python3.11 -m venv max-nightly-venv && source max-nightly-venv/bin/activate
Only if you already use conda as your preferred environment, we suggest you use that (and make sure you use a compatible version of Python):
conda create -n max-nightly python=3.11 -y && conda activate max-nightly
Create or sign into your Modular account:
modular auth
Install the nightly MAX SDK (it includes Mojo nightly):
modular install nightly/max
Install the nightly MAX Engine Python package:
MAX_NIGHTLY_PATH=$(modular config max-nightly.path) \
&& python3 -m pip install --find-links $MAX_NIGHTLY_PATH/wheels max-engineIf you encounter an error here, make sure you have a compatible Python version (see the requirements).
Set environment variables so you can access the nightly
mojo
andmax
tools:- Bash
- ZSH
- fish
If you're using Bash, run this command:
MAX_NIGHTLY_PATH=$(modular config max-nightly.path) \
&& BASHRC=$( [ -f "$HOME/.bash_profile" ] && echo "$HOME/.bash_profile" || echo "$HOME/.bashrc" ) \
&& echo 'export MODULAR_HOME="'$HOME'/.modular"' >> "$BASHRC" \
&& echo 'export PATH="'$MAX_NIGHTLY_PATH'/bin:$PATH"' >> "$BASHRC" \
&& source "$BASHRC"If you're using ZSH, run this command:
MAX_NIGHTLY_PATH=$(modular config max-nightly.path) \
&& echo 'export MODULAR_HOME="'$HOME'/.modular"' >> ~/.zshrc \
&& echo 'export PATH="'$MAX_NIGHTLY_PATH'/bin:$PATH"' >> ~/.zshrc \
&& source ~/.zshrcIf you're using fish, run this command:
set MAX_NIGHTLY_PATH (modular config max-nightly.path) \
&& set -Ux MODULAR_HOME $HOME/.modular \
&& fish_add_path $MAX_NIGHTLY_PATH/binOnly if you're using conda, you need to re-activate your environment because it gets deactivated when you source the shell configuration files (the previous command):
conda activate max-nightly
Now you're ready to go.
You can verify your version by calling max
or
mojo
with the --version
option (both tools have the same
version):
max --version
Get started
Start with MAX
Run a PyTorch model on MAX Engine and run Llama 3 built entirely in Mojo.
Start with Mojo
Get started in Mojo by writing "Hello world" using the Mojo REPL and compiler.
To help us improve MAX, we collect some telemetry data and crash reports. Learn more.