Skip to content

ONNX search provider - #39

Draft
ollieatkinson wants to merge 12 commits into
trunkfrom
oliver--onnx-search-spike
Draft

ONNX search provider#39
ollieatkinson wants to merge 12 commits into
trunkfrom
oliver--onnx-search-spike

Conversation

@ollieatkinson

@ollieatkinson ollieatkinson commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

Finishes the ONNX search spike into a narrow shippable shape for Linux/Android follow-up, with Windows left as the next runtime path.

  • Adds model-owned ONNX configuration for tokenizer identity, pooling, normalization, input/output names, and query/document prefixes.
  • Adds ONNX presets for MiniLM, BGE-small, GTE-small, and E5-small-v2.
  • Moves query/document prefixing behind provider role methods, so the search core does not hardcode model instructions.
  • Adds CLexiconONNXRuntime, a small C shim that dynamically loads ONNX Runtime for Linux/Android/Windows builds.
  • Extends the SwiftPM setup plugin to fetch model artifacts plus Linux, Android, and Windows runtime artifacts.
  • Keeps model comparison/evaluation outside the product CLI so the shipped surface remains small.
  • Updates README and search platform docs with setup commands, platform notes, and cache identity.

Validation

Latest local validation after merging current trunk:

  • swift build --product lexicon -Xswiftc -warnings-as-errors
  • swift build --product lexicon --traits MLXSearch -Xswiftc -warnings-as-errors
  • swift build --product lexicon --traits ONNXSearch -Xswiftc -warnings-as-errors
  • swift build --product lexicon --traits MLXSearch,ONNXSearch -Xswiftc -warnings-as-errors
  • swift test -Xswiftc -warnings-as-errors

Earlier spike validation also covered artifact setup:

  • swift package --disable-sandbox --allow-writing-to-package-directory setup-onnx-search-artifacts -- --preset all-MiniLM-L6-v2
  • swift package --disable-sandbox --allow-writing-to-package-directory setup-onnx-search-artifacts -- --skip-model --runtime linux-x64
  • swift package --disable-sandbox --allow-writing-to-package-directory setup-onnx-search-artifacts -- --skip-model --runtime android
  • swift package --disable-sandbox --allow-writing-to-package-directory setup-onnx-search-artifacts -- --preset bge-small-en-v1.5
  • swift package --disable-sandbox --allow-writing-to-package-directory setup-onnx-search-artifacts -- --preset gte-small
  • swift package --disable-sandbox --allow-writing-to-package-directory setup-onnx-search-artifacts -- --preset e5-small-v2

Cross-build attempts for Linux and Android reached the Lexicon ONNX/C shim sources, then stopped because the installed Swift SDKs were 6.3.1 while the host compiler was 6.3.2. The docs call out that the Swift SDK must match the host compiler version.

@ollieatkinson
ollieatkinson force-pushed the oliver--onnx-search-spike branch 2 times, most recently from 2ab9062 to 0f363bf Compare May 27, 2026 08:55
@ollieatkinson
ollieatkinson force-pushed the oliver--onnx-search-spike branch from e7e2481 to 6ec4cd3 Compare May 27, 2026 11:52
Base automatically changed from oliver--lexicon-search to trunk May 27, 2026 13:03
@ollieatkinson ollieatkinson changed the title Spike ONNX search provider ONNX search provider May 27, 2026
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