{"id":14958688,"url":"https://github.com/jay-johnson/antinex-client","last_synced_at":"2025-07-25T22:07:50.113Z","repository":{"id":57410657,"uuid":"126577469","full_name":"jay-johnson/antinex-client","owner":"jay-johnson","description":"AntiNex python client for training and using pre-trained deep neural networks with JWT authentication","archived":false,"fork":false,"pushed_at":"2020-09-04T19:49:18.000Z","size":95,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-31T02:36:53.589Z","etag":null,"topics":["ai","ai-security","anti-nex","artificial-intelligence","deep-neural-networks","jwt","keras","python","rest-client","tensorflow"],"latest_commit_sha":null,"homepage":"http://antinex.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jay-johnson.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-24T07:50:22.000Z","updated_at":"2023-03-22T19:18:42.000Z","dependencies_parsed_at":"2022-08-27T22:01:05.603Z","dependency_job_id":null,"html_url":"https://github.com/jay-johnson/antinex-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jay-johnson%2Fantinex-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jay-johnson%2Fantinex-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jay-johnson%2Fantinex-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jay-johnson%2Fantinex-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jay-johnson","download_url":"https://codeload.github.com/jay-johnson/antinex-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237999429,"owners_count":19399880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-security","anti-nex","artificial-intelligence","deep-neural-networks","jwt","keras","python","rest-client","tensorflow"],"created_at":"2024-09-24T13:17:50.232Z","updated_at":"2025-02-09T18:30:48.458Z","avatar_url":"https://github.com/jay-johnson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"AntiNex Python Client\n=====================\n\nPython API Client for training deep neural networks with the REST API running\n\nhttps://github.com/jay-johnson/train-ai-with-django-swagger-jwt\n\n.. image:: https://travis-ci.org/jay-johnson/antinex-client.svg?branch=master\n    :target: https://travis-ci.org/jay-johnson/antinex-client\n\n.. image:: https://readthedocs.org/projects/antinex-client/badge/?version=latest\n    :target: http://antinex-client.readthedocs.io/en/latest/?badge=latest\n\nInstall\n-------\n\npip install antinex-client\n\nAntiNex Stack Status\n--------------------\n\nAntiNex client is part of the AntiNex stack:\n\n.. list-table::\n   :header-rows: 1\n\n   * - Component\n     - Build\n     - Docs Link\n     - Docs Build\n   * - `REST API \u003chttps://github.com/jay-johnson/train-ai-with-django-swagger-jwt\u003e`__\n     - .. image:: https://travis-ci.org/jay-johnson/train-ai-with-django-swagger-jwt.svg?branch=master\n           :alt: Travis Tests\n           :target: https://travis-ci.org/jay-johnson/train-ai-with-django-swagger-jwt.svg\n     - `Docs \u003chttp://antinex.readthedocs.io/en/latest/\u003e`__\n     - .. image:: https://readthedocs.org/projects/antinex/badge/?version=latest\n           :alt: Read the Docs REST API Tests\n           :target: https://readthedocs.org/projects/antinex/badge/?version=latest\n   * - `Core Worker \u003chttps://github.com/jay-johnson/antinex-core\u003e`__\n     - .. image:: https://travis-ci.org/jay-johnson/antinex-core.svg?branch=master\n           :alt: Travis AntiNex Core Tests\n           :target: https://travis-ci.org/jay-johnson/antinex-core.svg\n     - `Docs \u003chttp://antinex-core-worker.readthedocs.io/en/latest/\u003e`__\n     - .. image:: https://readthedocs.org/projects/antinex-core-worker/badge/?version=latest\n           :alt: Read the Docs AntiNex Core Tests\n           :target: http://antinex-core-worker.readthedocs.io/en/latest/?badge=latest\n   * - `Network Pipeline \u003chttps://github.com/jay-johnson/network-pipeline\u003e`__\n     - .. image:: https://travis-ci.org/jay-johnson/network-pipeline.svg?branch=master\n           :alt: Travis AntiNex Network Pipeline Tests\n           :target: https://travis-ci.org/jay-johnson/network-pipeline.svg\n     - `Docs \u003chttp://antinex-network-pipeline.readthedocs.io/en/latest/\u003e`__\n     - .. image:: https://readthedocs.org/projects/antinex-network-pipeline/badge/?version=latest\n           :alt: Read the Docs AntiNex Network Pipeline Tests\n           :target: https://readthedocs.org/projects/antinex-network-pipeline/badge/?version=latest\n   * - `AI Utils \u003chttps://github.com/jay-johnson/antinex-utils\u003e`__\n     - .. image:: https://travis-ci.org/jay-johnson/antinex-utils.svg?branch=master\n           :alt: Travis AntiNex AI Utils Tests\n           :target: https://travis-ci.org/jay-johnson/antinex-utils.svg\n     - `Docs \u003chttp://antinex-ai-utilities.readthedocs.io/en/latest/\u003e`__\n     - .. image:: https://readthedocs.org/projects/antinex-ai-utilities/badge/?version=latest\n           :alt: Read the Docs AntiNex AI Utils Tests\n           :target: http://antinex-ai-utilities.readthedocs.io/en/latest/?badge=latest\n   * - `Client \u003chttps://github.com/jay-johnson/antinex-client\u003e`__\n     - .. image:: https://travis-ci.org/jay-johnson/antinex-client.svg?branch=master\n           :alt: Travis AntiNex Client Tests\n           :target: https://travis-ci.org/jay-johnson/antinex-client.svg\n     - `Docs \u003chttp://antinex-client.readthedocs.io/en/latest/\u003e`__\n     - .. image:: https://readthedocs.org/projects/antinex-client/badge/?version=latest\n           :alt: Read the Docs AntiNex Client Tests\n           :target: https://readthedocs.org/projects/antinex-client/badge/?version=latest\n\nRun Predictions\n===============\n\nThese examples use the default user ``root`` with password ``123321``. It is advised to change this to your own user in the future.\n\nTrain a Deep Neural Network with a JSON List of Records\n-------------------------------------------------------\n\n::\n\n    ai -u root -p 123321 -f examples/predict-rows-scaler-django-simple.json\n\nTrain a Deep Neural Network to Predict Attacks with the AntiNex Datasets\n------------------------------------------------------------------------\n\nPlease make sure the datasets are available to the REST API, Celery worker, and AntiNex Core worker. The datasets are already included in the docker container ``ai-core`` provided in the default ``compose.yml`` file:\n\nhttps://github.com/jay-johnson/train-ai-with-django-swagger-jwt/blob/51f731860daf134ea2bd3b68468927c614c83ee5/compose.yml#L53-L104\n\nIf you're running outside docker make sure to clone the repo with:\n\n::\n\n    git clone https://github.com/jay-johnson/antinex-datasets.git /opt/antinex/antinex-datasets    \n\nTrain the Django Defensive Deep Neural Network\n----------------------------------------------\n\nPlease wait as this will take a few minutes to return and convert the predictions to a pandas DataFrame.\n\n::\n\n    ai -u root -p 123321 -f examples/scaler-full-django-antinex-simple.json \n\n    ...\n\n    [30200 rows x 72 columns]\n\nUsing Pre-trained Neural Networks to make Predictions\n-----------------------------------------------------\n\nThe `AntiNex Core`_ manages pre-trained deep neural networks in memory. These can be used with the REST API by adding the ``\"publish_to_core\": true`` to a request while running with the `REST API compose.yml`_ docker containers running.\n\nRun:\n\n::\n\n    ai -u root -p 123321 -f examples/publish-to-core-scaler-full-django.json\n\nHere is the diff between requests that will run using a pre-trained model and one that will train a new neural network:\n\n::\n\n    antinex-client$ diff examples/publish-to-core-scaler-full-django.json examples/scaler-full-django-antinex-simple.json \n    5d4\n    \u003c     \"publish_to_core\": true,\n    antinex-client$\n\n.. _AntiNex Core: https://github.com/jay-johnson/antinex-core\n.. _REST API compose.yml: https://github.com/jay-johnson/train-ai-with-django-swagger-jwt/blob/master/compose.yml\n\nPrepare a Dataset\n-----------------\n\n::\n\n    ai_prepare_dataset.py -u root -p 123321 -f examples/prepare-new-dataset.json\n\nGet Job Record for a Deep Neural Network\n----------------------------------------\n\nGet a user's MLJob record by setting: ``-i \u003cMLJob.id\u003e``\n\nThis include the model json or model description for the Keras DNN.\n\n::\n\n    ai_get_job.py -u root -p 123321 -i 4\n\nGet Predictions Results for a Deep Neural Network\n-------------------------------------------------\n\nGet a user's MLJobResult record by setting: ``-i \u003cMLJobResult.id\u003e``\n\nThis includes predictions from the training or prediction job.\n\n::\n\n    ai_get_results.py -u root -p 123321 -i 4\n\nGet a Prepared Dataset\n----------------------\n\nGet a user's MLPrepare record by setting: ``-i \u003cMLPrepare.id\u003e``\n\n::\n\n    ai_get_prepared_dataset.py -u root -p 123321 -i 15\n\nUsing a Client Built from Environment Variables\n-----------------------------------------------\n\nThis is how the `Network Pipeline`_ streams data to the `AntiNex Core`_ to make predictions with pre-trained models.\n\nExport the example environment file:\n\n::\n\n    source examples/example-prediction.env\n\nRun the client prediction stream script\n\n::\n\n    ai_env_predict.py -f examples/predict-rows-scaler-full-django.json\n\n.. _Network Pipeline: https://github.com/jay-johnson/network-pipeline\n.. _AntiNex Core: https://github.com/jay-johnson/antinex-core\n\nDevelopment\n-----------\n::\n\n    virtualenv -p python3 ~/.venvs/antinexclient \u0026\u0026 source ~/.venvs/antinexclient/bin/activate \u0026\u0026 pip install -e .\n\nTesting\n-------\n\nRun all\n\n::\n\n    python setup.py test\n\nLinting\n-------\n\nflake8 .\n\npycodestyle .\n\nLicense\n-------\n\nApache 2.0 - Please refer to the LICENSE_ for more details\n\n.. _License: https://github.com/jay-johnson/antinex-client/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjay-johnson%2Fantinex-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjay-johnson%2Fantinex-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjay-johnson%2Fantinex-client/lists"}