# MAX can now be used in Google Colab

**URL:** <https://forum.modular.com/t/max-can-now-be-used-in-google-colab/1383>\
**Category:** MAX\
**Created:** [May 6, 2025, 5:56pm UTC](https://forum.modular.com/t/max-can-now-be-used-in-google-colab/1383 "2025-05-06T17:56:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BradLarson](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/bradlarson/32/62_2.png) [@BradLarson](https://forum.modular.com/u/BradLarson)\
**Post date:** [May 6, 2025, 5:56pm UTC](https://forum.modular.com/t/max-can-now-be-used-in-google-colab/1383/1 "2025-05-06T17:56:03Z")

</div>

As we [just announced](https://www.modular.com/blog/modular-platform-25-3-450k-lines-of-open-source-code-and-pip-install-modular), Modular’s platform is [now available via `pip install modular`](https://forum.modular.com/t/pip-install-modular-now-available/1382/1). This new deployment mechanism unlocks an exciting capability: using MAX in [Google Colab](https://colab.research.google.com).

The stable 25.3 release of `modular` will work with the L4 and A100 GPUs in Colab Pro. Thanks to [the fantastic work](https://forum.modular.com/t/support-for-turing-architecture/1304/10) of @ssslakter , introductory support for the T4 GPUs in the free tier of Colab is present in the latest nightlies. Full models don’t yet run on T4 GPUs, but you can run MAX graphs in the free tier of Colab.

[This is a sample Jupyter Notebook that you can load into Colab and try out for yourself](https://colab.research.google.com/github/BradLarson/mojo-operation-template/blob/colab-notebook/Modular_Colab_Example.ipynb). This uses the Python interfaces in MAX to construct and run a simple graph, as well as perform inference using a supported large language model. This uses the latest nightly `modular` package, so the first section of the notebook will run on T4 GPUs in the free tier of Colab. If you have Colab Pro, you can run the LLM portion at the end of the notebook on an L4 or A100 GPU.

 ![Colab1](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/696037eb73067d38177b70ae028f269c945ab6ce.png)  
 ![Colab2](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/426b1cda86944e567bbd9744eafd1de19afbb251.png)

Google Colab support is still experimental and very new, but if you have any questions about the process, feel free to ask them below.

---

<div class="post-metadata">

**Author:** ![BradLarson](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/bradlarson/32/62_2.png) [@BradLarson](https://forum.modular.com/u/BradLarson)\
**Post date:** [May 8, 2025, 2:35pm UTC](https://forum.modular.com/t/max-can-now-be-used-in-google-colab/1383/2 "2025-05-08T14:35:54Z")

</div>

Through @stef 's hacking on an IPython magic command, [here’s a prototype Colab notebook that can run Mojo code in a cell on GPU](https://colab.research.google.com/github/BradLarson/mojo-operation-template/blob/colab-notebook/Modular_Mojo_Colab_Example.ipynb). We’ll keep working to improve the experience here, but thought that’d be fun to share.

 ![MojoColab1](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/8d9dbebc1e3dca4de9ad9b270600e0ce79a89195.png)  
 ![MojoColab2](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/38c7ea3ab63646bb8abbffa1cfdb345eadbf4bca.png)

---

<div class="post-metadata">

**Author:** ![BradLarson](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/bradlarson/32/62_2.png) [@BradLarson](https://forum.modular.com/u/BradLarson)\
**Post date:** [May 14, 2025, 7:03pm UTC](https://forum.modular.com/t/max-can-now-be-used-in-google-colab/1383/3 "2025-05-14T19:03:20Z")

</div>

This support for building and running Mojo code in a Jupyter notebook cell has been added into the `mojo` package, so in Colab you can now

```python
import mojo.notebook

```

and compile and run Mojo code in a cell using

```python
%%mojo

# Mojo code here

```

This even extends to building Mojo packages from a notebook cell, using the syntax

```python
%%mojo package -o custom_ops.mojopkg

# Mojo code here

```

The [newly simplified Mojo notebook example](https://colab.research.google.com/github/BradLarson/mojo-operation-template/blob/colab-notebook/Modular_Mojo_Colab_Example.ipynb) now uses this import.

 ![SimplerMojoColab](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/27d5c9c1a5800ebb71a529c27a8aa057295745da.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/2751e0fbdc595a99718b216730957e9db4448cfd.jpeg) [@system](https://forum.modular.com/u/system)\
**Post date:** [November 10, 2025, 7:03pm UTC](https://forum.modular.com/t/max-can-now-be-used-in-google-colab/1383/4 "2025-11-10T19:03:58Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![BradLarson](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/bradlarson/32/62_2.png) [@BradLarson](https://forum.modular.com/u/BradLarson)\
**Post date:** [December 4, 2025, 4:50pm UTC](https://forum.modular.com/t/max-can-now-be-used-in-google-colab/1383/5 "2025-12-04T16:50:10Z")

</div>

As an update to the above, we now have [a new tutorial on how to use Mojo code in Jupyter notebooks and Colab](https://docs.modular.com/mojo/tools/notebooks). Go check it out!
