Skip to main content

Main backend module, which is used for developing web-app logic and deploying AI model.

Project description

ANNHUB Python library

Main backend module, which is used for developing web-app logic and deploying AI model by just a few lines of code.

Usage

We develop a RESTful web controller into a reusable library between many AI models. With these functionalities: Input model, Define data input, logging, exception handler.

Installing

Delivering and versioning as a PyPi package. Install and update using pip:

$ pip install annhub-python

A simple example

from annhub_python import PyAnn

app = PyAnn()

# Define the expected AI model
app.set_model("D:\ARI\ANSCENTER\TrainedModel_c++.ann")

# Define which model ID will be used
app.set_model_id(5122020)

# Define the input corresponding to the choosen model
app.set_input_length(4)

if __name__ == "__main__":
    app.run()

API

The library will product two APIs: health checking, predicting as well as a Swagger UI for API documentation.

GET: /api/v1/health
POST: /api/v1/predict

Swagger UI

Detailed Example

Iris Prediction server

In this example, we illustrate how to develop a server by using AI model powered by ANNHUB with only few steps. You can use this link to access our code. The procedure of using our library to server AI model is as follows:

  1. Put a trained model into your project folder.
  2. Create main.py file, where some key information will be determined such as model path, model id, input length,...
  3. Create Dockerfile to containerize your application. (We recommend to reuse our Dockerfile).
  4. Create docker-compose.yml file, which will construct your docker container by a simple command line. (We also recommend to use as our instruction)
  5. Run your application be a simple command line:
docker-compose up -d
  1. With default settings, your AI can be used at http://localhost:8080. You can access http://localhost:8080/docs to use your Swagger UI documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

annhub_python-0.1.6.tar.gz (56.3 kB view details)

Uploaded Source

Built Distribution

annhub_python-0.1.6-py3-none-any.whl (57.8 kB view details)

Uploaded Python 3

File details

Details for the file annhub_python-0.1.6.tar.gz.

File metadata

  • Download URL: annhub_python-0.1.6.tar.gz
  • Upload date:
  • Size: 56.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.8.8 Windows/10

File hashes

Hashes for annhub_python-0.1.6.tar.gz
Algorithm Hash digest
SHA256 c67301ca7facb52d13c636b35f371b89e16ee210df0f44767fa683721b96c413
MD5 03e76a9c003d644ca98450c9bc985295
BLAKE2b-256 82b27eaf7a49a709e177f865565bfeb8f9caaf77f45171692724be073a4378da

See more details on using hashes here.

File details

Details for the file annhub_python-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: annhub_python-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 57.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.8.8 Windows/10

File hashes

Hashes for annhub_python-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f4c4e74e4def1a967eb57d701bddc6de064602bf6e2a380456591f9991d19588
MD5 358aaa7427ecd30b6a62bb5e099673c9
BLAKE2b-256 5fe148bd8f3b7fbc8bd12f0cf40e9b4137a09a722eec45223544f9aed59c7e61

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page