feat: production-grade bring-your-own-model (BYO) support - #733
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-insensitive Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…dlock Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
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.
Spec B Part A — make
add_custom_modelproduction-grade so any ONNX-able embedding model can be plugged in. Qwen3 stays the only built-in.Bug fixes (verified file:line)
CustomTextEmbedding,PooledEmbedding,PooledNormalizedEmbeddingignored**kwargs) —embed(..., dim=256)now truncates (pool → truncate → normalize, matching Qwen3).parallel>1— registration lived in class vars (POSTPROCESSING_MAPPING/SUPPORTED_MODELS) that don't survive a spawned worker →KeyError. Folded pooling/normalization onto a new frozenCustomDenseModelDescription, keyed the registry case-insensitively, and propagated it to workers via a polymorphic_extra_worker_params()hook.Features
CustomModelSpec— one-call BYO registration (CustomModelSpec(...).register()).qwen3_embed.export.export_to_onnx()— optional HF-id→ONNX helper (lazy imports torch/optimum; NOT a packaged extra because the export deps don't co-resolve with the leantokenizers/huggingface-hubpins — documented manual install).NOTICE— retains fastembed (Qdrant) Apache-2.0 attribution (was missing).Tests
test_custom_registry_survives_serialization. The end-to-endparallel=2integration test isskipif(win32)(Windows multiprocessing+onnxruntime spawn deadlocks under pytest — runs on Linux).Notes: custom INT8 models score per-row (batched INT8 isn't batch-invariant — Spec A Part 2 finding).
🤖 Generated with Claude Code