Chuyển đến nội dung
Skillpedia
Cơ sở dữ liệu40k · #7355

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.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/github/awesome-copilot/blob/main/skills/qdrant-model-migration/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

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.

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 UpdateVectors Update vectors
  • Compare quality by querying with using: "old_model" vs using: "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_kb very 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

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự