Repository navigation
Export an in-process LiteRT marker from the runtime bridge - #115
Merged
Merged
Conversation
Consumers cannot tell C API 1.0 runtimes whose desktop hosts load the prebuilt libLiteRt from ones that compile LiteRT in (#111), because both report the same upstream API version. Every runtime now exports litert_lm_native_in_process_litert_abi_version(): 1 for v0.19+ builds, whose linkage the build now verifies on every platform, else 0. Also covers the #113 linkage-check test gap and the stale CPU options decision message. Refs #113
leehack
added a commit
that referenced
this pull request
Nov 8, 2026
This was referenced Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
int32_t litert_lm_native_in_process_litert_abi_version(void)to the LiteRtLmBridge exports on every platform, so consumers can tell runtimes whose LiteRT-LM → LiteRT external-weight handoff is ABI-valid from the v0.16–v0.19.1 Linux/Windows hosts that load upstream's prebuiltlibLiteRt(#111). Today a consumer can't: v0.19.0, v0.19.1 and v0.19.1-1 all report upstream C API 1.0 (llamadart#1795).Contract
libLiteRtlitert_lm_get_api_versionstays upstream's.v0.19.1-1lack it.v0.19.1-1already links LiteRT in-process, so a consumer that must accept it identifies it another way (e.g. a pinned checksum).Documented in
docs/platform_strategy.md.Changes
--define=litert_lm_in_process_litert=true(→LITERT_LM_IN_PROCESS_LITERT), whichbuild_upstream_runtime.pypasses for v0.19+.LiteRt.framework). Before, it covered Linux and Windows only. Published v0.19.1-1 Android, macOS and iOS hosts were inspected and import nolibLiteRt.litert_lm_finish_reason_smoke.py --abi-onlyalso checks the marker value of the built Linux x64, macOS arm64 and Windows x64 runtimes in PR CI.main()'s duplicated validation calls move intovalidate_runtime(). A new test fails on both build paths if the linkage check is dropped.libLiteRt.Validation
python3 -m unittest discover -s tools -p 'test_*.py': 445 OK, 3 skipped.diagnosticstests pass.validate_runtimevalidate_runtimecall inmain()LITERT_LM_IN_PROCESS_LITERTRefs #113. Items 1, 2 and 5 stay open (see the comment on #113). Item 3 was done in #114.