Skip to content

feat: add ondeviceml.space — browser-based on-device AI inference#2141

Open
abhid1234 wants to merge 1 commit intohuggingface:mainfrom
abhid1234:add-ondeviceml-local-app
Open

feat: add ondeviceml.space — browser-based on-device AI inference#2141
abhid1234 wants to merge 1 commit intohuggingface:mainfrom
abhid1234:add-ondeviceml-local-app

Conversation

@abhid1234
Copy link
Copy Markdown

@abhid1234 abhid1234 commented May 5, 2026

What this adds

Registers ondeviceml.space as a local app for Gemma and Qwen2 transformer models.

ondeviceml.space is a client-side-only AI gallery: models run entirely in the browser via WebGPU / WASM (MediaPipe Tasks GenAI runtime). No server, no install, no account — the model weights download once to the browser cache and all inference stays on-device.

Deep-link behavior

When a user clicks "Open in ondeviceml.space" from a model page, the URL

https://ondeviceml.space/?hf_model=google/gemma-3n-E2B-it&task=image-text-to-text

lands on the Gallery page, which:

  1. Matches the hf_model param against the local catalog
  2. Shows a confirmation banner: [ Gemma 3n E2B → Chat ] [ Load & Open ] [ Dismiss ]
  3. Downloads the model weights (first visit only; cached via browser storage after)
  4. Navigates to the matched feature

The deep-link intake is live on production — you can test it now:

https://ondeviceml.space/?hf_model=google/gemma-3n-E2B-it&task=image-text-to-text
https://ondeviceml.space/?hf_model=Qwen/Qwen2.5-1.5B-Instruct&task=text-generation

displayOnModelPage logic

Shows only for transformers-library models with text-generation or image-text-to-text pipeline whose model_type is one of gemma3n, gemma4, gemma3, qwen2 — the architectures validated to run via MediaPipe in-browser. Happy to expand or tighten the list based on your feedback.

Catalog today

Model HF pipeline_tag Browser runtime
Qwen/Qwen2.5-1.5B-Instruct text-generation WebGPU/WASM
google/gemma-3n-E2B-it image-text-to-text WebGPU/WASM
google/gemma-4-E2B-it image-text-to-text WebGPU/WASM
google/gemma-3n-E4B-it image-text-to-text WebGPU/WASM

Checklist

  • Deep-link is live and tested on production
  • displayOnModelPage targets only supported model types
  • No snippet needed — the deeplink opens a web URL directly
  • No macOS-only flag — works on any browser with WebGPU support (Chrome 113+, Edge)

Note

Low Risk
Low risk: adds a new LOCAL_APPS entry and display gating logic plus an external deeplink URL; no existing execution paths or core inference logic are modified.

Overview
Adds ondeviceml.space to the LOCAL_APPS registry so supported Hugging Face model pages can show an “Open in ondeviceml.space” option.

The new entry is only shown for transformers models with text-generation or image-text-to-text pipelines whose config.model_type starts with one of gemma3n, gemma4, gemma3, or qwen2, and it deep-links to https://ondeviceml.space/?hf_model=...&task=....

Reviewed by Cursor Bugbot for commit fcba75d. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fcba75d. Configure here.

return (
model.library_name === "transformers" &&
(model.pipeline_tag === "text-generation" || model.pipeline_tag === "image-text-to-text") &&
supportedModelTypes.some((t) => model.config?.model_type?.startsWith(t))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefix allows unsupported architectures

Medium Severity

startsWith broadens the allow-list, so distinct architectures like qwen2_5_vl pass the qwen2 check. The button can appear for models outside the ondeviceml catalog or validated runtime, producing deeplinks the site cannot load.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fcba75d. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant