gradio-gpu-monitor
Custom real-time GPU monitoring component for Gradio apps using gr.HTML. It polls nvidia-smi in the background and displays live statistics (VRAM, Temperature, Load, Power, and Clocks) in an elegant, responsive grid.
Perfect for AI training dashboards, LLM hosting interfaces, or any Gradio app where users need to keep an eye on hardware resource consumption.
Inspired by the GPU monitoring widget from the Ostris AI-Toolkit
Features and Key Characteristics
- Real-time targeted updates with zero DOM flickering or flashing.
- Autonomous background polling using Gradio 6's
server_functions. - Light/dark theme support completely integrated with Gradio's native
--CSS variables. - Graceful fallback (Mock Data) if executed on a machine without
nvidia-smi(ideal for local development). - Responsive CSS Grid that automatically adapts the number of columns based on screen size.
- Dynamic colored icons via Lucide (temperature and utilization colors change based on thresholds).
- Configurable refresh rate and timestamp visibility.
Installation
pip install gradio-gpu-monitor
Usage
Note: Make sure to include the Lucide icon library in your gr.launch() head parameter for the icons to render correctly.
import gradio as gr
from gradio_gpu_monitor import GPUMonitor
# Load Lucide icons via CDN
head_html = """<script src="https://unpkg.com/lucide@latest"></script>"""
with gr.Blocks(head=head_html) as demo:
gr.Markdown("# 🎛️ System Dashboard")
# Simple initialization with default settings (1s refresh)
GPUMonitor()
demo.launch()
Check out the full example in the Hugging Face demo.
| Property | Type | Default | Description |
|---|---|---|---|
update_interval |
int |
1000 |
Polling interval in milliseconds (how often the GPU data refreshes). |
show_last_updated |
bool |
True |
Whether to display the "Last updated: HH:MM:SS" text in the header. |
label |
str | None |
None |
Optional label for the component. |
visible |
bool |
True |
Whether the component is visible on the screen. |
elem_id |
str | None |
None |
Custom HTML ID for targeting with CSS or JavaScript. |
elem_classes |
list[str] | str | None |
None |
Additional CSS classes applied to the component wrapper. |
Example with all properties
gpu_widget = GPUMonitor(
update_interval=2500, # Refresh every 2.5 seconds
show_last_updated=False, # Hide the clock text
label="Hardware Status", # Optional title context
visible=True,
elem_id="custom-gpu-monitor",
elem_classes=["my-custom-class"]
)
Metadata
Release files for gradio-gpu-monitor 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gradio_gpu_monitor-0.0.2.tar.gz | 7.2 kB | Without provenance | Details for gradio_gpu_monitor-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gradio_gpu_monitor-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for gradio_gpu_monitor-0.0.2-py3-none-any.whl |
Total release size: 18.4 kB
Release files / gradio_gpu_monitor-0.0.2.tar.gz
| Download URL | gradio_gpu_monitor-0.0.2.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65a343fcd5b6c6cce85f20481dabf240a6522456d5fb8d3b94dcb28b61c19847
|
|
BLAKE2b-256 checksum How to use checksums |
da23f2a6d2599ab50a15249050ae3544132be962d352281219d9f179b20d3600
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Release files / gradio_gpu_monitor-0.0.2-py3-none-any.whl
| Download URL | gradio_gpu_monitor-0.0.2-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e7e40f81115e5b0bdc146109f1f660393e322639f958b83f2735a64b349d611
|
|
BLAKE2b-256 checksum How to use checksums |
c680588a8b3b735d53981ef21b399fc5c08668b0b2e3a852811d6b19eb63ad32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Security for gradio-gpu-monitor 0.0.2
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.