qdrant-model-migration

作者: github

指导在 Qdrant 中无停机迁移嵌入模型。当有人询问“如何切换嵌入模型”、“如何迁移向量”、“如何更新…”时使用。

npx skills add https://github.com/github/awesome-copilot --skill qdrant-model-migration

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

For 400GB+ datasets, expect days. For small datasets (<25MB), re-indexing from source is faster than using the migration tool.

What NOT to Do

  • Assume you can add named vectors to an existing collection (must be defined at creation time)
  • Delete the old collection before verifying the new one
  • Forget to update the query embedding model in your application code
  • Skip payload migration when using alias swap (aliases redirect queries, they do not copy data)
  • Keep ColBERT vectors co-located with dense vectors during a long migration (I/O cost degrades all queries)
  • Migrate to hybrid search without testing BM25 quality at chunk level

来自 github 的更多技能

console-rendering
github
在Go中使用基于结构体标签的控制台渲染系统的说明
official
acquire-codebase-knowledge
github
当用户明确要求映射、记录或熟悉现有代码库时使用此技能。触发词如“映射此代码库”、“记录…
official
acreadiness-assess
github
Run the AgentRC readiness assessment on the current repository and produce a static HTML dashboard at reports/index.html. Wraps `npx github:microsoft/agentrc…
official
acreadiness-generate-instructions
github
通过AgentRC指令命令生成定制化的AI代理指令文件。生成.github/copilot-instructions.md(默认,推荐用于VS Code中的Copilot…
official
acreadiness-policy
github
帮助用户选择、编写或应用AgentRC策略。策略通过禁用无关检查、覆盖影响/级别、设置…来定制就绪评分。
official
add-educational-comments
github
为代码文件添加教育性注释,将其转化为有效的学习资源。根据三个可配置的知识水平(初级、中级、高级)调整解释深度和语气。若未提供文件,自动请求文件,并附带编号列表以便快速选择。仅通过教育性注释将文件扩展最多125%(硬性限制:新增400行;超过1000行的文件限制为300行)。保留文件编码、缩进风格、语法正确性以及...
official
adobe-illustrator-scripting
github
使用ExtendScript(JavaScript/JSX)编写、调试和优化Adobe Illustrator自动化脚本。在创建或修改操作…的脚本时使用。
official
agent-governance
github
声明式策略、意图分类及审计追踪,用于控制AI代理工具访问与行为。可组合的治理策略定义允许/禁止的工具、内容过滤器、速率限制及审批要求——以配置而非代码形式存储。语义意图分类在执行工具前通过基于模式的信号检测危险提示(数据泄露、权限提升、提示注入)。工具级治理装饰器在函数层面强制执行策略...
official