qdrant-model-migration
できること
このガイドは、Qdrantで埋め込みモデル(データを検索用の数値に変換する仕組み)を、サービスを停止させずに切り替える方法を説明します。アプリケーションをオフラインにすることなく、データを新しいモデルへ移行する方法を解説します。
使う場面
- ✓テキストを数値に変換するモデルを変更したいとき。
- ✓サービスを止めずに、新しいモデル用にデータを更新する必要があるとき。
- ✓新しいモデルを古いモデルと比較してテストしたいとき。
スキルのリンク
https://github.com/github/awesome-copilot/blob/main/skills/qdrant-model-migration/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Qdrantで、ダウンタイムなしに埋め込みモデルを切り替えるにはどうすればよいですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
Qdrantでは、既存のコレクションに新しい種類の「ベクトル」(データを表す数値)を追加できません。そのため、新しいコレクションを作成してデータを移行する必要があります。ダウンタイムを避けるには、「エイリアス」(コレクションの別名)を使って、コレクションをスムーズに切り替えられます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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
…
よくある質問
すべてのデータを再埋め込みする必要がありますか?
ほとんどの場合はそうです。モデルのプロバイダー(例: OpenAIからCohereへ)、モデルの構造、生成される数値の次元数を変更する場合は、データの再埋め込みが必要です。量子化の方法(数値の圧縮)のような小さな変更は、自動的に処理される場合があります。
コレクションのエイリアスとは何ですか?
データコレクションの別名のようなものです。アプリケーションが常に正確なコレクション名を指すのではなく、エイリアスを指すようにします。これにより、アプリケーションのコードを変更せずに、エイリアスを新しいコレクションへ向け直せます。
データ量が非常に多い場合はどうすればよいですか?
非常に大規模なデータセットでは、すべてを再埋め込みすると時間がかかります。ガイドでは、HNSWインデックスを一時的に無効にする、並列のバッチアップロードを行うなど、処理を速める最適化を提案しています。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 40k
- ランキング
- #7355
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
acquire-codebase-knowledge
40kエージェントが、既存のコードプロジェクトを理解してドキュメント化できるよう支援します。新しく参加するメンバーのオンボーディングや、アーキテクチャの全体像の把握に役立ちます。
acreadiness-assess
40kエージェントが、プロジェクトのAI対応状況を評価してレポートを生成できるよう支援します。プロジェクトがAIツールをどの程度活用できる状態にあるかを把握するのに役立ちます。
acreadiness-generate-instructions
40kエージェントが、評価結果をもとにAIツール向けの指示文を作成できるよう支援します。AIがコードとどのようにやり取りするかを改善し、特定された不足点を解消するのに役立ちます。
acreadiness-policy
40kエージェントが、AIプロジェクトの評価ポリシーの策定や適用を支援できるようにします。プロジェクトの評価方法を標準化し、コンプライアンスを確保するのに役立ちます。
似ているスキル
discrawl
394k保存済みのローカルなDiscordメッセージのアーカイブを検索して要約し、その新しさを確認し、ダイレクトメッセージを読めるようエージェントを支援します。
clickhouse-io
280kエージェントがClickHouseデータベースのクエリとスキーマを最適化できるようにします。高性能な分析処理向けのベストプラクティスを適用します。分析クエリが遅すぎるときに使います。
scientific-db-pubmed-database
280kエージェントが生物医学分野の科学論文を検索するのに役立ちます。特定の医療情報が必要な研究に便利です。