[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D31FNPD4SY510DZXJ13J25":3,"skill-same:01M7D31FNPD4SY510DZXJ13J25":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":13,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":46,"install":47,"resources":60},"01M7D31FNPD4SY510DZXJ13J25","faiss",null,"Facebook's library for efficient similarity search and clustering of dense vectors. Supports billions of vectors, GPU acceleration, and various index types (Flat, IVF, HNSW). Use for fast k-NN search, large-scale vector retrieval, or when you need pure similarity search without metadata. Best for high-performance applications.","beyondai\u002Fsandbox","beyondai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2845958?v=4","01M7D24SBNM47BJGJ9J2HB13BP","01M7D24SCDC9DYE005XH6R553S",0,"MIT","https:\u002F\u002Fgithub.com\u002Fbeyondai\u002Fsandbox\u002Fblob\u002Fmain\u002Flabs\u002F.cursor\u002Fskills\u002Ffaiss\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: faiss\ndescription: Facebook's library for efficient similarity search and clustering of dense vectors. Supports billions of vectors, GPU acceleration, and various index types (Flat, IVF, HNSW). Use for fast k-NN search, large-scale vector retrieval, or when you need pure similarity search without metadata. Best for high-performance applications.\nversion: 1.0.0\nauthor: Orchestra Research\nlicense: MIT\ntags: [RAG, FAISS, Similarity Search, Vector Search, Facebook AI, GPU Acceleration, Billion-Scale, K-NN, HNSW, High Performance, Large Scale]\ndependencies: [faiss-cpu, faiss-gpu, numpy]\n---\n\n# FAISS - Efficient Similarity Search\n\nFacebook AI's library for billion-scale vector similarity search.\n\n## When to use FAISS\n\n**Use FAISS when:**\n- Need fast similarity search on large vector datasets (millions\u002Fbillions)\n- GPU acceleration required\n- Pure vector similarity (no metadata filtering needed)\n- High throughput, low latency critical\n- Offline\u002Fbatch processing of embeddings\n\n**Metrics**:\n- **31,700+ GitHub stars**\n- Meta\u002FFacebook AI Research\n- **Handles billions of vectors**\n- **C++** with Python bindings\n\n**Use alternatives instead**:\n- **Chroma\u002FPinecone**: Need metadata filtering\n- **Weaviate**: Need full database features\n- **Annoy**: Simpler, fewer features\n\n## Quick start\n\n### Installation\n\n```bash\n# CPU only\npip install faiss-cpu\n\n# GPU support\npip install faiss-gpu\n```\n\n### Basic usage\n\n```python\nimport faiss\nimport numpy as np\n\n# Create sample data (1000 vectors, 128 dimensions)\nd = 128\nnb = 1000\nvectors = np.random.random((nb, d)).astype('float32')\n\n# Create index\nindex = faiss.IndexFlatL2(d)  # L2 distance\nindex.add(vectors)             # Add vectors\n\n# Search\nk = 5  # Find 5 nearest neighbors\nquery = np.random.random((1, d)).astype('float32')\ndistances, indices = index.search(query, k)\n\nprint(f\"Nearest neighbors: {indices}\")\nprint(f\"Distances: {distances}\")\n```\n\n## Index types\n\n### 1. Flat (exact search)\n\n```python\n# L2 (Euclidean) distance\nindex = faiss.IndexFlatL2(d)\n\n# Inner product (cosine similarity if normalized)\nindex = faiss.IndexFlatIP(d)\n\n# Slowest, most accurate\n```\n\n### 2. IVF (inverted file) - Fast approximate\n\n```python\n# Create quantizer\nquantizer = faiss.IndexFlatL2(d)\n\n# IVF index with 100 clusters\nnlist = 100\nindex = faiss.IndexIVFFlat(quantizer, d, nlist)\n\n# Train on data\nindex.train(vectors)\n\n# Add vectors\nindex.add(vectors)\n\n# Search (nprobe = clusters to search)\nindex.nprobe = 10\ndistances, indices = index.search(query, k)\n```\n\n### 3. HNSW (Hierarchical NSW) - Best quality\u002Fspeed\n\n```python\n# HNSW index\nM = 32  # Number of connections per layer\nindex = faiss.IndexHNSWFlat(d, M)\n\n# No training needed\nindex.add(vectors)\n\n# Search\ndistances, indices = index.search(query, k)\n```\n\n### 4. Product Quantization - Memory efficient\n\n```python\n# PQ reduces memory by 16-32×\nm = 8   # Number of subquantizers\nnbits = 8\nindex = faiss.IndexPQ(d, m, nbits)\n\n# Train and add\nindex.train(vectors)\nindex.add(vectors)\n```\n\n## Save and load\n\n```python\n# Save index\nfaiss.write_index(index, \"large.index\")\n\n# Load index\nindex = faiss.read_index(\"large.index\")\n\n# Continue using\ndistances, indices = index.search(query, k)\n```\n\n## GPU acceleration\n\n```python\n# Single GPU\nres = faiss.StandardGpuResources()\nindex_cpu = faiss.IndexFlatL2(d)\nindex_gpu = faiss.index_cpu_to_gpu(res, 0, index_cpu)  # GPU 0\n\n# Multi-GPU\nindex_gpu = faiss.index_cpu_to_all_gpus(index_cpu)\n\n# 10-100× faster than CPU\n```\n\n## LangChain integration\n\n```python\nfrom langchain_community.vectorstores import FAISS\nfrom langchain_openai import OpenAIEmbeddings\n\n# Create FAISS vector store\nvectorstore = FAISS.from_documents(docs, OpenAIEmbeddings())\n\n# Save\nvectorstore.save_local(\"faiss_index\")\n\n# Load\nvectorstore = FAISS.load_local(\n    \"faiss_index\",\n    OpenAIEmbeddings(),\n    allow_dangerous_deserialization=True\n)\n\n# Search\nresults = vectorstore.similarity_search(\"query\", k=5)\n```\n\n## LlamaIndex integration\n\n```python\nfrom llama_index.vector_stores.faiss import FaissVectorStore\nimport faiss\n\n# Create FAISS index\nd = 1536\nfaiss_index = faiss.IndexFlatL2(d)\n\nvector_store = FaissVectorStore(faiss_index=faiss_index)\n```\n\n## Best practices\n\n1. **Choose right index type** - Flat for \u003C10K, IVF for 10K-1M, HNSW for quality\n2. **Normalize for cosine** - Use IndexFlatIP with normalized vectors\n3. **Use GPU for large datasets** - 10-100× faster\n4. **Save trained indices** - Training is expensive\n5. **Tune nprobe\u002Fef_search** - Balance speed\u002Faccuracy\n6. **Monitor memory** - PQ for large datasets\n7. **Batch queries** - Better GPU utilization\n\n## Performance\n\n| Index Type | Build Time | Search Time | Memory | Accuracy |\n|------------|------------|-------------|--------|----------|\n| Flat | Fast | Slow | High | 100% |\n| IVF | Medium | Fast | Medium | 95-99% |\n| HNSW | Slow | Fastest | High | 99% |\n| PQ | Medium | Fast | Low | 90-95% |\n\n## Resources\n\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Ffaiss ⭐ 31,700+\n- **Wiki**: https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Ffaiss\u002Fwiki\n- **License**: MIT\n\n\n","# FAISS - Efficient Similarity Search\n\nFacebook AI's library for billion-scale vector similarity search.\n\n## When to use FAISS\n\n**Use FAISS when:**\n- Need fast similarity search on large vector datasets (millions\u002Fbillions)\n- GPU acceleration required\n- Pure vector similarity (no metadata filtering needed)\n- High throughput, low latency critical\n- Offline\u002Fbatch processing of embeddings\n\n**Metrics**:\n- **31,700+ GitHub stars**\n- Meta\u002FFacebook AI Research\n- **Handles billions of vectors**\n- **C++** with Python bindings\n\n**Use alternatives instead**:\n- **Chroma\u002FPinecone**: Need metadata filtering\n- **Weaviate**: Need full database features\n- **Annoy**: Simpler, fewer features\n\n## Quick start\n\n### Installation\n\n```bash\n# CPU only\npip install faiss-cpu\n\n# GPU support\npip install faiss-gpu\n```\n\n### Basic usage\n\n```python\nimport faiss\nimport numpy as np\n\n# Create sample data (1000 vectors, 128 dimensions)\nd = 128\nnb = 1000\nvectors = np.random.random((nb, d)).astype('float32')\n\n# Create index\nindex = faiss.IndexFlatL2(d)  # L2 distance\nindex.add(vectors)             # Add vectors\n\n# Search\nk = 5  # Find 5 nearest neighbors\nquery = np.random.random((1, d)).astype('float32')\ndistances, indices = index.search(query, k)\n\nprint(f\"Nearest neighbors: {indices}\")\nprint(f\"Distances: {distances}\")\n```\n\n## Index types\n\n### 1. Flat (exact search)\n\n```python\n# L2 (Euclidean) distance\nindex = faiss.IndexFlatL2(d)\n\n# Inner product (cosine similarity if normalized)\nindex = faiss.IndexFlatIP(d)\n\n# Slowest, most accurate\n```\n\n### 2. IVF (inverted file) - Fast approximate\n\n```python\n# Create quantizer\nquantizer = faiss.IndexFlatL2(d)\n\n# IVF index with 100 clusters\nnlist = 100\nindex = faiss.IndexIVFFlat(quantizer, d, nlist)\n\n# Train on data\nindex.train(vectors)\n\n# Add vectors\nindex.add(vectors)\n\n# Search (nprobe = clusters to search)\nindex.nprobe = 10\ndistances, indices = index.search(query, k)\n```\n\n### 3. HNSW (Hierarchical NSW) - Best quality\u002Fspeed\n\n```python\n# HNSW index\nM = 32  # Number of connections per layer\nindex = faiss.IndexHNSWFlat(d, M)\n\n# No training needed\nindex.add(vectors)\n\n# Search\ndistances, indices = index.search(query, k)\n```\n\n### 4. Product Quantization - Memory efficient\n\n```python\n# PQ reduces memory by 16-32×\nm = 8   # Number of subquantizers\nnbits = 8\nindex = faiss.IndexPQ(d, m, nbits)\n\n# Train and add\nindex.train(vectors)\nindex.add(vectors)\n```\n\n## Save and load\n\n```python\n# Save index\nfaiss.write_index(index, \"large.index\")\n\n# Load index\nindex = faiss.read_index(\"large.index\")\n\n# Continue using\ndistances, indices = index.search(query, k)\n```\n\n## GPU acceleration\n\n```python\n# Single GPU\nres = faiss.StandardGpuResources()\nindex_cpu = faiss.IndexFlatL2(d)\nindex_gpu = faiss.index_cpu_to_gpu(res, 0, index_cpu)  # GPU 0\n\n# Multi-GPU\nindex_gpu = faiss.index_cpu_to_all_gpus(index_cpu)\n\n# 10-100× faster than CPU\n```\n\n## LangChain integration\n\n```python\nfrom langchain_community.vectorstores import FAISS\nfrom langchain_openai import OpenAIEmbeddings\n\n# Create FAISS vector store\nvectorstore = FAISS.from_documents(docs, OpenAIEmbeddings())\n\n# Save\nvectorstore.save_local(\"faiss_index\")\n\n# Load\nvectorstore = FAISS.load_local(\n    \"faiss_index\",\n    OpenAIEmbeddings(),\n    allow_dangerous_deserialization=True\n)\n\n# Search\nresults = vectorstore.similarity_search(\"query\", k=5)\n```\n\n## LlamaIndex integration\n\n```python\nfrom llama_index.vector_stores.faiss import FaissVectorStore\nimport faiss\n\n# Create FAISS index\nd = 1536\nfaiss_index = faiss.IndexFlatL2(d)\n\nvector_store = FaissVectorStore(faiss_index=faiss_index)\n```\n\n## Best practices\n\n1. **Choose right index type** - Flat for \u003C10K, IVF for 10K-1M, HNSW for quality\n2. **Normalize for cosine** - Use IndexFlatIP with normalized vectors\n3. **Use GPU for large datasets** - 10-100× faster\n4. **Save trained indices** - Training is expensive\n5. **Tune nprobe\u002Fef_search** - Balance speed\u002Faccuracy\n6. **Monitor memory** - PQ for large datasets\n7. **Batch queries** - Better GPU utilization\n\n## Performance\n\n| Index Type | Build Time | Search Time | Memory | Accuracy |\n|------------|------------|-------------|--------|----------|\n| Flat | Fast | Slow | High | 100% |\n| IVF | Medium | Fast | Medium | 95-99% |\n| HNSW | Slow | Fastest | High | 99% |\n| PQ | Medium | Fast | Low | 90-95% |\n\n## Resources\n\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Ffaiss ⭐ 31,700+\n- **Wiki**: https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Ffaiss\u002Fwiki\n- **License**: MIT\n\n\n",{"name":5,"tags":23,"author":35,"license":14,"version":36,"description":7,"dependencies":37},[24,25,26,27,28,29,30,31,32,33,34],"RAG","FAISS","Similarity Search","Vector Search","Facebook AI","GPU Acceleration","Billion-Scale","K-NN","HNSW","High Performance","Large Scale","Orchestra Research","1.0.0",[38,39,40],"faiss-cpu","faiss-gpu","numpy","main","46e03791269608c5ac886a64c08f5d94147e8786","labs\u002F.cursor\u002Fskills\u002Ffaiss","https:\u002F\u002Fgithub.com\u002Fbeyondai\u002Fsandbox","https:\u002F\u002Fgithub.com\u002Fbeyondai","2026-11-08 04:18:42",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add beyondai\u002Fsandbox --skill faiss",{"tool":53,"command":54},"bunx","bunx skills add beyondai\u002Fsandbox --skill faiss",{"tool":56,"command":57},"pnpm","pnpm dlx skills add beyondai\u002Fsandbox --skill faiss","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbeyondai\u002Fsandbox\u002Fblob\u002Fmain\u002Flabs\u002F.cursor\u002Fskills\u002Ffaiss\u002FSKILL.md",true,[61],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Findex_types.md","REFERENCE","参考文档",6181,"https:\u002F\u002Fgithub.com\u002Fbeyondai\u002Fsandbox\u002Fblob\u002Fmain\u002Flabs\u002F.cursor\u002Fskills\u002Ffaiss\u002Freferences\u002Findex_types.md",[68,75,82,89,96,103],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M7D3GMPGJZRG8EPY404YF8TR","weights-and-biases","Track ML experiments with automatic logging, visualize training in real-time, optimize hyperparameters with sweeps, and manage model registry with W&B - collaborative MLOps platform","https:\u002F\u002Fgithub.com\u002Fbeyondai\u002Fsandbox\u002Fblob\u002Fmain\u002Flabs\u002F.opencode\u002Fskills\u002Fweights-and-biases\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M7D3GFZH440V2J532BSZMPVP","serving-llms-vllm","Serves LLMs with high throughput using vLLM's PagedAttention and continuous batching. Use when deploying production LLM APIs, optimizing inference latency\u002Fthroughput, or serving models with limited GPU memory. Supports OpenAI-compatible endpoints, quantization (GPTQ\u002FAWQ\u002FFP8), and tensor parallelism.","https:\u002F\u002Fgithub.com\u002Fbeyondai\u002Fsandbox\u002Fblob\u002Fmain\u002Flabs\u002F.opencode\u002Fskills\u002Fvllm\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M7D3GAE8MQCPGF72EP9G9GKY","verl-rl-training","Provides guidance for training LLMs with reinforcement learning using verl (Volcano Engine RL). Use when implementing RLHF, GRPO, PPO, or other RL algorithms for LLM post-training at scale with flexible infrastructure backends.","https:\u002F\u002Fgithub.com\u002Fbeyondai\u002Fsandbox\u002Fblob\u002Fmain\u002Flabs\u002F.opencode\u002Fskills\u002Fverl\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":18},"01M7D3G7KKNE5RGNYJNXV4F0MM","unsloth","Expert guidance for fast fine-tuning with Unsloth - 2-5x faster training, 50-80% less memory, LoRA\u002FQLoRA optimization","https:\u002F\u002Fgithub.com\u002Fbeyondai\u002Fsandbox\u002Fblob\u002Fmain\u002Flabs\u002F.opencode\u002Fskills\u002Funsloth\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":18},"01M7D3G2RCZQ08GS0KAW5CBWSC","fine-tuning-with-trl","Fine-tune LLMs using reinforcement learning with TRL - SFT for instruction tuning, DPO for preference alignment, PPO\u002FGRPO for reward optimization, and reward model training. Use when need RLHF, align model with preferences, or train from human feedback. Works with HuggingFace Transformers.","https:\u002F\u002Fgithub.com\u002Fbeyondai\u002Fsandbox\u002Fblob\u002Fmain\u002Flabs\u002F.opencode\u002Fskills\u002Ftrl-fine-tuning\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":18},"01M7D3FX08BPB172CYGM597NZF","torchforge-rl-training","Provides guidance for PyTorch-native agentic RL using torchforge, Meta's library separating infra from algorithms. Use when you want clean RL abstractions, easy algorithm experimentation, or scalable training with Monarch and TorchTitan.","https:\u002F\u002Fgithub.com\u002Fbeyondai\u002Fsandbox\u002Fblob\u002Fmain\u002Flabs\u002F.opencode\u002Fskills\u002Ftorchforge\u002FSKILL.md",[],[]]