gRPC server over a FAISS index.
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
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
To build the Docker image, run the folloging command line:
$ docker build -t faiss-server .
To run FAISS server, write the following command line:
./build/bin/faiss_server -file_path <faiss_index_file>
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>
In order to create the Python and Go gRPC clients, run the following command lines:
make pyclient
make goclient
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