qdrant-model-migration
Skill này làm gì
Hướng dẫn này giúp bạn đổi mô hình embedding (cách dữ liệu được chuyển thành số để tìm kiếm) trong Qdrant mà không gián đoạn dịch vụ. Nó giải thích cách chuyển dữ liệu sang mô hình mới mà ứng dụng không phải ngừng hoạt động.
Khi nào nên dùng
- ✓Khi bạn muốn đổi mô hình chuyển văn bản thành số.
- ✓Khi bạn cần cập nhật dữ liệu cho mô hình mới mà không có thời gian ngừng hoạt động.
- ✓Khi bạn muốn thử một mô hình mới so với mô hình cũ.
Liên kết skill
https://github.com/github/awesome-copilot/blob/main/skills/qdrant-model-migration/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Làm thế nào để đổi mô hình embedding trong Qdrant mà không bị ngừng hoạt động?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Qdrant không cho phép thêm loại 'vector' mới vào một collection đã có (các con số biểu diễn dữ liệu của bạn). Vì vậy, bạn cần tạo một collection mới và chuyển dữ liệu sang đó. Để tránh gián đoạn, bạn có thể dùng 'aliases' (biệt danh của collection) để chuyển đổi liền mạch.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
What to Do When Changing Embedding Models
Vectors from different models are incompatible. You cannot mix old and new embeddings in the same vector space. You also cannot add new named vector fields to an existing collection. All named vectors must be defined at collection creation time. Both migration strategies below require creating a new collection.
- Understand collection aliases before choosing a strategy Collection aliases
Can I Avoid Re-embedding?
Use when: looking for shortcuts before committing to full migration.
You MUST re-embed if: changing model provider (OpenAI to Cohere), changing architecture (CLIP to BGE), incompatible dimension counts across different models, or adding sparse vectors to dense-only collection.
You CAN avoid re-embedding if: using Matryoshka models (use dimensions parameter to output lower-dimensional embeddings, learn linear transformation from sample data, some recall loss, good for 100M+ datasets). Or changing quantization (binary to scalar): Qdrant re-quantizes automatically. Quantization
Need Zero Downtime (Alias Swap)
Use when: production must stay available. Recommended for model replacement at scale.
- Create a new collection with the new model's dimensions and distance metric
- Re-embed all data into the new collection in the background
- Point your application at a collection alias instead of a direct collection name
- Atomically swap the alias to the new collection Switch collection
- Verify search quality, then delete the old collection
Careful, the alias swap only redirects queries. Payloads must be re-uploaded separately.
Need Both Models Live (Side-by-Side)
Use when: A/B testing models, multi-modal (dense + sparse), or evaluating a new model before committing.
You cannot add a named vector to an existing collection. Create a new collection with both vector fields defined upfront:
- Create new collection with old and new named vectors both defined Collection with multiple vectors
- Migrate data from old collection, preserving existing vectors in the old named field
- Backfill new model embeddings incrementally using
UpdateVectorsUpdate vectors - Compare quality by querying with
using: "old_model"vsusing: "new_model" - Swap alias to new collection once satisfied
Co-locating large multi-vectors (especially ColBERT) with dense vectors degrades ALL queries, even those only using dense. At millions of points, users report 13s latency dropping to 2s after removing ColBERT. Put large vectors on disk during side-by-side migration.
If you anticipate future model migrations, define both vector fields upfront at collection creation.
Dense to Hybrid Search Migration
Use when: adding sparse/BM25 vectors to an existing dense-only collection. Most common migration pattern.
You cannot add sparse vectors to an existing dense-only collection. Must recreate:
- Create new collection with both dense and sparse vector configs defined
- Re-embed all data with both dense and sparse models
- Migrate payloads, swap alias
Sparse vectors at chunk level have different TF-IDF characteristics than document level. Test retrieval quality after migration, especially for non-English text without stop-word removal.
Re-embedding Is Too Slow
Use when: dataset is large and re-embedding is the bottleneck.
- Use
update_mode: insert(v1.17+) for safe idempotent migration Update mode - Scroll the old collection with
with_vectors=False, re-embed in batches, upsert into new collection - Upload in parallel batches (64-256 points per request, 2-4 parallel streams) Bulk upload
- Disable HNSW during bulk load (set
indexing_threshold_kbvery high, restore after) - For Qdrant Cloud inference, switching models is a config change, not a pipeline change Inference docs
…
Câu hỏi thường gặp
Tôi có cần tạo lại embedding cho toàn bộ dữ liệu không?
Trong hầu hết trường hợp là có. Nếu bạn đổi nhà cung cấp mô hình (ví dụ từ OpenAI sang Cohere), kiến trúc mô hình hoặc số chiều của các con số được tạo ra, bạn sẽ cần tạo lại embedding. Những thay đổi nhỏ như phương pháp 'quantization' (nén số) có thể được xử lý tự động.
Collection aliases là gì?
Aliases giống như biệt danh cho các bộ dữ liệu. Thay vì ứng dụng luôn trỏ đến đúng tên collection, nó trỏ đến một alias. Điều này cho phép bạn chuyển alias sang collection mới mà không phải đổi mã ứng dụng.
Nếu dữ liệu của tôi rất lớn thì sao?
Với bộ dữ liệu rất lớn, tạo lại embedding cho tất cả có thể chậm. Hướng dẫn gợi ý các tối ưu như tạm tắt lập chỉ mục HNSW và tải lên song song theo lô để tăng tốc quá trình.
Chi tiết
Mô tả gốc của tác giả
Guides embedding model migration in Qdrant without downtime. Use when someone asks 'how to switch embedding models', 'how to migrate vectors', 'how to update to a new model', 'zero-downtime model change', 'how to re-embed my data', or 'can I use two models at once'. Also use when upgrading model dimensions, switching providers, or A/B testing models.
repo: github/awesome-copilot
Độ phổ biến
- Sao GitHub
- 40k
- Vị trí xếp hạng
- #7355
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
acquire-codebase-knowledge
40kGiúp agent của bạn hiểu và ghi tài liệu cho một dự án mã nguồn có sẵn. Hữu ích khi đón thành viên mới hoặc nắm tổng quan về kiến trúc.
acreadiness-assess
40kGiúp agent của bạn đánh giá mức độ sẵn sàng cho AI của dự án và tạo báo cáo. Hữu ích để biết dự án đã sẵn sàng dùng công cụ AI đến đâu.
acreadiness-generate-instructions
40kGiúp agent của bạn tạo hướng dẫn cho công cụ AI dựa trên kết quả đánh giá. Hữu ích để cải thiện cách AI làm việc với mã và khắc phục các khoảng trống.
acreadiness-policy
40kGiúp agent của bạn xác định hoặc áp dụng chính sách đánh giá dự án bằng AI. Hữu ích để chuẩn hóa cách đánh giá dự án và đảm bảo tuân thủ.
Skill tương tự
discrawl
394kCho phép agent của bạn tìm kiếm và tóm tắt kho lưu trữ tin nhắn Discord trên máy, kiểm tra độ mới của dữ liệu và đọc tin nhắn trực tiếp.
clickhouse-io
280kGiúp agent của bạn tối ưu truy vấn và schema trong ClickHouse theo thực hành tốt nhất cho phân tích dữ liệu hiệu năng cao khi truy vấn chậm.
scientific-db-pubmed-database
280kGiúp agent của bạn tìm bài báo khoa học trong lĩnh vực y sinh. Hữu ích cho nghiên cứu cần thông tin y khoa cụ thể.