Skip to main content

MeltyGUI

Low latency tensor visualization for PyTorch.

MeltyGUI is an open source data visualization toolkit for PyTorch, designed to render massive tensors in-place on the GPU at an interactive framerate. The purpose of this project is to make PyTorch code easier to understand and faster to debug. Along with its core tensor rendering components, MeltyGUI is bundled with a Blender inspired UI framework designed to make interacting with high dimensional tensors feel fast and intuitive.

MeltyGUI is capable of rendering tensors exceeding 64GB in size. The primary challenge with visualizing data this large is moving it around. MeltyGUI skips the data movement entirely, and ray-marches tensors directly from CUDA memory.

Image

Getting started

MeltyGUI is not yet published to PyPI. For now, install from a checkout using the setup guide.

Linux x86-64 uses Python 3.11, 3.12 or 3.13 and OpenGL 4.3. The UI and editor also run on Apple Silicon macOS with Python 3.12, OpenGL 4.1 and Retina rendering. CUDA tensor rendering requires PyTorch, an NVIDIA GPU, a CUDA toolkit, and MeltyGUI's GL-enabled CUDA binding. The native bindings install as prebuilt wheels on those targets; elsewhere installers compile them, see when no wheel matches. CUDA rendering is unavailable on macOS.

Public render functions

Every module-level function decorated with @render_func in the library is automatically available as meltygui.<function_name>, including meltygui.draw_bool(True). No export list needs updating when adding a renderer. Discovery reads source on the first render-function lookup or dir(meltygui); individual view modules still load only when accessed. Newly added functions are discovered on the next interpreter run. dir(meltygui) and __all__ include the discovered names; static IDE completion may not enumerate these dynamic exports.

Render function names must be unique across library modules. Duplicate names raise an error identifying both modules. Nested functions, class methods and bundled examples are not package-level library exports.

Use ImGui directly

The bundled ImGui bindings are public as meltygui.imgui (also available with from meltygui import imgui). They load on first access and share the same ImGui context as MeltyGUI. Call drawing functions inside a window callback:

import meltygui

@meltygui.glfw_window
def some_window():
    meltygui.imgui.text("Hello")

Visualize a tensor

Create a small volume on the GPU and tag draw_voxels as an OS window with glfw_window:

import torch
import meltygui

axis = torch.linspace(-1.5, 1.5, 40, device="cuda:0")
x, y, z = torch.meshgrid(axis, axis, axis, indexing="ij")
volume = torch.exp(-4 * ((torch.sqrt(x * x + y * y) - 0.85) ** 2 + z * z))

meltygui.glfw_window(
    meltygui.draw_voxels, name="Torus", value=volume, width=850, height=700
)

Save this as tensor_demo.py and run it with the Python from your configured environment:

.venv/bin/python tensor_demo.py

glfw_window turns a view into a native window: name is the window title, width / height its content size, value the view's input, and every other keyword argument goes to the view. The window loop starts automatically after the module finishes defining its windows. The CUDA renderer reads the volume on its own GPU and transfers the rendered 2D image for display.

To compose several views in one window, decorate your own function instead. It runs each frame, so create the tensor outside it to avoid reallocating the volume on every frame:

@meltygui.glfw_window(name="CUDA tensor", width=850, height=700)
def draw_frame():
    # Interactive widget, rendered in a loop. This function will be called wheneven
    # the rendered image is invalidated
    meltygui.draw_voxels(volume, name="Torus", width=800, height=630)

draw_voxels chooses CUDA for CUDA tensors and OpenGL for CPU tensors, NumPy arrays and GL textures. Select a renderer explicitly with the framework's view_func override (or call either renderer directly):

meltygui.draw_voxels(volume, view_func=meltygui.draw_voxels_opengl)
meltygui.draw_voxels(volume, view_func=meltygui.draw_voxels_cuda)

draw_voxels_opengl accepts tensors directly, including CUDA tensors; it slices and uploads the displayed volume to a GL texture. draw_voxels_cuda requires a CUDA tensor and reads it in place. Both expose the same camera, mapping and shading controls. Backend selection no longer uses the obsolete cuda_march parameter.

See the tensor and live-code example for a tensor viewer alongside an editable function view.

Build an app

Use the bundled UI framework to add controls, editors, and additional windows. Building an app covers persistent view state, render functions, and window lifecycle.

For framework design, feature ownership and render-function patterns, see Contributing. Development covers setup, checks and packaging; Architecture gaps tracks the remaining migration work.

License

MeltyGUI is licensed under Apache 2.0. Bundled third-party code and assets retain their own licenses. The separate commercial IDE is not part of this distribution.

Metadata

Release files for meltygui 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for meltygui 0.1.9
File Size Uploaded Provenance Actions
meltygui-0.1.9.tar.gz 6.6 MB Without provenance Details for meltygui-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for meltygui 0.1.9
File Interpreter ABI Platform Actions
meltygui-0.1.9-py3-none-any.whl Python 3 none any Details for meltygui-0.1.9-py3-none-any.whl

Total release size: 12.9 MB

Release files / meltygui-0.1.9.tar.gz

Download URL meltygui-0.1.9.tar.gz
Size 6.6 MB
Tags Source
SHA-256 checksum
How to use checksums
7550bba8f09f1f88400c92c3df6cede9f80ebe881848c7d4d13d6a0b678d4a86
BLAKE2b-256 checksum
How to use checksums
28ea5982a78c4f1ecb3800eb8553574163ad85599474fc027540003aba4f63aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / meltygui-0.1.9-py3-none-any.whl

Download URL meltygui-0.1.9-py3-none-any.whl
Size 6.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
cede976890eef39e6e1440142e26a7599dafc252f5686540148aba769563b90b
BLAKE2b-256 checksum
How to use checksums
8be952fc8961225ffe8c4bdbfbb15625e4c0c6e68ad166f299b7155390043e64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for meltygui 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page