Skip to content

Rename StreamProxy helper to LiteRtLmBridge#8

Merged
leehack merged 2 commits into
mainfrom
rename-streamproxy-to-bridge
Jun 8, 2026
Merged

Rename StreamProxy helper to LiteRtLmBridge#8
leehack merged 2 commits into
mainfrom
rename-streamproxy-to-bridge

Conversation

@leehack

@leehack leehack commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Rename the downstream helper concept from StreamProxy to LiteRtLmBridge in docs and packaging scripts.
  • Move the helper source to native/bridge/litert_lm_bridge.c and keep the exported stream_proxy_* symbols unchanged for downstream ABI compatibility.
  • Add a repo-owned native/bridge/BUILD.bazel package that defines the shared LiteRT-LM runtime targets with embedded bridge symbols.
  • Make tools/build_upstream_runtime.py build //bridge:* through Bazel --package_path=<repo native dir>:<upstream source>, so source-built runtimes no longer copy files into upstream or edit upstream c/BUILD, WORKSPACE, or patch files.
  • Replace existing staged artifacts by unlinking before copy so read-only local runtime files do not break rebuilds.
  • Refresh docs/current_upstream.md to the latest upstream v0.13.1 metadata reported by the repo tooling.

Validation

  • macOS arm64 local source build:
    • python3 tools/build_upstream_runtime.py --upstream-tag local --platform macos --arch arm64 --source-root /opt/UnitySrc/personal/llama/LiteRT-LM-text-lora-resource-manager --jobs=4
    • Built //bridge:libLiteRtLm.dylib through --package_path.
    • Validated LiteRT-LM C API plus stream_proxy_* bridge symbols.
    • Staged bin/macos/arm64/libLiteRtLm.dylib.
  • macOS x64 local source build:
    • python3 tools/build_upstream_runtime.py --upstream-tag local --platform macos --arch x64 --source-root /opt/UnitySrc/personal/llama/LiteRT-LM-text-lora-resource-manager --jobs=4
    • Built and linked //bridge:libLiteRtLm.dylib through --package_path.
    • Validated LiteRT-LM C API plus stream_proxy_* bridge symbols.
    • Staged bin/macos/x64/libLiteRtLm.dylib.
  • Android arm64 local source build with NDK r28c:
    • ANDROID_NDK_HOME="$HOME/Library/Android/sdk/ndk/28.2.13676358" python3 tools/build_upstream_runtime.py --upstream-tag local --platform android --arch arm64 --source-root /opt/UnitySrc/personal/llama/LiteRT-LM-text-lora-resource-manager --jobs=4
    • Built and linked //bridge:libLiteRtLm.so through --package_path.
    • Validated LiteRT-LM C API plus stream_proxy_* bridge symbols.
    • Staged libLiteRtLm.so, libGemmaModelConstraintProvider.so, and libLiteRt.so.
  • Android x64 local source build with NDK r28c:
    • ANDROID_NDK_HOME="$HOME/Library/Android/sdk/ndk/28.2.13676358" python3 tools/build_upstream_runtime.py --upstream-tag local --platform android --arch x64 --source-root /opt/UnitySrc/personal/llama/LiteRT-LM-text-lora-resource-manager --jobs=4
    • Built and linked //bridge:libLiteRtLm.so through --package_path.
    • Validated LiteRT-LM C API plus stream_proxy_* bridge symbols.
    • Staged libLiteRtLm.so, libGemmaModelConstraintProvider.so, and libLiteRt.so.
  • Linux arm64 Docker source build:
    • docker run --platform linux/arm64 ... python3 tools/build_upstream_runtime.py --upstream-tag local --platform linux --arch arm64 --source-root /work/LiteRT-LM --jobs=4 && python3 tools/validate_runtime_dependencies.py
    • Built and linked //bridge:libLiteRtLm.so through --package_path from a container-local copy of both repos.
    • Validated LiteRT-LM C API plus stream_proxy_* bridge symbols.
    • Staged libLiteRtLm.so, libGemmaModelConstraintProvider.so, and libLiteRt.so in the container copy.
    • Dependency validation passed for 3 ELF libraries.
  • Linux x64 Docker source build under linux/amd64 emulation:
    • docker run --platform linux/amd64 ... python3 tools/build_upstream_runtime.py --upstream-tag local --platform linux --arch x64 --source-root /work/LiteRT-LM --jobs=4 && python3 tools/validate_runtime_dependencies.py
    • Built and linked //bridge:libLiteRtLm.so through --package_path from a container-local copy of both repos.
    • Validated LiteRT-LM C API plus stream_proxy_* bridge symbols.
    • Staged libLiteRtLm.so, libGemmaModelConstraintProvider.so, and libLiteRt.so in the container copy.
    • Dependency validation passed for 3 ELF libraries.
  • llamadart macOS arm64 consumer smoke using the locally staged PR runtime:
    • LLAMADART_LITERT_LM_LIB_DIR=/opt/UnitySrc/personal/llama/litert-lm-native/bin/macos/arm64 dart run tool/litert_lm_engine_smoke.dart /opt/UnitySrc/personal/llama/LiteRT-LM-text-lora-resource-manager/runtime/testdata/test_lm.litertlm cpu 'What is 2+2? Answer only with the number.' 4 1024
    • Loaded the PR-built libLiteRtLm.dylib, initialized the LiteRT-LM CPU backend, loaded a .litertlm model fixture, tokenized/detokenized, and streamed 4 generated tokens through llamadart.
  • python3 tools/validate_runtime_dependencies.py passed in the host checkout for the locally staged Android ELF libraries.
  • python3 -m py_compile tools/runtime_dependency_utils.py tools/fetch_upstream.py tools/build_upstream_runtime.py tools/package_release.py tools/validate_artifacts.py tools/package_upstream_prebuilts.py tools/package_official_release_assets.py tools/package_ios_runtime.py tools/package_apple_xcframeworks.py tools/validate_runtime_artifacts.py tools/validate_runtime_dependencies.py tools/validate_release_manifest.py
  • cc -std=c11 -Wall -Wextra -fsyntax-only native/bridge/litert_lm_bridge.c
  • node web/src/index.js --self-test
  • python3 tools/package_release.py --upstream-tag v0.12.0 && python3 tools/validate_artifacts.py completed with the local artifact cache; generated metadata was restored because artifact-cache churn is not part of this PR.
  • Temporary prebuilt packaging probe for v0.13.1 in a throwaway repo copy:
    • python3 tools/package_upstream_prebuilts.py --upstream-tag v0.13.1 --clean
    • Copied 38 upstream prebuilt files.
    • rg "version https://git-lfs.github.com/spec/v1" bin -S found 0 Git LFS pointer files.
  • python3 tools/fetch_upstream.py --latest --metadata-only resolved upstream v0.13.1 and was used to refresh docs/current_upstream.md.
  • git diff --check

Not run:

  • Windows source build. This still needs GitHub Actions or a Windows machine.
  • Full release-artifact completeness validation in this host checkout. python3 tools/validate_runtime_artifacts.py --upstream-tag v0.13.1 currently fails locally because the Linux Docker artifacts were intentionally isolated from the host checkout, the Windows runtime is absent, and dist/official/v0.13.1/CLiteRTLM.xcframework.zip is not staged locally.
  • iOS source build is not applicable to this bridge change; the repo packages iOS from upstream official CLiteRTLM.xcframework assets.

@leehack leehack force-pushed the rename-streamproxy-to-bridge branch from 936887d to ebb2509 Compare June 8, 2026 16:06
@leehack leehack marked this pull request as ready for review June 8, 2026 19:09
@leehack leehack merged commit 945ba69 into main Jun 8, 2026
2 checks passed
@leehack leehack deleted the rename-streamproxy-to-bridge branch June 8, 2026 19:21
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