A simple cross‑platform app to explore tensor model files.
- Open supported model files
- Browse tensors and metadata
- See tensor names, shapes, and dtypes
- View basic stats and details
- Works on Desktop (JVM), Web, Android, and iOS
BAsed on idea from https://github.com/ericlbuehler/safetensors_explorer
App with mock data
You can try tensors‑eKsplorer in the browser — no install required:
The site is built from the WASM/JS target and published via GitHub Pages.
There are two common ways to run the app locally: with Gradle (recommended for development) or with Docker.
Prerequisites:
- JDK 17+
- Git and the Gradle wrapper (included)
Commands:
- Run the WASM dev server (fast iteration):
./gradlew :composeApp:wasmJsBrowserDevelopmentRun
This starts a local dev server (default http://localhost:8080) and hot‑reloads on changes.
- Alternatively, run the JS dev server:
./gradlew :composeApp:jsBrowserDevelopmentRun
- Build a static production bundle (to host anywhere):
./gradlew :composeApp:wasmJsBrowserDistribution
The static site will be generated under one of:
composeApp/build/dist/wasmJs/productionExecutable/
If you prefer not to install JDK/Gradle locally, you can use Docker. Below are two Dockerfile variants — pick one that fits your workflow.
Create a file named Dockerfile.dev with:
# syntax=docker/dockerfile:1
FROM gradle:8.10.2-jdk17 AS dev
WORKDIR /app
# Copy only Gradle descriptors first for better layer caching
COPY settings.gradle.kts build.gradle.kts ./
COPY gradle.properties ./
COPY gradle ./gradle
# Copy source
COPY composeApp ./composeApp
COPY shared ./shared
# Expose the default dev server port
EXPOSE 8080
# Run the WASM dev server
CMD ["gradle", ":composeApp:wasmJsBrowserDevelopmentRun"]
Build and run:
docker build -f Dockerfile.dev -t tensors-eksplorer-dev .
docker run --rm -it -p 8080:8080 tensors-eksplorer-dev
Note: the dev image runs Gradle’s dev server; for live code editing with instant reloads, mount your local project into the container (-v "$PWD:/app").
Create Dockerfile with a multi‑stage build:
# syntax=docker/dockerfile:1
FROM gradle:8.10.2-jdk17 AS build
WORKDIR /src
COPY . .
RUN gradle :composeApp:wasmJsBrowserDistribution --no-daemon
FROM nginx:1.27-alpine AS runtime
COPY --from=build /src/composeApp/build/dist/wasmJs/productionExecutable /usr/share/nginx/html
EXPOSE 80
Build and run:
docker build -t tensors-eksplorer-web .
docker run --rm -p 8080:80 tensors-eksplorer-web
If your Gradle/Kotlin plugin writes the bundle to a slightly different path, adjust the COPY line accordingly (e.g. to /src/composeApp/build/dist/wasmJs/).
Tips
- For local files/models in the web app, you typically use the browser file picker; the app does not upload files to a server.
- For platform‑specific builds (Desktop/Android/iOS), see the Gradle tasks and source sets under
composeApp/andshared/.
