{"record":{"id":"4a0c55bf51313aec","repo":"moeru-ai/airi","slug":"webgpu-is-required-for-this-model-but-is-not-avail","errorCode":null,"errorMessage":"WebGPU is required for this model but is not available in your browser","messagePattern":"WebGPU is required for this model but is not available in your browser","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/stage-ui/src/libs/providers/providers/kokoro-local/index.ts","lineNumber":48,"sourceCode":"function getWebGpuState() {\n  const capabilities = getCachedWebGPUCapabilities()\n  return {\n    supported: capabilities?.supported ?? (typeof navigator !== 'undefined' && Boolean(navigator.gpu)),\n    fp16Supported: capabilities?.fp16Supported ?? false,\n  }\n}\n\nfunction getModel(modelId: string) {\n  return KOKORO_MODELS.find(model => model.id === modelId)\n}\n\nfunction assertModelSupported(modelId: string) {\n  const model = getModel(modelId)\n  if (!model)\n    throw new Error(`Invalid model: ${modelId}. Must be one of: ${KOKORO_MODELS.map(item => item.id).join(', ')}`)\n\n  if (model.platform === 'webgpu' && !getWebGpuState().supported)\n    throw new Error('WebGPU is required for this model but is not available in your browser')\n\n  return model\n}\n\nfunction progressInfo(progress: { file?: string, percent: number, loaded?: number, total?: number }): ProgressInfo {\n  return {\n    name: progress.file ?? '',\n    file: progress.file ?? '',\n    progress: progress.percent >= 0 ? progress.percent : 0,\n    status: 'progress',\n    loaded: progress.loaded ?? 0,\n    total: progress.total ?? 0,\n  }\n}\n\nlet lastLoadedModelId: string | null = null\n\nexport const providerKokoroLocal = defineProvider({","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/moeru-ai/airi/blob/677329427f32468c74b17f3ec47eeca4e05bec65/packages/stage-ui/src/libs/providers/providers/kokoro-local/index.ts#L30-L66","documentation":"After the model id check passes, assertModelSupported verifies platform capability: models marked platform 'webgpu' require getWebGpuState().supported, which is true only when navigator.gpu exists. The throw means the selected model needs WebGPU but the current browser context does not expose it.","triggerScenarios":"Firefox without WebGPU enabled; older Safari or Chromium builds predating WebGPU; page loaded over plain http on a non-localhost host, making the context insecure so navigator.gpu is undefined; GPU blocklisted or hardware acceleration disabled.","commonSituations":"Accessing a dev server from a phone or LAN IP over http; Firefox as the default browser; VMs or remote desktops without GPU passthrough; enterprise policies disabling GPU.","solutions":["Serve the app over https or use localhost so the context is secure","Switch to a Chromium-based browser (Chrome/Edge 113+) or a WebGPU-capable Safari","Select the non-WebGPU kokoro model variant instead","Re-enable hardware acceleration or clear the GPU blocklist flag"],"exampleFix":"// before\nmodel: 'kokoro-82m-webgpu' // selected in Firefox → throw\n\n// after\nconst webgpu = typeof navigator !== 'undefined' && Boolean(navigator.gpu)\nmodel: webgpu ? 'kokoro-82m-webgpu' : 'kokoro-82m' // wasm/onnx variant","handlingStrategy":"validation","validationCode":"const webgpuSupported = typeof navigator !== 'undefined' && Boolean(navigator.gpu)\nif (!webgpuSupported)\n  hideModelsWithPlatform('webgpu') // only offer runnable variants","typeGuard":null,"tryCatchPattern":"try {\n  assertModelSupported(modelId)\n}\ncatch (err) {\n  if (err.message.includes('WebGPU'))\n    modelId = KOKORO_MODELS.find(m => m.platform !== 'webgpu')!.id\n}","preventionTips":["Filter the model list by platform capability before selection","Default new users to the non-WebGPU variant","Warn when the app runs in an insecure context that disables WebGPU"],"tags":["kokoro","webgpu","browser-support","secure-context"],"backgroundTag":"webgpu-not-supported","analyzedSha":"677329427f32468c74b17f3ec47eeca4e05bec65","analyzedAt":"2026-08-18T17:29:58.153Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}