Reusable llama.cpp web bridge runtime (JS + WASM).
This repository provides:
src/llama_webgpu_core.cpp(native bridge core)js/llama_webgpu_bridge.js(JS runtime wrapper)CMakeLists.txtfor Emscripten builds
Requirements:
- Emscripten SDK (
emcmake,emcc) inPATH - llama.cpp source checkout
Build command:
./scripts/build_bridge.shUseful environment variables:
LLAMA_CPP_DIR(path to llama.cpp source)BUILD_DIR(cmake build dir)OUT_DIR(output directory; defaults todist/)
Build outputs:
dist/llama_webgpu_bridge.jsdist/llama_webgpu_core.jsdist/llama_webgpu_core.wasm
This repo includes a wasm build gate in:
.github/workflows/ci.yml
It builds against pinned llama.cpp tag b8011 and uploads build artifacts.
Published, versioned artifacts are consumed from:
leehack/llama-web-bridge-assets
Publish workflow:
.github/workflows/publish_assets.yml
Required repository secret:
WEBGPU_BRIDGE_ASSETS_PAT(token with write access toleehack/llama-web-bridge-assets)
Example publish:
- Run
Publish Bridge Assetsworkflow - Inputs:
assets_tag:v0.1.1assets_repo:leehack/llama-web-bridge-assetsllama_cpp_tag:b8011
After publish, assets are CDN-available at:
https://cdn.jsdelivr.net/gh/leehack/llama-web-bridge-assets@v0.1.1/llama_webgpu_bridge.jshttps://cdn.jsdelivr.net/gh/leehack/llama-web-bridge-assets@v0.1.1/llama_webgpu_core.jshttps://cdn.jsdelivr.net/gh/leehack/llama-web-bridge-assets@v0.1.1/llama_webgpu_core.wasm