GitXplorerGitXplorer
j

faiss-grpc-server

public
17 stars
3 forks
1 issues

Commits

List of commits on branch master.
Unverified
26844c8fec33260635c446e05597cfaee21cb673

update Dockerfile

jjplu committed 3 years ago
Unverified
e712269f6ac4f1f166e51b4456cdef8456c9c361

update Dockerfile

jjplu committed 3 years ago
Unverified
21bd3afcaf55b5528976cbf200ff593dbe9a99f2

Add prometheus metrics

committed 3 years ago
Verified
3cb5b71ed5325a42c1a8b66a62ced80ef89e5a01

Update faiss_server.cpp

jjplu committed 3 years ago
Verified
3c46301e62dac29f75ceb22f2d81283817d7f260

Update CMakeLists.txt

jjplu committed 3 years ago
Verified
13e1ed4438617968ff04c5f850a975dfb8b10aac

Update main.cpp

jjplu committed 3 years ago

README

The README file for this repository.

faiss-grpc-server

gRPC server over a FAISS index.

Requirements

To install the required tools on Ubuntu, run the following command line:

sudo apt update
sudo install civetweb libcivetweb-dev intel-mkl-full protobuf-compiler-grpc libssl-dev cmake libgrpc++-dev protobuf-compiler libspdlog-dev libgrpc-dev libgflags-dev libgtest-dev libc-ares-dev libprotobuf-dev

Installation from source

To compile and install from source, run the following command lines:

git clone https://github.com/jplu/faiss-grpc-server
cd faiss-grpc-server
make cppclient

Then use CMake:

sudo mkdir -p /usr/lib/x86_64-linux-gnu/cmake/grpc
sudo cp grpc-config.cmake /usr/lib/x86_64-linux-gnu/cmake/grpc
mkdir build; cd build
cmake ..
make

Build as docker image:

To build the Docker image, run the folloging command line:

$ docker build -t faiss-server .

Run FAISS server

To run FAISS server, write the following command line:

./build/bin/faiss_server -file_path <faiss_index_file>

Run FAISS server from Docker

To create a container from the Docker image, run the following command line:

docker run -p 8080:8080 -v <folder_containing_the_index>:/tmp faiss-server -file_path /tmp/<faiss_index_file>

Create the Python and Go clients

In order to create the Python and Go gRPC clients, run the following command lines:

make pyclient
make goclient

Usage

faiss_server:
    -file_path (index file name) type: string default: ""
    -host (host of faiss server) type: string default: "0.0.0.0"
    -port (port of faiss server) type: string default: "8080"
    -top_k (default number of neighbor) type: uint64 default: 10
    -on_cpu (run on CPU or not) type: boolean default: false