File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # AGENTS.md
2+
3+ Guidance for coding agents working in ` llama-web-bridge ` .
4+
5+ ## Scope and Ownership
6+
7+ - This repository owns WebGPU bridge source/runtime build for llama.cpp web.
8+ - It publishes versioned assets to ` llama-web-bridge-assets ` via workflow.
9+ - ` llamadart ` consumes those published assets.
10+
11+ ## Related Repositories
12+
13+ Common maintainer sibling layout:
14+
15+ ``` text
16+ ../llamadart
17+ ../llamadart-native
18+ ../llama-web-bridge
19+ ../llama-web-bridge-assets
20+ ```
21+
22+ ## Build Commands
23+
24+ ``` bash
25+ ./scripts/build_bridge.sh
26+ ```
27+
28+ Useful environment overrides:
29+
30+ - ` LLAMA_CPP_DIR `
31+ - ` BUILD_DIR `
32+ - ` OUT_DIR `
33+ - ` CMAKE_BUILD_TYPE `
34+
35+ ## CI / Release
36+
37+ - CI build gate: ` .github/workflows/ci.yml `
38+ - Publish workflow: ` .github/workflows/publish_assets.yml `
39+ - Requires ` WEBGPU_BRIDGE_ASSETS_PAT `
40+ - Pushes assets + tag to ` llama-web-bridge-assets `
41+
42+ ## Change Boundaries
43+
44+ - Keep runtime bridge code in ` js/ ` and ` src/ ` .
45+ - Keep publishing logic in workflow only.
46+ - Do not edit assets repository files from here outside publish flow.
47+
48+ ## Cross-Repo Handoff to ` llamadart `
49+
50+ After publishing assets tag:
51+
52+ 1 . Update/fetch pinned bridge assets in ` llamadart ` :
53+ ` WEBGPU_BRIDGE_ASSETS_TAG=<tag> ./scripts/fetch_webgpu_bridge_assets.sh `
54+ 2 . Update docs/changelog in ` llamadart ` if behavior changed.
Original file line number Diff line number Diff line change 1+ # Contributing to llama-web-bridge
2+
3+ Thanks for contributing.
4+
5+ ## Purpose
6+
7+ This repo builds the reusable JS/WASM bridge runtime for llama.cpp web usage.
8+ Published artifacts are consumed from ` llama-web-bridge-assets ` .
9+
10+ ## Prerequisites
11+
12+ - Emscripten SDK (` emcmake ` , ` emcc ` )
13+ - CMake toolchain
14+ - Access to a llama.cpp checkout
15+
16+ ## Setup
17+
18+ ``` bash
19+ git clone https://github.com/leehack/llama-web-bridge.git
20+ cd llama-web-bridge
21+ ./scripts/build_bridge.sh --help
22+ ```
23+
24+ ## Local Build
25+
26+ ``` bash
27+ ./scripts/build_bridge.sh
28+ # or
29+ LLAMA_CPP_DIR=../llama.cpp OUT_DIR=dist ./scripts/build_bridge.sh
30+ ```
31+
32+ ## Validate Outputs
33+
34+ Expected files:
35+
36+ - ` dist/llama_webgpu_bridge.js `
37+ - ` dist/llama_webgpu_core.js `
38+ - ` dist/llama_webgpu_core.wasm `
39+
40+ ## Publish Process
41+
42+ Use workflow ` .github/workflows/publish_assets.yml ` :
43+
44+ 1 . Set input ` assets_tag ` (new tag).
45+ 2 . Optionally set ` assets_repo ` and ` llama_cpp_tag ` .
46+ 3 . Ensure ` WEBGPU_BRIDGE_ASSETS_PAT ` secret is configured.
47+ 4 . Workflow builds, generates ` manifest.json ` /` sha256sums.txt ` , pushes to
48+ assets repo, and creates matching tag there.
49+
50+ ## Repository Boundaries
51+
52+ - Bridge runtime source/build belongs here.
53+ - Versioned static artifacts belong in ` llama-web-bridge-assets ` .
54+ - Consumer integration (loading/fallback behavior) belongs in ` llamadart ` .
Original file line number Diff line number Diff line change @@ -69,3 +69,8 @@ After publish, assets are CDN-available at:
6969- ` https://cdn.jsdelivr.net/gh/leehack/llama-web-bridge-assets@v0.1.1/llama_webgpu_bridge.js `
7070- ` https://cdn.jsdelivr.net/gh/leehack/llama-web-bridge-assets@v0.1.1/llama_webgpu_core.js `
7171- ` https://cdn.jsdelivr.net/gh/leehack/llama-web-bridge-assets@v0.1.1/llama_webgpu_core.wasm `
72+
73+ ## Maintainer Docs
74+
75+ - ` AGENTS.md ` : agent workflow and cross-repo handoff
76+ - ` CONTRIBUTING.md ` : contributor setup/build/publish steps
You can’t perform that action at this time.
0 commit comments