GithubHelp home page GithubHelp logo

ydxc / faiss-server-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chinahbcq/faiss-server

0.0 2.0 0.0 22.38 MB

A high performance similariy search service with faiss inside.

Makefile 1.70% C++ 69.91% C 26.74% Assembly 1.63% Shell 0.02%

faiss-server-1's Introduction

faiss-server

A high performance similariy search service with faiss inside. Only support GPU and run standalone right now.

dependency

  • cuda 8.0 libcudnn.so.5
  • protobuf 3.0+
  • grpc 1.0+
  • faiss dependency

build

make

run

./faiss-server

default run at 0.0.0.0:3838

protobuf

syntax = "proto3";
package faiss_server;

//ping请求接口
message PingRequest {
	string payload = 1;
}
//ping返回报文
message PingResponse {
	string payload = 1;
}

//创建db请求
message DbNewRequest {
	string db_name = 1;
	uint64 max_size = 2; //default 10^8, max 10^10 - 1
	string model = 3;  //train model
	string request_id = 4;
}
//删除db请求
message DbDelRequest {
	string db_name = 1;
	string request_id = 2;
}

//默认返回
message EmptyResponse {
	int64 error_code = 1;
	string error_msg = 2;
	string request_id = 3;
}

//查询db列表请求
message DbListRequest {
	string request_id = 1;
}

//查询db列表返回结果
message DbListResponse {
	message DbStatus {
		string name = 1;
		uint64 ntotal = 2;
		uint64 max_size = 3; 
		uint64 curr_max_id = 4;
		uint64 curr_persist_max_id = 5;
		string persist_path = 6;
		string raw_data_path = 7;
		uint64 dimension = 8;
		string model = 9;
		uint64 black_list_len = 10;
	}
	repeated DbStatus db_status = 2;
	int64 error_code = 3;
	string error_msg = 4;
	string request_id = 5;
}

//获取或者删除一条特征请求
message HGetDelRequest {
	string db_name = 1;
	uint64 id = 3;
	string request_id = 4;
}

//获取一个特征的返回
message HGetResponse {
	bytes feature = 2;
	uint64 dimension = 5;
	string request_id = 6;
	int64 error_code = 7;
	string error_msg = 8;
}

//添加一条特征的请求
message HSetRequest {
	string db_name = 1;
	bytes feature = 3;
	string request_id = 7;
}

//添加一条特征的返回
message HSetResponse {
	uint64 id = 1;
	string request_id = 2;
	int64 error_code = 3;
	string error_msg = 4;
}
//ANN检索请求
message HSearchRequest {
	string db_name = 1;
	bytes feature = 2;
	uint64 top_k = 3;
	
	enum DistanceType {
		Euclid = 0;
		Cosine = 1;	
	} 
	DistanceType distance_type = 9; 
	string request_id = 10;
}
//ANN 检索返回
message HSearchResponse {
	message Result {
		float score = 2;
		uint64 id = 3;
	}
	repeated Result results = 1;
	string request_id = 2;
	int64 error_code = 3;
	string error_msg = 4;
}
service FaissService
{
	rpc Ping(PingRequest) returns (PingResponse);
	rpc DbNew(DbNewRequest) returns (EmptyResponse);
	rpc DbDel(DbDelRequest) returns (EmptyResponse);
	rpc DbList(DbListRequest) returns (DbListResponse);
	rpc HSet(HSetRequest) returns (HSetResponse);
	rpc HDel(HGetDelRequest) returns (EmptyResponse);
	rpc HGet(HGetDelRequest) returns (HGetResponse);
	rpc HSearch(HSearchRequest) returns (HSearchResponse);
};

faiss-server-1's People

Contributors

chinahbcq avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.