Skip to content
cccskills
FreePublished on GitHub

local-slm-edge-ai-expert

Expert guide for Local Small Language Models (SLMs) and Edge AI execution — WebLLM, Transformers.js v3, ONNX Runtime Web, WebGPU, and zero-latency local embeddings / Panduan ahli SLM lokal dan AI edge di browser.

The English summary is being prepared. Showing the original description.

Works withHugging Face

Run score Not tested

See how to install

Files included (1)

  • SKILL.md7.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Local SLM & Edge AI Expert (WebGPU & In-Browser Intelligence)

English | Bahasa Indonesia


<a name="english"></a>

English

Orchestration & Integration

  • Model Routing & Cost Optimization: llm-finops-router, adaptive-model-cascade, frontier-ai-models-expert
  • Edge Runtimes & Frontend: senior-frontend, pwa-offline-first-expert, wasm-edge-computing-expert
  • Local Vectors & RAG: vector-db-rag-expert, agentic-memory-architect, session-memory-manager
  • Privacy & Safety Guardrails: compliance-gdpr-privacy-expert, ai-safety-governance-expert, zero-trust-secret-vault
  • Lifecycle & Governance: zero-to-prod-orchestrator, anti-slop

Purpose & Overview

Production-grade architectural guide for running Small Language Models (SLMs) and embedding models directly inside client browsers and edge runtimes. Eliminates cloud API costs, guarantees 100% data privacy (zero cloud data leakage), and enables instant, offline-capable AI features using WebGPU, Transformers.js v3, WebLLM, and ONNX Runtime Web.

Key Capabilities

  1. Client-Side Model Execution: Running quantized 1B–4B SLMs (Llama 3.2 1B/3B, Gemma 2 2B, Phi-3.5 Mini, Qwen 2.5 1.5B/3B) entirely inside the user's browser via WebGPU.
  2. In-Browser Embeddings: Fast client-side vector embeddings with models like all-MiniLM-L6-v2 or bge-small-en-v1.5 using Transformers.js v3.
  3. Hybrid Edge-Cloud Fallback: Gracefully falling back to server-side LLMs when client hardware lacks WebGPU or sufficient VRAM.
  4. Zero-Latency PII Masking: Anonymizing sensitive user data locally on the client before sending queries to external LLMs.

Production Implementation Recipes

Recipe 1: In-Browser Semantic Embedding Generation with Transformers.js v3

import { pipeline, env } from '@huggingface/transformers';

// Configure cache and worker settings
env.allowLocalModels = false;
env.useBrowserCache = true;

let embedder: any = null;

export async function getLocalEmbedding(text: string): Promise<number[]> {
  if (!embedder) {
    embedder = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2', {
      dtype: 'fp32',
      device: 'webgpu', // Accelerate via WebGPU if supported
    });
  }

  const output = await embedder(text, { pooling: 'mean', normalize: true });
  return Array.from(output.data);
}

Recipe 2: WebLLM In-Browser Chat Assistant with WebGPU

import * as webllm from '@mlc-ai/web-llm';

export async function createLocalChatEngine(onProgress?: (report: webllm.InitProgressReport) => void) {
  // Check WebGPU compatibility
  if (!('gpu' in navigator)) {
    throw new Error('WebGPU is not supported in this browser. Fallback to cloud API.');
  }

  const selectedModel = 'Llama-3.2-1B-Instruct-q4f32_1-MLC';

  const engine = await webllm.CreateMLCEngine(selectedModel, {
    initProgressCallback: onProgress,
  });

  return {
    generateResponse: async (prompt: string): Promise<string> => {
      const reply = await engine.chat.completions.create({
        messages: [{ role: 'user', content: prompt }],
        temperature: 0.2,
      });
      return reply.choices[0]?.message.content || '';
    },
  };
}

Implementation Checklist

  • Implement browser feature detection ('gpu' in navigator) before initiating WebGPU model loads.
  • Provide a transparent download progress bar when fetching model weights on initial visit.
  • Cache model shards in IndexedDB or Cache API to ensure instant subsequent launches.
  • Provide automatic fallback to lightweight serverless APIs when client device VRAM is constrained.

<a name="bahasa-indonesia"></a>

Bahasa Indonesia

Integrasi Orkestrasi

  • Perutean Model & Optimasi Biaya: llm-finops-router, adaptive-model-cascade, frontier-ai-models-expert
  • Runtime Edge & Frontend: senior-frontend, pwa-offline-first-expert, wasm-edge-computing-expert
  • Vektor Lokal & RAG: vector-db-rag-expert, agentic-memory-architect, session-memory-manager
  • Privasi & Guardrail Keamanan: compliance-gdpr-privacy-expert, ai-safety-governance-expert, zero-trust-secret-vault
  • Siklus Hidup & Tata Kelola: zero-to-prod-orchestrator, anti-slop

Tujuan & Gambaran Umum

Panduan arsitektur tingkat produksi untuk menjalankan Small Language Models (SLM) dan model embedding langsung di dalam browser pengguna dan runtime edge. Menghilangkan biaya API cloud, menjamin privasi data 100% (tidak ada data yang keluar ke server pihak ketiga), dan mengaktifkan fitur AI instan yang dapat bekerja secara offline menggunakan WebGPU, Transformers.js v3, WebLLM, dan ONNX Runtime Web.

Kemampuan Utama

  1. Eksekusi Model di Sisi Klien: Menjalankan SLM terkuantisasi 1B–4B (Llama 3.2 1B/3B, Gemma 2 2B, Phi-3.5 Mini, Qwen 2.5) sepenuhnya di dalam browser pengguna dengan akselerasi WebGPU.
  2. Embedding Vektor di Browser: Pembuatan vektor semantik secepat kilat menggunakan Transformers.js v3 (all-MiniLM-L6-v2 atau bge-small).
  3. Fallback Hibrida Klien-Cloud: Mengalihkan tugas ke server secara otomatis jika perangkat klien tidak mendukung WebGPU atau memiliki VRAM terbatas.
  4. Penyensoran PII Tanpa Latensi: Mengaburkan data pribadi sensitif secara lokal di perangkat klien sebelum diteruskan ke cloud.

Resep Implementasi Produksi

Resep 1: Pembuatan Embedding Vektor di Browser dengan Transformers.js v3

import { pipeline, env } from '@huggingface/transformers';

env.allowLocalModels = false;
env.useBrowserCache = true;

let modelEmbedding: any = null;

export async function buatEmbeddingLokal(teks: string): Promise<number[]> {
  if (!modelEmbedding) {
    modelEmbedding = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2', {
      dtype: 'fp32',
      device: 'webgpu',
    });
  }

  const hasil = await modelEmbedding(teks, { pooling: 'mean', normalize: true });
  return Array.from(hasil.data);
}

Resep 2: Asisten AI di Browser dengan WebLLM & WebGPU

import * as webllm from '@mlc-ai/web-llm';

export async function inisialisasiMesinLokal(laporanProgres?: (laporan: webllm.InitProgressReport) => void) {
  if (!('gpu' in navigator)) {
    throw new Error('WebGPU tidak didukung pada browser ini. Alihkan ke API cloud.');
  }

  const modelTerpilih = 'Llama-3.2-1B-Instruct-q4f32_1-MLC';

  const mesin = await webllm.CreateMLCEngine(modelTerpilih, {
    initProgressCallback: laporanProgres,
  });

  return {
    kirimPesan: async (pertanyaan: string): Promise<string> => {
      const balasan = await mesin.chat.completions.create({
        messages: [{ role: 'user', content: pertanyaan }],
        temperature: 0.2,
      });
      return balasan.choices[0]?.message.content || '';
    },
  };
}

Checklist Implementasi

  • Deteksi ketersediaan WebGPU ('gpu' in navigator) sebelum memuat model.
  • Tampilkan indikator progres unduhan bobot model saat pertama kali diakses.
  • Simpan bobot model di Cache API atau IndexedDB agar kunjungan berikutnya instan tanpa unduh ulang.
  • Siapkan jalur fallback ke API cloud jika memori klien tidak mencukupi.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Expert guide for Agent-to-Agent (A2A) Protocol interoperability, /.well-known/agent.json Agent Cards, cross-vendor swarm task negotiation, and bridging A2A with Model Context Protocol (MCP) / Panduan ahli protokol interoperabilitas antar-agen (A2A), Agent Cards, dan integrasi A2A + MCP.

The English summary is being prepared. Showing the original description.

roedyrustam/vibes-plug113Updated Oct 23, 2026

Expert guide for automated and manual Web Accessibility (a11y) testing — axe-core, Pa11y, Playwright a11y, screen reader testing, and WCAG 2.2 Level AA/AAA compliance / Panduan ahli pengujian aksesibilitas web.

The English summary is being prepared. Showing the original description.

roedyrustam/vibes-plug113Updated Oct 23, 2026

Expert guide for intelligent model cascading and routing — complexity-scored task routing from Fast (Composer 2.5, Grok 4.7/4.6) to Medium (Gemini 4 Argon, GPT-5.6 Sol, Claude Opus 5.5) and High (Claude Sonnet 5.5, Claude Fable 5.1, Muse Wonder) / Panduan ahli untuk kaskade dan routing model cerdas.

The English summary is being prepared. Showing the original description.

roedyrustam/vibes-plug113Updated Oct 23, 2026

Expert guide for intelligent model cascading and routing — complexity-scored task routing from Flash/Haiku to Sonnet/Opus/Astra, dynamic escalation with quality gates, 40-60% token cost reduction while maintaining output quality / Panduan ahli untuk kaskade dan routing model cerdas — routing tugas berbasis skor kompleksitas dari Flash/Haiku ke Sonnet/Opus/Astra, eskalasi dinamis dengan gerbang kualitas, pengurangan biaya token 40-60% dengan kualitas output terjaga.

The English summary is being prepared. Showing the original description.

roedyrustam/vibes-plug113Updated Oct 23, 2026

Master guide for Affective Computing, emotional AI, and real-time sentiment analysis through native multimodal tokens (voice intonation and facial micro-expressions) / Panduan utama komputasi afektif, AI emosional, dan analisis sentimen real-time melalui token multimodal native.

The English summary is being prepared. Showing the original description.

roedyrustam/vibes-plug113Updated Oct 23, 2026

Expert guide for Affective Computing, emotional AI, and real-time sentiment analysis through native multimodal tokens (voice intonation and facial micro-expressions) / Panduan ahli komputasi afektif, AI emosional, dan analisis sentimen real-time melalui token multimodal native.

The English summary is being prepared. Showing the original description.

roedyrustam/vibes-plug113Updated Oct 23, 2026

See all skills by roedyrustam

Report a problem with this skill