Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: make the web UI installable as a PWA (#13360)
Daniel Hane8b464c32ed5
diff --git a/studio/frontend/index.html b/studio/frontend/index.htmlindex 3d6fb70de9b..3ae8dda6379 100644--- a/studio/frontend/index.html+++ b/studio/frontend/index.html@@ -6,6 +6,7 @@<head><meta charset="UTF-8" /><link rel="icon" type="image/png" href="/favicon.png" />+ <link rel="manifest" href="/manifest.webmanifest" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Unsloth</title><!-- Classic boot scripts satisfy script-src 'self' and run before modules. -->diff --git a/studio/frontend/public/manifest.webmanifest b/studio/frontend/public/manifest.webmanifestnew file mode 100644index 00000000000..4d7ffb6bdea--- /dev/null+++ b/studio/frontend/public/manifest.webmanifest@@ -0,0 +1,24 @@+{+ "name": "Unsloth Studio",+ "short_name": "Unsloth",+ "id": "/",+ "start_url": "/",+ "scope": "/",+ "display": "standalone",+ "background_color": "#fefefd",+ "theme_color": "#fefefd",+ "icons": [+ {+ "src": "/pwa-192.png",+ "sizes": "192x192",+ "type": "image/png",+ "purpose": "any"+ },+ {+ "src": "/rounded-512.png",+ "sizes": "512x512",+ "type": "image/png",+ "purpose": "any"+ }+ ]+}diff --git a/studio/frontend/public/pwa-192.png b/studio/frontend/public/pwa-192.pngnew file mode 100644index 00000000000..5a655485985Binary files /dev/null and b/studio/frontend/public/pwa-192.png differdiff --git a/tests/studio/test_pwa_manifest.py b/tests/studio/test_pwa_manifest.pynew file mode 100644index 00000000000..8bada67b8a8--- /dev/null+++ b/tests/studio/test_pwa_manifest.py@@ -0,0 +1,42 @@+# SPDX-License-Identifier: AGPL-3.0-only+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++"""The Studio web UI stays installable as a PWA (#12262)."""++import json+from pathlib import Path+import re+import struct+++REPO = Path(__file__).resolve().parents[2]+FRONTEND = REPO / "studio/frontend"+PUBLIC = FRONTEND / "public"+++def png_size(path: Path) -> tuple[int, int]:+ data = path.read_bytes()+ assert data[:8] == b"\x89PNG\r\n\x1a\n", path+ return struct.unpack(">II", data[16:24])+++def test_index_links_the_manifest():+ html = (FRONTEND / "index.html").read_text(encoding = "utf-8")+ links = re.findall(r'<link\s+rel="manifest"\s+href="([^"]+)"', html)+ assert links == ["/manifest.webmanifest"]+++def test_manifest_meets_install_criteria():+ manifest = json.loads((PUBLIC / "manifest.webmanifest").read_text(encoding = "utf-8"))+ assert manifest["name"] and manifest["short_name"]+ assert manifest["start_url"] == "/"+ assert manifest["display"] == "standalone"++ # Chromium needs a 192px and a 512px icon it can fetch from the build.+ sizes = set()+ for icon in manifest["icons"]:+ assert icon["src"].startswith("/") and icon["type"] == "image/png"+ width, height = png_size(PUBLIC / icon["src"].lstrip("/"))+ assert icon["sizes"] == f"{width}x{height}"+ sizes.add(width)+ assert {192, 512} <= sizes