{"id":46757,"library":"vicinity","title":"Vicinity","description":"Vicinity is a lightweight nearest-neighbor retrieval library supporting multiple backends (NumPy, Faiss, HNSWlib, PyTorch, etc.) with a scikit-learn-like API. Version 0.4.4, actively maintained, with monthly releases.","status":"active","version":"0.4.4","language":"python","source_language":"en","source_url":"https://github.com/MinishLab/vicinity","tags":["nearest-neighbors","vector-search","faiss","hnswlib","pytorch"],"install":[{"cmd":"pip install vicinity","lang":"bash","label":"Core installation"},{"cmd":"pip install vicinity[faiss]","lang":"bash","label":"With Faiss backend"},{"cmd":"pip install vicinity[all]","lang":"bash","label":"All backends"}],"dependencies":[{"reason":"Required for all backends.","package":"numpy","optional":false},{"reason":"Optional Faiss backend.","package":"faiss-cpu","optional":true},{"reason":"Optional HNSWlib backend.","package":"hnswlib","optional":true},{"reason":"Optional PyTorch backend.","package":"torch","optional":true}],"imports":[{"wrong":"from vicinity import NearestNeighbors","symbol":"Vicinity","correct":"from vicinity import Vicinity"},{"symbol":"Backend","correct":"from vicinity import Backend"},{"symbol":"Metric","correct":"from vicinity import Metric"}],"quickstart":{"code":"import numpy as np\nfrom vicinity import NearestNeighbors, Backend\n\nvectors = np.random.random((100, 64)).astype(np.float32)\nnn = NearestNeighbors(backend=Backend.NUMPY, metric='cosine')\nnn.fit(vectors)\ndistances, indices = nn.kneighbors(vectors[:3], k=5)\nprint(distances)","lang":"python","description":"Create random 100x64 float32 array, fit a NearestNeighbors instance with NumPy backend, query nearest 5 neighbors for first 3 vectors."},"warnings":[{"fix":"Use `from vicinity import NearestNeighbors`.","message":"In v0.4.0, the import path for NearestNeighbors changed from `vicinity.neighbors.NearestNeighbors` to `vicinity.NearestNeighbors`. Old imports will break.","severity":"breaking","affected_versions":"<0.4.0"},{"fix":"Use `from vicinity import Backend`.","message":"The Backend enum was moved from `vicinity.backends` to top-level in v0.4.0.","severity":"breaking","affected_versions":"<0.4.0"},{"fix":"Ensure vectors are np.float32: `vectors = np.array(vectors, dtype=np.float32)`.","message":"Input vectors must be dtype float32 for most backends. If you pass float64, it may be silently converted or raise an error, depending on backend.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace `from vicinity.datasets import load_dataset` with manual dataset loading from appropriate sources.","message":"The `vicinity.datasets` module and `load_dataset` function are deprecated in v0.4.2 and will be removed in v0.5.0. Use external libraries like torchvision or sklearn.datasets instead.","severity":"deprecated","affected_versions":">=0.4.2"}],"env_vars":null,"search_vec":"'0.4.4':27 'activ':28 'api':25 'backend':13 'etc':18 'faiss':15,39 'hnswlib':16,40 'learn':23 'librari':10 'lightweight':5 'like':24 'maintain':29 'month':31 'multipl':12 'nearest':7,34 'nearest-neighbor':6,33 'neighbor':8,35 'numpi':14 'pytorch':17,41 'releas':32 'retriev':9 'scikit':22 'scikit-learn-lik':21 'search':38 'support':11 'vector':37 'vector-search':36 'version':26 'vicin':1,2","created_at":"2026-06-07T13:01:29.455994+00:00","updated_at":"2026-06-07T13:01:29.455994+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/MinishLab/vicinity","github":"https://github.com/MinishLab/vicinity","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","search"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}