Skip to content

VersusGPU

JupyterLab vs marimo for Local AI: Which Python Notebook Should You Use?

JupyterLab and marimo are both free Python notebooks for experimenting with AI on your PC, but they work very differently. We compare execution model, expensive GPU cells, file format, environments and AI features.

By , Senior Hardware Editor

5 min read

JupyterLab vs marimo for Local AI: Which Python Notebook Should You Use?

JupyterLab and marimo are both free Python notebooks that run on your own PC, and both are good places to load a model onto your graphics card and experiment with it. They work in very different ways, though. JupyterLab runs whatever cell you tell it to, in whatever order, and saves notebooks as .ipynb files with their outputs. marimo is reactive: it tracks how cells depend on each other, keeps results consistent and saves notebooks as plain Python. This comparison looks at what that means for local AI work.

At a glance

JupyterLab

marimo

Execution model

You run cells manually, in any order

Reactive: dependent cells re-run or are marked stale

File format

.ipynb (JSON, stores outputs)

.py (pure Python, outputs not stored by default)

Install

pip install jupyterlab

pip install marimo

Multiple Python environments

One install, a kernel per environment (ipykernel)

Run from each project, or per-notebook sandboxes

Expensive GPU cells

Only run when you run them

Turn autorun off, or gate with mo.stop()

Run as a script or app

Needs conversion

python notebook.py, marimo run notebook.py

Desktop app

JupyterLab Desktop

No; runs in the browser or editor extensions

VS Code

Jupyter extension

marimo extension

Convert between them

marimo convert imports .ipynb

marimo export ipynb exports back

Execution model: freedom vs consistency

This is the big difference. marimo's documentation describes a Jupyter notebook as a REPL: you execute blocks of code one at a time, and Jupyter has no understanding of how they relate. That's flexible, but it's easy to run cells out of order or change a variable without re-running the cells that used it, leaving results on screen that no longer match the code. The marimo team goes as far as citing research that over a third of Jupyter notebooks on GitHub fail to reproduce.

marimo instead models a notebook as a graph of cells, linked by the variables they define and use. Run a cell and the cells that depend on it run automatically; delete a cell and its variables are removed from memory. For AI experiments, that means the output under a prompt really is from the current settings.

The price is a few rules. The same variable can't be defined in more than one cell, so code that keeps reassigning df or model across cells needs restructuring, and marimo suggests wrapping code in functions or using underscore-prefixed names for temporary variables.

Expensive GPU cells

Local AI notebooks often include a cell that takes a long time and a lot of VRAM, such as loading a model or generating a batch of images. In JupyterLab that's straightforward: nothing runs unless you run it.

In marimo, automatically re-running a model-loading cell because you changed something upstream would be painful, and the documentation addresses it directly. You can configure the runtime not to autorun on startup or on cell execution; marimo still tracks dependencies and marks affected cells as stale, with a button to run them all. You can also use mo.stop() with mo.ui.run_button() so a cell only runs when you press a button. It's workable, but it's something to set up, whereas JupyterLab's manual model needs nothing.

Either way, the loaded model lives in VRAM until you free it or restart. Our JupyterLab GPU guide covers torch.cuda.empty_cache() and kernel restarts.

File format, git and sharing

JupyterLab saves .ipynb files: JSON that includes cell outputs such as images and printed text. That's convenient for showing results, and .ipynb is the standard format you'll be handed by tutorials and example repos, but the JSON produces noisy diffs in git. Jupytext can pair notebooks with plain .py or .md files if that bothers you.

marimo stores notebooks as pure Python. They diff cleanly in git, run as scripts with python notebook.py, and can be served as an interactive web app with marimo run. The flip side is that outputs such as plots aren't stored in the file; marimo can periodically snapshot a notebook as HTML or ipynb into a __marimo__ folder if you turn that setting on, or you can export with marimo export.

Python environments and PyTorch builds

Both play well with separate environments, which matters when one project needs a CUDA build of PyTorch and another needs something else. JupyterLab's usual approach is one Jupyter install with a registered kernel per environment, using python -m ipykernel install --user --name .... The uv documentation also covers launching JupyterLab inside a uv project with uv run --with jupyter jupyter lab.

marimo is installed alongside your notebook's packages, and with uv or Pixi you launch it from your project with uv run or pixi run. It can also store a notebook's package requirements inside the file and install them into an isolated sandbox, for example with uvx marimo edit --sandbox notebook.py. That's neat for small, self-contained experiments. For a GPU build of PyTorch, you'll still want to set up the project environment yourself; our uv guide for local AI shows how with --torch-backend.

AI features and editors

marimo has built-in AI features: an assistant that generates code with context about the variables in memory, the option to bring your own API keys or use local models, GitHub Copilot support, and a marimo pair mode for working with coding agents. The extras that enable AI completion come with the optional marimo[recommended] install. If you run a local model server, our best GPU for local AI coding guide covers the hardware side.

For JupyterLab, the official installation page covers the core app; AI features come from separate extensions, which we haven't assessed here. On the editor side, both work in VS Code: Jupyter notebooks through the Jupyter extension, and marimo through its own VS Code extension, which marimo says also works in Cursor and other VS Code forks. JupyterLab also has an official desktop app, JupyterLab Desktop, which marimo doesn't.

Which should you use?

Choose JupyterLab if you mostly run notebooks from tutorials and model repos, want outputs saved inside the notebook, like running cells freely in any order, or want a double-click desktop app. It's also the one to learn first, because .ipynb is the format everything else converts to and from.

Choose marimo if your notebooks grow into tools you rerun and share, you keep them in git, or you've been caught out by stale results in Jupyter. Turn autorun off before you load big models.

You don't have to pick only one: marimo convert your_notebook.ipynb -o your_notebook.py brings a Jupyter notebook into marimo, and marimo export ipynb goes the other way. For more options, see our best Python notebook apps for local AI.

The bottom line

JupyterLab is the better choice for most people experimenting with local AI: it opens the .ipynb notebooks that tutorials and example repos use, saves outputs inside the notebook, only runs the cells you tell it to, and lets one install use a separate kernel for each project's PyTorch environment. marimo is the better choice if you want reproducible notebooks stored as plain Python files that work well in git and run as scripts or apps, as long as you turn off autorun or gate expensive model-loading cells so they don't re-run unexpectedly.

Sources

  1. 01JupyterLab documentation, Installation
  2. 02IPython documentation, Installing the IPython kernel
  3. 03uv documentation, Using uv with Jupyter
  4. 04GitHub, marimo-team/marimo (README)
  5. 05marimo documentation, Installation
  6. 06marimo documentation, Coming from Jupyter
  7. 07GitHub, jupyterlab/jupyterlab-desktop (README)
  8. 08Visual Studio Code documentation, Jupyter Notebooks in VS Code
  9. 09GitHub, mwouts/jupytext (README)

About the author

Callum Reid

Senior Hardware Editor

Callum leads GPU, CPU and platform architecture coverage at Forge PC. Before joining the editorial desk, he spent nine years specifying, assembling and stress-testing custom gaming and workstation systems in the UK, with a focus on PCIe bandwidth, VRM thermal design, DDR5 memory tuning and 1440p/4K frame-time consistency.

More from Callum Reid

Read next

Best Free BSOD Crash Analysis Tools (2026): Find the Driver Behind a Blue Screen

Best Picks

Best Free BSOD Crash Analysis Tools (2026): Find the Driver Behind a Blue Screen

When Windows keeps crashing with a blue or black screen, the clues are in its crash dump files. We pick the best free tools to read them, WhoCrashed Home Edition, NirSoft BlueScreenView and Microsoft's WinDbg, from each developer's official pages, and explain what Microsoft says to do next.

Hannah Vance5 min