Replace kelindar/search with hugot for static binary compatibility#50
Merged
Replace kelindar/search with hugot for static binary compatibility#50
Conversation
…y compatibility
kelindar/search uses ebitengine/purego which relies on fakecgo + dlopen, making
binaries dynamically linked even with CGO_ENABLED=0. This caused the panda-server
Docker image to crash on Alpine ("exec: no such file or directory") because the
binary needed glibc's dynamic linker.
Switch to knights-analytics/hugot with pure Go ONNX inference (NewGoSession) for
embedding generation. Replace kelindar's vector index with simple brute-force dot
product search over L2-normalized embeddings, which is sufficient for our corpus
size (thousands of documents).
- Swap GGUF model format for ONNX directory (model.onnx + tokenizer.json)
- Remove libllama build stage from Dockerfile
- Simplify Makefile (no more C++ compilation or LD_LIBRARY_PATH wrappers)
- Update goreleaser Dockerfile to download ONNX model from HuggingFace
- Bump Go to 1.25.0 (required by hugot)
288a809 to
fcc35c8
Compare
Savid
approved these changes
Mar 11, 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.
Summary
Swap out
kelindar/search(GGUF + llama.cpp via purego/fakecgo) forknights-analytics/hugotwith pure Go ONNX inference.kelindar/searchusesebitengine/puregowhich callsdlopenat runtime, producing dynamically linked binaries even withCGO_ENABLED=0— this crashes on Alpine with "exec: no such file or directory" because there's no glibc dynamic linker.hugot's
NewGoSession()gives us genuinely static binaries that run on Alpine without issues. Model format changes from a single GGUF file to an ONNX directory (model.onnx+tokenizer.json), downloaded from HuggingFace'ssentence-transformers/all-MiniLM-L6-v2. Vector search switches fromkelindar's index to brute-force dot product over L2-normalized embeddings — totally fine for our corpus size.Changes:
pkg/embedding/embedder.go— hugot session + FeatureExtractionPipeline with normalizationpkg/resource/example_index.go,runbook_index.go— inline vectors + dot product searchpkg/searchruntime/runtime.go— ONNX directory resolution instead of single file lookuppkg/config/config.go— dropGPULayersfield, defer model path resolution to searchruntimeDockerfile— remove llama-builder stage and libgomp1 dep, download ONNX modelgoreleaser.server.Dockerfile— add model-downloader stage for ONNX filesMakefile— replace cmake/g++ build with curl downloads