https://github.com/wikp/faiss-rest-api
REST API for facebook's faiss
https://github.com/wikp/faiss-rest-api
faiss rest-api rust similarity-search vector-similarity
Last synced: 3 months ago
JSON representation
REST API for facebook's faiss
- Host: GitHub
- URL: https://github.com/wikp/faiss-rest-api
- Owner: wikp
- Created: 2019-05-19T03:36:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-20T16:35:52.000Z (over 5 years ago)
- Last Synced: 2025-06-15T13:52:07.362Z (4 months ago)
- Topics: faiss, rest-api, rust, similarity-search, vector-similarity
- Language: Rust
- Size: 11.7 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# faiss-rest-api
REST API for [Faiss][1].
To use this, you have to compile [faiss-rs][2] using instructions from the README file.
Usage:
$ curl -v 'localhost:8000/faiss/search' \
-H "Content-type: application/json" \
-XPOST \
-d '{"k": 5, "vectors": [[54.7, 0.3, 0.6, 0.4, 0.1, 0.7, 0.2, 0.0, 0.6, 0.5, 0.3, 0.2, 0.1, 0.9, 0.3, 0.6, 0.2, 0.9, 0.5, 0.0, 0.9, 0.1, 0.9, 0.1, 0.5, 0.5, 0.8, 0.8, 0.5, 0.2, 0.6, 0.2, 0.2, 0.7, 0.1, 0.7, 0.8, 0.2, 0.9, 0.0, 0.4, 0.4, 0.9, 0.0, 0.6, 0.4, 0.4, 0.6, 0.6, 0.2, 0.5, 0.0, 0.1, 0.6, 0.0, 0.0, 0.4, 0.7, 0.5, 0.7, 0.2, 0.5, 0.5, 0.7], [54.7, 0.3, 0.6, 0.4, 0.1, 0.7, 0.2, 0.0, 0.6, 0.5, 0.3, 0.2, 0.1, 0.9, 0.3, 0.6, 0.2, 0.9, 0.5, 0.0, 0.9, 0.1, 0.9, 0.1, 0.5, 0.5, 0.8, 0.8, 0.5, 0.2, 0.6, 0.2, 0.2, 0.7, 0.1, 0.7, 0.8, 0.2, 0.9, 0.0, 0.4, 0.4, 0.9, 0.0, 0.6, 0.4, 0.4, 0.6, 0.6, 0.2, 0.5, 0.0, 0.1, 0.6, 0.0, 0.0, 0.4, 0.7, 0.5, 0.7, 0.1, 0.3, 0.5]]}'
* Trying ::1...
* TCP_NODELAY set
* Connection failed
* connect to ::1 port 8000 failed: Connection refused
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8000 (#0)
> POST /faiss/search HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.54.0
> Accept: */*
> Content-type: application/json
> Content-Length: 344
>
* upload completely sent off: 344 out of 344 bytes
< HTTP/1.1 200 OK
< Content-Type: application/json
< Server: Rocket
< Content-Length: 1209
< Date: Sun, 19 May 2019 04:06:16 GMT
<
* Connection #0 to host localhost left intact
[{"neighbors":[{"id":54104,"score":0.22991317510604858},{"id":53227,"score":6.515602111816406},{"id":54408,"score":6.633026599884033},{"id":54800,"score":6.759259223937988},{"id":54102,"score":6.813137054443359}],"vector":[54.70000076293945,0.30000001192092896,0.6000000238418579,0.4000000059604645,0.10000000149011612,0.699999988079071,0.20000000298023224,0.0,0.6000000238418579,0.5,0.30000001192092896,0.20000000298023224,0.10000000149011612,0.8999999761581421,0.30000001192092896,0.6000000238418579,0.20000000298023224,0.8999999761581421,0.5,0.0,0.8999999761581421,0.10000000149011612,0.8999999761581421,0.10000000149011612,0.5,0.5,0.800000011920929,0.800000011920929,0.5,0.20000000298023224,0.6000000238418579,0.20000000298023224,0.20000000298023224,0.699999988079071,0.10000000149011612,0.699999988079071,0.800000011920929,0.20000000298023224,0.8999999761581421,0.0,0.4000000059604645,0.4000000059604645,0.8999999761581421,0.0,0.6000000238418579,0.4000000059604645,0.4000000059604645,0.6000000238418579,0.6000000238418579,0.20000000298023224,0.5,0.0,0.10000000149011612,0.6000000238418579,0.0,0.0,0.4000000059604645,0.699999988079071,0.5,0.699999988079071,0.20000000298023224,0.5,0.5,0.699999988079071]}][1]: https://github.com/facebookresearch/faiss
[2]: https://github.com/Enet4/faiss-rs