Metadata-Version: 2.4
Name: pyglass-portable
Version: 2.1.0
Summary: Portable wheels of pyglass (zilliztech) — a fast HNSW/NSG graph ANN library that builds and runs on macOS (Apple Silicon and Intel) and non-AVX-512 x86 (AMD, older Intel). Imported as `glass`.
Author: Zihao Wang
Maintainer: Ian Driver
License: MIT
Project-URL: Homepage, https://github.com/iandriver/pyglass
Project-URL: Upstream, https://github.com/zilliztech/pyglass
Project-URL: Issues, https://github.com/iandriver/pyglass/issues
Keywords: nearest-neighbors,ann,hnsw,nsg,vector-search,pyglass,similarity-search
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: C++
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Dynamic: license-file

# pyglass-portable

Portable prebuilt wheels of [**pyglass**](https://github.com/zilliztech/pyglass)
(zilliztech) — a fast HNSW / NSG graph-based approximate-nearest-neighbor library.

Upstream publishes only an **AVX-512** x86_64 wheel, which crashes (`SIGILL`) on
CPUs without AVX-512 — Apple Silicon, AMD, older Intel. pyglass's *source* is
portable (AVX2 / NEON / scalar kernels); this repackage builds it with a portable
baseline so it installs and runs on those machines too. **The import name stays
`glass`** — it's a drop-in for upstream, not a fork of the algorithm.

```bash
uv pip install pyglass-portable      # or: pip install pyglass-portable
```

Prebuilt wheels: Linux x86_64 (AVX2) and macOS arm64 (NEON), Python 3.9+. Intel
Macs and ARM Linux build from the sdist — `pip install` compiles it portably (it
needs a C++20 compiler; on macOS, `brew install libomp`).

```python
import numpy as np, glass

X = np.random.rand(100_000, 128).astype("float32")
index = glass.Index("HNSW", "L2", "FP32", R=32, L=200)
graph = index.build(X)
searcher = glass.Searcher(graph, X, "L2", "FP32")
searcher.set_ef(64); searcher.optimize()
ids, dists = searcher.batch_search(X[:1000], 10)
```

It also works as a `scanpy` neighbors backend via
[`pipnn.contrib.GlassTransformer`](https://github.com/iandriver/pipnn-scanpy).

## Relationship to upstream

This is an unofficial repackage for platform coverage only — **no algorithm
changes**. The portability fixes are proposed upstream in
[zilliztech/pyglass#24](https://github.com/zilliztech/pyglass/pull/24); if they
land and upstream ships portable wheels, prefer `glassppy`. Version tracks the
upstream source version.

Credit to the pyglass authors (Zihao Wang / zilliztech). MIT licensed, same as
upstream.
