SkillAgentSearch skills...

Gnes

GNES is Generic Neural Elastic Search, a cloud-native semantic search system based on deep neural network.

Install / Use

/learn @gnes-ai/Gnes

README

<p align="center"> <a href="https://gnes.ai"> <img src=".github/gnes-github-banner.png?raw=true" alt="GNES Generic Neural Elastic Search, logo made by Han Xiao"> </a> </p> <p align="center"> <a href="https://cloud.drone.io/gnes-ai/gnes"> <img src="https://cloud.drone.io/api/badges/gnes-ai/gnes/status.svg" /> </a> <a href="https://pypi.org/project/gnes/"> <img alt="PyPI" src="https://img.shields.io/pypi/v/gnes.svg"> </a> <a href='https://doc.gnes.ai/'> <img src='https://readthedocs.org/projects/gnes/badge/?version=latest' alt='Documentation Status' /> </a> <a href="https://www.codacy.com/app/gnes-ai/gnes?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=gnes-ai/gnes&amp;utm_campaign=Badge_Grade"> <img src="https://api.codacy.com/project/badge/Grade/a9ce545b9f3846ba954bcd449e090984"/> </a> <a href="https://codecov.io/gh/gnes-ai/gnes"> <img src="https://codecov.io/gh/gnes-ai/gnes/branch/master/graph/badge.svg" /> </a> <a href='https://github.com/gnes-ai/gnes/blob/master/LICENSE'> <img alt="PyPI - License" src="https://img.shields.io/pypi/l/gnes.svg"> </a> </p> <p align="center"> <a href="#highlights">Highlights</a> • <a href="#overview">Overview</a> • <a href="#install-gnes">Install</a> • <a href="#getting-started">Getting Started</a> • <a href="https://github.com/gnes-ai/hub">Hub</a> • <a href="#documentation">Documentation</a> • <a href="#tutorial">Tutorial</a> • <a href="#contributing">Contributing</a> • <a href="./CHANGELOG.md">Release Notes</a> • <a href="https://hanxiao.github.io/2019/07/29/Generic-Neural-Elastic-Search-From-bert-as-service-and-Go-Way-Beyond/">Blog</a> </p> <h2 align="center">What is it</h2>

GNES [<i>jee-nes</i>] is Generic Neural Elastic Search, a cloud-native semantic search system based on deep neural network.

GNES enables large-scale index and semantic search for text-to-text, image-to-image, video-to-video and any-to-any content form.

<h2 align="center">Highlights</h2> <p align="center"> <a href="https://hanxiao.github.io/2019/07/29/Generic-Neural-Elastic-Search-From-bert-as-service-and-Go-Way-Beyond/">💭 To know more about the key tenets of GNES, read this blog post</a> </p> <center> <table> <tr> <th><h3>☁️</h3><h3>Cloud-Native & Elastic</h3></th> <th><h3>🐣</h3><h3>Easy-to-Use</h3></th> <th><h3>🔬</h3><h3>State-of-the-Art</h3></th> </tr> <tr> <td width="33%"><sub>GNES is <i>all-in-microservice</i>! Encoder, indexer, preprocessor and router are all running in their own containers. They communicate via versioned APIs and collaborate under the orchestration of Docker Swarm/Kubernetes etc. Scaling, load-balancing, automated recovering, they come off-the-shelf in GNES.</sub></td> <td width="33%"><sub>How long would it take to deploy a change that involves just switching a layer in VGG? In GNES, this is just one line change in a YAML file. We abstract the encoding and indexing logic to a YAML config, so that you can change or stack encoders and indexers without even touching the codebase.</sub></td> <td width="33%"><sub>Taking advantage of fast-evolving AI/ML/NLP/CV communities, we learn from best-of-breed deep learning models and plug them into GNES, making sure you always enjoy the state-of-the-art performance.</sub></td> </tr> <tr> <th><h3>🌌</h3><h3>Generic & Universal</h3></th> <th><h3>📦</h3><h3>Model as Plugin</h3></th> <th><h3>💯</h3><h3>Best Practice</h3></th> </tr> <tr> <td width="33%"><sub>Searching for texts, image or even short-videos? Using Python/C/Java/Go/HTTP as the client? Doesn't matter which content form you have or which language do you use, GNES can handle them all. </sub></td> <td width="33%"><sub>When built-in models do not meet your requirments, simply build your own with <a href="https://github.com/gnes-ai/hub">GNES Hub</a>. Pack your model as a docker container and use it as a plugin.</sub></td> <td width="33%"><sub>We love to learn the best practice from the community, helping our GNES to achieve the next level of availability, resiliency, performance, and durability. If you have any ideas or suggestions, feel free to contribute.</sub></td> </tr> </table> </center> <h2 align="center">Overview</h2> <p align="center"> <a href="https://gnes.ai"> <img src=".github/gnes-component-overview.svg" alt="component overview"> </a> </p>

GNES Hub

<center> <table> <tr> <td width="33%"><a href="https://github.com/gnes-ai/hub"> <img src=".github/gnes-hub-github.svg" alt="component overview"> </a></td> <td> <p><a href="https://github.com/gnes-ai/hub">GNES Hub</a> ship AI/ML models as Docker containers and use Docker containers as plugins. It offers a clean and sustainable way to port external algorithms (with the dependencies) into the GNES framework. </p> <p>GNES Hub is hosted on the Docker Hub.</p> </td> </tr> </table> </center> <h2 align="center">Install GNES</h2>

There are two ways to get GNES, either as a Docker image or as a PyPi package. For cloud users, we highly recommend using GNES via Docker.

Run GNES as a Docker Container

docker run gnes/gnes:latest-alpine

This command downloads the latest GNES image (based on Alpine Linux) and runs it in a container. When the container runs, it prints an informational message and exits.

💡 Choose the right GNES image

Besides the alpine image optimized for the space, we also provide Buster (Debian 10.0), Ubuntu 18.04 and Ubuntu 16.04-based images. The table below summarizes all available GNES tags. One can fill in {ver} with latest, stable or v0..xx. latest refers to the latest master of this repository, which may not be stable. We recommend you to use an official release by changing the latest to a version number, say v0.0.24, or simply using stable for the last release, e.g. gnes:stable-ubuntu

<table> <tr> <th>Tag</th> <th>Size and layers</th> <th>Description</th> </tr> <tr> <td><code>{ver}-alpine</code></td> <td><a href="https://microbadger.com/images/gnes/gnes:latest-alpine" title="Get your own image badge on microbadger.com"><img src="https://images.microbadger.com/badges/image/gnes/gnes:latest-alpine.svg"></a></td> <td>based on Alpine Linux;<br>no deep learning libraries;<br>extremely lightweight and portable, enables fast scaling on even edge devices.</td> </tr> <tr> <td><code>{ver}-buster</code></td> <td><a href="https://microbadger.com/images/gnes/gnes:latest-buster" title="Get your own image badge on microbadger.com"><img src="https://images.microbadger.com/badges/image/gnes/gnes:latest-buster.svg"></a></td> <td>based on Debian 10.0;<br>no deep learning libraries;<br>recommended for building or extending a GNES-Hub image.</td> </tr> <tr> <td><code>{ver}-ubuntu18</code></td> <td><a href="https://microbadger.com/images/gnes/gnes:latest-ubuntu18" title="Get your own image badge on microbadger.com"><img src="https://images.microbadger.com/badges/image/gnes/gnes:latest-ubuntu18.svg"></a></td> <td>based on Ubuntu 18.04;<br>no deep learning libraries.</td> </tr> <tr> <td><code>{ver}-full</code></td> <td><a href="https://microbadger.com/images/gnes/gnes:latest-full" title="Get your own image badge on microbadger.com"><img src="https://images.microbadger.com/badges/image/gnes/gnes:latest-full.svg"></a></td> <td>based on Ubuntu 16.04;<br>python-3.6.8, cuda-10.0, tf1.14, pytorch1.1, faiss, multiple pretrained models; <br>heavy but self-contained, useful in testing GNES end-to-endly.</td> </tr> </table>

⚠️ Since 2019/10/21, we have stopped hosting the public mirror Tencent Cloud. The old Docker images still exist, but there won't be new images available on Tencent Cloud anymore.

We also provide a public mirror Github packages. Select the mirror that serves you well.

docker login --username=xxx docker.pkg.github.com/gnes-ai/gnes  # login to github package so that we can pull from it
docker run docker.pkg.github.com/gnes-ai/gnes/gnes:latest-alpine

The table below shows the status of the build pipeline.

<table> <tr><th>Registry</th><th>Build status</th></tr> <tr> <td><sub>Docker Hub</sub><br><code>gnes/gnes:[tag]</code></td> <td><a href="https://drone.gnes.ai/gnes-ai/gnes"><img src="https://drone.gnes.ai/api/badges/gnes-ai/gnes/status.svg" /></a></td> </tr> <tr> <td><sub>Github Package</sub><br><code>docker.pkg.github.com/gnes-ai/gnes/gnes:[tag]</code></td> <td><a href="https://drone.gnes.ai/gnes-ai/gnes"><img src="https://drone.gnes.ai/api/badges/gnes-ai/gnes/status.svg" /></a></td> </tr> </table>

Install GNES via pip

You can also install GNES as a Python3 package via:

pip install gnes

Note that this will only install a "barebone" version of GNES, consists of the minimal dependencies for running GNES. No third-party pretrained models, deep learning/NLP/CV packages will be installed. We make this setup as the default installation behavior, as a model interested to NLP engineers may not be interested to CV engineers. In GNES, models serve as Docker plugins.

🚸 Tensorflow, Pytorch and torchvision are not part of GNES installation. Depending on your model, you may have to install them in advance.

Though not recommended, you can install GNES with full dependencies via:

pip install gnes[all]
<details> <summary>🍒 Or cherry-picking the dependencies according to the table below: (click to expand...)</summary> <table> <tr><td><pre>pip install gnes[bert]</pre></td><td>bert-serving-server>=1.8.6, bert-serving-client>=1.8.6</td> <tr><td><pre>pip install gnes[flair]</pre></td><td>flair>=0.4.1</td> <tr><td><pre>pip install gnes[annoy]</pre></td><td>annoy==1.15.2</td> <tr><td><pre
View on GitHub
GitHub Stars1.3k
CategoryData
Updated12d ago
Forks210

Languages

Python

Security Score

85/100

Audited on Mar 17, 2026

No findings