{"id":49341760,"url":"https://github.com/redborder/rb-aioutliers","last_synced_at":"2026-04-27T04:05:01.553Z","repository":{"id":180154753,"uuid":"664700582","full_name":"redBorder/rb-aioutliers","owner":"redBorder","description":"RedBorder Outliers Detector with Keras","archived":false,"fork":false,"pushed_at":"2026-03-20T15:13:06.000Z","size":2292,"stargazers_count":4,"open_issues_count":2,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-21T06:53:49.488Z","etag":null,"topics":["autodelivery","deep-learning","outlier-detection","redborder-ng"],"latest_commit_sha":null,"homepage":"https://redborder.github.io/rb-aioutliers/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redBorder.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-07-10T14:53:09.000Z","updated_at":"2026-03-20T15:05:48.000Z","dependencies_parsed_at":"2023-10-11T19:22:09.073Z","dependency_job_id":"66d8aa00-ca13-4bab-85eb-fea86198a5a0","html_url":"https://github.com/redBorder/rb-aioutliers","commit_stats":null,"previous_names":["redborder/rb-aioutliers"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/redBorder/rb-aioutliers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redBorder%2Frb-aioutliers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redBorder%2Frb-aioutliers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redBorder%2Frb-aioutliers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redBorder%2Frb-aioutliers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redBorder","download_url":"https://codeload.github.com/redBorder/rb-aioutliers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redBorder%2Frb-aioutliers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32321945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["autodelivery","deep-learning","outlier-detection","redborder-ng"],"created_at":"2026-04-27T04:05:00.653Z","updated_at":"2026-04-27T04:05:01.540Z","avatar_url":"https://github.com/redBorder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rb-aioutliers Main package\n\n![test](https://github.com/redBorder/rb-aioutliers/actions/workflows/tests.yml/badge.svg?event=push)\n![lint](https://github.com/redBorder/rb-aioutliers/actions/workflows/lint.yml/badge.svg?event=push)\n![security check](https://github.com/redBorder/rb-aioutliers/actions/workflows/security.yml/badge.svg?event=push)\n[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\n[![codecov](https://codecov.io/gh/redBorder/rb-aioutliers/graph/badge.svg?token=ZGBCLP3865)](https://codecov.io/gh/redBorder/rb-aioutliers)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FredBorder%2Frb-aioutliers.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FredBorder%2Frb-aioutliers?ref=badge_shield)\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FredBorder%2Frb-aioutliers.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FredBorder%2Frb-aioutliers?ref=badge_large)\n\nMain package to install redborder AI outliers in Rocky Linux 9\n\n#### Platforms\n\n- Rocky Linux 9\n\n## Running the example\nThis code shows runs the outlier detection on a mock dataset. Its recomended to use pipenv or similar to avoid overwritting dependencies.\n```bash\ngit clone git@github.com:redBorder/rb-aioutliers.git\ncd rb-aioutliers\npip install -r resources/src/requirements.txt\nbash resources/src/example/run_example.sh\n```\n## Installation\n\n1. yum install epel-release \u0026\u0026 rpm -ivh http://repo.redborder.com/redborder-repo-0.0.3-1.el7.rb.noarch.rpm\n\n2. yum install rb-aioutliers\n\n## Model design\nInitially, data is extracted from a designated druid datasource in timeseries format, with configurable metrics and settings. After rescaling from zero to one and segmentation, an autoencoder reconstructs the data, enabling anomaly detection through k-sigma thresholding.\nThe anomalies are outputed in Json format together with the data reconstructed by the autoencoder.\n\n## Model execution\nrb-aioutliers utilizes the Flask framework to create an HTTP server. Users can send Druid queries via POST requests to the /calculate endpoint. When rb-aioutliers receives the Druid query, it sends a request to the Druid broker, retrieves the necessary data, and then proceeds to execute the anomaly detection model.\n\n![img](https://lh3.googleusercontent.com/fife/AK0iWDzo4KPabRCLUNYy9rYH6MyVZeihkZsxeJ27o9FMmKfgCr8h5HOG4o-KxfhxkITIS3a5uk1IgP344kL8bMBxi8GakpIaO9_Gwh8GNPABIpJIkn-CAoBa1pOjg3sWGPKpdc3GetxIq1PINzlbXABCxLUWUpm4EVpZymlCh7MLdP5U8wjjXw_dTLCvyRHbZ2axvNuRTDa7D-uWQ-Fw0AtdVKF66hH4otUm9x7Z6jwP-PhVRD0uZMuWY6gMEw9aoopRbCw0C9s77Y10O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8GFtj1rRXMgXBv_2dIIyKXwnaQSjxRTnk-SFLXvXLxHK4oW4Uu0IS1jXnrSiOijHGeH4TG2adaHEZRM9zlv1OXepXO-V4ytXaYHasZpmFfPwj43lxyyO78r3ax_Vpp1ZR3PpXVdrTlT9oT7_0ilXbIjXTb8feminLsow0aSdXcisTWiMhvhkqpplAOh-U_XMTqZSfJpwlYm_Vcq-YRFJ_7FSGjgN69ZUAQOdkJgoRI0-rfUq-Ev0iEg=w800-h600)\n\nAfter executing the model, the server can respond with one of two status messages:\n\n`HTTP OK 200 Success`: In this case, the response body will be structured as follows:\n```\n{\n    \"status\": \"success\",\n    \"anomalies\": [Array_of_anomalies],\n    \"prediction\": [Array_of_predictions]\n}\n```\n\n`HTTP 500 Internal Server Error`: If there is an issue during the process, the response will contain an error message:\n```\n{\n    \"status\": \"error\",\n    \"msg\": \"Error_description_message\"\n}\n```\n\n## Model training\n\nThe rb-aioutliers service generates a custom Druid query and sends it to the Redborder cluster Druid broker. After sending the query, it retrieves the data and attempts to train a model with custom parameters such as epochs or batch size. Once the model training is complete, it outputs a backup file and the generated Keras model.\n\n![img](https://lh3.googleusercontent.com/fife/AK0iWDxKcNUlsurVY1EDmdCojOMiDBQXdL8BDpMjOMMIdfAxSp2v9IPqDXO73dWW8YY30RBYHO4CABByfWG1ma0t52bqI99fDpMeYaEynaUfIrEfAx-IdKaH96801XoJCQT6313F1o56yCisWEM5NK43FOoFY38z28dPr06-RKlknxGrEjLPUCRvrYNIpTPyRIBGo-CGOVCdY5c7rxVvBGT2IoanqxuqwJQ87dmHJNCutQl6OfV3kFgNCGGMao4HcE5_VGUfWiPAJhfQhWZ1fQMmlV68zOxYDLJVCYnEa--g4Us3Qkyy1kyZDYg9pLUnG2T7tseObfolqoMY-MRAwX7uRCTYcEHQ7cycdV8herPZ2cManSgmVIEtRlw11FAO0ylHLrJIMQZn3oYLUysY44XnSnhOESMACVEYaBjyBFdXFJBPR2ux8YZ3FUDajteAaYU1rZDdMgZWT90gl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zRNLovaB6D5AM1IAx9R_O=w917-h1001)\n\n## Clusterization with Chef, Consul, AWS S3 \u0026 Redis\n\nThe rb-aioutliers service can operate in cluster mode! This is achieved by dividing the service into two components: the executor and the trainer.\n\n# Executor\n\nThe executor service is registered in HashiCorp Consul. When the Redborder WebUI sends a request to api/v1/outliers, it will be directed to the rb-aioutliers.service, which, in turn, will redirect the request to any of the nodes running the rb-aioutliers REST server. This server will download the relevant model from S3, based on the sensor specified in the Druid query, and execute it.\n\n![img](https://lh3.googleusercontent.com/fife/AK0iWDy8WmafImK6qwhmjyQiZXrcGEiEaS8isuI4eTTI3Wb-ulet7CSYuEQ1TFkxbdFa69pXhZAZV__DGnKdBO_ud9lTGylyBGxOYtf56CX0hdnO1-jin1K1b1Xuz2ye3vAe1CjvyxRj431Igmj1ooYP9vZijvp7Vc-RUMdjPgQ4t2och2w4K5kfOoukG-NcT34hcAa7be9sKjhPrfiTaH37VoaKfrE-h7MdK3V0dIy3syqtWEHFxHm86oYVX3NFvNK_WRzH99N8L-qPrUiVtzGHA0dJ-f90eqe5v3vg27RcQ22fz1TDvsaBifZukF8ERvd-mVdMhCYFnnDqd0ZDCNMM2oflCaEUERNHHLLSl6PPNtVxSjrQwDWjRCgNHN_cc6B0ytY58T2oETdc6_dWzj707fTnWxqppzfcMm8Uc9PB0v2QNXcRMoDLuFZIVgXTONXo1bzAaASe1rHwooC3alj9l4N47b8gJgOysxKxYYS_MoGN2Rn4mqT7Jwd3jWQDFjJgzaYQKqkBzNUZA5kjlu_9_KKnn4png21y5-IdzjizlIYepIQL3PeXrXUidLwWM2gELRCZCcrvMAO9_hnqmNBbOQUlqXwMqlOyVOP7hQ4HY5VzgfHx0lCFNxj14pMr6UPEaGAGpXWmMUawfW-d5JXGpqJK2_rGrNx9UdOoMDMT7rnEoOg1OGnsyECLDIZqQNu2X6NvxTdAFNWtnEby8kN7y1EFhGYxIYjpPVgCNE42tNIvoeoDpekRW5EXLUkwOu44n3zB_YkV3QiDDejwERZnWCHUdd_gJnpmnWOy6XPKF6JKP7wA-TSIHJLqWBgVYU0PgUJGLxsiM8gSp9rcBNp1sObRhnxvA03xcwF0wSP76JtD9Q-EirdnO0m-zlyRsyvGcZTPfuKQ1AqSnLyoqG5BjP4Pi3MZPB8bwacau5-ZaOLnowRmU7CHqfTvkt4QSyUav79yovJOqzXEhKMDgbc-JCSYcRo_4MnVSZn1i3MrkY0hfR3qvss0_3aquhJnKg-hN30h-1DOvcq3rBHph08TKPvP66jEnH4lUwPGZc0hhZ2SMFW6vfNHhewn6LOveNZvAy5uW95wownGTGHnMz3kd47E_ZRQhbshax0VTWB68_r7prfZ7mgys5IocwfteBOlmN9Hr0vfXWJvO-JkHwrVRuR0dKGbMuoPgUQH_mw5HHaQAunKRMb9kzqsW-qI_3DSdhebjuC_JAa-0FTb7XEZphL25HiZXV2jc4wjASGWqWcmpn4oJqp68yqzoxhmBbYY4dcBd3wKqBisTgOTEH8BvBIBkfxcrXn2XaF9c9kYbEHRH8aoYkFDTwrjDx069bnGGt8eAOjtebNWBPOIuWj0KoOY8IK_U9z2C-M2eGoQm0LzDWIaqErlHLfkwPYmnK8oWiLySU-1LXdPCHlpLuiq7nF-gUoYeSo2YkvtZ37ePSv02qG1NcupcWhmaPwKm85_8JMDedUDX_JJDtHGSCl7QLNnknOq-hxguxuVqPnwdYbJ7DDi8uc_WrjHuNoCCB7ULDDHkD0_DdCYJ1OwfcbEtt0UUQ1O48N0E6J96Wzr2kV8wqvx8lKpPdAg_w=w917-h1001)\n\n# Trainer\n\nFor the training service, the Chef client will create individual configuration files for each node, which are generated based on the cookbook and templates. These configuration files specify which sensor should be trained for. The rb-aioutliers-train service will then proceed to (**take a look at Trainer jobs below**) download the appropriate model from S3 for each node. Once the training is completed, the rb-aioutliers-train service will upload the resulting trained model to S3. It's important to note that each model is unique and specific to the corresponding sensor.\n\n![img](https://lh3.googleusercontent.com/fife/AK0iWDzJQsuEVd3J7tjtik1AVt7ebGPOP3jkyI9UlbCZH_8Vd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ImLTm8qDjovI472gjDikXTXT6lV1ZBE5mCrevLIftlb4xBZeY-Chk-pYxDUt6beoGe6zz1GnL9a_JopJ54xlA9E-BeEIN2QjD6SychjV6lhiuW37yT8zIFcWZSAYpCTXkj6hQSScs3-VoLcpCP-dMgIfaP6RuRaKr2RHgYZn07a3_75me8QVf9hEfLEJAvAkqvJ8GNmPEFLhmFHu9gYH3nZVipnzp5NzKmcOMplMx1Jk6TGAgB0nTFolsEKTHVH0jIPJ1m6WVOKnfXh934WX7JIaC-JfY0uI8S3T0V5Wvn4kN_BU0cpfV1-_6nBeU-jVsGXTKrtfKCp7dv-A8lLjFl8a5hZQKckoLSCph8_LCl7c427-zlpBn9g1DqIP54xI1m1Lczw5w2y5h7bS9ye-CVv91l1lRZn3NSkNPpQneaBCR1VKGYc6Jse8v4Vv5vfrOiNylEOVa6UGjSrl5AtKJD24Rzos11AxMSItJRtVz6eQmAkQ=w918-h1002)\n\n# Trainer Jobs\n\nThe trainer nodes send job data to a Redis server (this is done by the ```Trainer service```). Each node also requests the job queue. The RQ worker processes these jobs in the background. If any node goes down, there will be no problem, as the sensor information for training is stored in Redis, and another node can take over its tasks.\n\n![img](https://lh3.googleusercontent.com/fife/AK0iWDw5h78LX5D8lkgspzSvhWiKvl81nPJI7Cmaz1yJGvVo13PqydmNWpwVfwJ_wvtx_4xFkItgPqBFQY0ft2LaM7i_HIpO3iokK2gTlX_v7TzRuOEqz14J-DmN5PceuoxzNoaEEN6tP6XBP1eMxqI3SnF3kc8e6tv4aO9uAmQEXo6queFD4LFCzXfPmkuOrQIjtqwRfrhO8Znn5w9AOwA93wIMTyxnEPbrsSMwDNmD0lN7VNfLI5hwGcbDkV70v87-u8JhBdEbtcHFaG57jY0o9AyUzKFLJW72ZwulMLYFIqndzcMpUU3XUTM0_3U2A2C_2JvvDRmt91AFOgEN70b2fpH5Tm06wUeENAQ6d9pwdQi1ZIs8wobl4Ijhmi9R-cKo5LJYitxFcgcOHIun4Mk52Vl1fC1ErT6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7ohzqM_2KnXdIBqmsRum4C71XImCW-jDBMiOKPODAZaUq2WCD4jM_GIihD6UITbDkGAfJpkphQXP8MmGAsg80kVs1MFjoLkJcFF8IhNh_04Fow=w918-h986)\n\nFor more info about deploy with Chef Server take a look at [Outliers Cookbook](https://github.com/redBorder/cookbook-rb-aioutliers)\n\n## Docker support\n\nIf you want to run the app inside a docker container run the following commands\n\n```bash\ncd ./resources/src\ndocker-compose up --build -d\n```\n\nnow if you list your docker container you will see the following container running.\n\n| Container ID   | Image                    | Command                | Created         | Status         | Exposed Ports                               |\n|-----------------|--------------------------|------------------------|-----------------|-----------------|---------------------------------------------|\n| cb18a72ab60e   | src_rb_aioutliers_rest   | python __main__.py     | 3 minutes ago   | Up 3 minutes   | 0.0.0.0:39091-\u003e39091/tcp, :::39091-\u003e39091/tcp |\n\n\n## API Endpoints\n\n### `/calculate`\n\n- **HTTP Method:** POST\n- **Description:** Initiates anomaly detection (model execution) with a Druid query.\n- **Request Body:** JSON data containing the Druid query in base64 string.\n\n**Example Request:**\n```application-x-www-form-urlencoded\nPOST /calculate (application-x-www-form-urlencoded)\nquery=base64_string\n```\n**Example Druid Query:**\n```\n{\n  \"dataSource\": \"rb_flow\",\n  \"granularity\": {\n    \"type\": \"period\",\n    \"period\": \"pt1m\",\n    \"origin\": \"2023-09-21T09:00:00Z\"\n  },\n  \"intervals\": [\n    \"2023-09-21T09:00:00+00:00/2023-09-21T10:00:00+00:00\"\n  ],\n  \"filter\": {\n    \"type\": \"selector\",\n    \"dimension\": \"sensor_name\",\n    \"value\": \"FlowSensor\"\n  },\n  \"queryType\": \"timeseries\",\n  \"context\": {\n    \"timeout\": 90000,\n    \"skipEmptyBuckets\": \"true\"\n  },\n  \"limitSpec\": {\n    \"type\": \"default\",\n    \"limit\": 100,\n    \"columns\": []\n  },\n  \"aggregations\": [\n    {\n      \"type\": \"longSum\",\n      \"name\": \"bytes\",\n      \"fieldName\": \"sum_bytes\"\n    }\n  ],\n  \"postAggregations\": []\n}\n```\n**Example Respone:**\n```\n{\n  \"anomalies\": [\n    {\n      \"expected\": 36453984.6858499,\n      \"timestamp\": \"2023-09-28T07:00:00.000Z\"\n    },\n    {\n      \"expected\": 36453984.6858499,\n      \"timestamp\": \"2023-09-28T07:00:00.000Z\"\n    },\n    {\n      \"expected\": 36453984.6858499,\n      \"timestamp\": \"2023-09-28T07:00:00.000Z\"\n    },\n    {\n      \"expected\": 36453984.6858499,\n      \"timestamp\": \"2023-09-28T07:00:00.000Z\"\n    },\n    {\n      \"expected\": 36453984.6858499,\n      \"timestamp\": \"2023-09-28T07:00:00.000Z\"\n    },\n    {\n      \"expected\": 36453984.6858499,\n      \"timestamp\": \"2023-09-28T07:00:00.000Z\"\n    },\n    {\n      \"expected\": 36453984.6858499,\n      \"timestamp\": \"2023-09-28T07:00:00.000Z\"\n    },\n    {\n      \"expected\": 36453984.6858499,\n      \"timestamp\": \"2023-09-28T07:00:00.000Z\"\n    },\n    {\n      \"expected\": 36453984.6858499,\n      \"timestamp\": \"2023-09-28T07:00:00.000Z\"\n    },\n    {\n      \"expected\": 36453984.6858499,\n      \"timestamp\": \"2023-09-28T07:00:00.000Z\"\n    },\n    {\n      \"expected\": 45825798.264862545,\n      \"timestamp\": \"2023-09-28T07:01:00.000Z\"\n    }\n  ],\n  \"status\": \"success\"\n}\n```\n\n## Contributing\n\n1. Fork the repository on Github\n2. Create a named feature branch (like `add_component_x`)\n3. Write your change\n4. Write tests for your change (if applicable)\n5. Run the tests, ensuring they all pass\n6. Submit a Pull Request using Github\n\n## License and Authors\n\n- Miguel Álvarez Adsuara \u003cmalvarez@redborder.com\u003e\n- Pablo Rodriguez Flores \u003cprodriguez@redborder.com\u003e\n\nLICENSE: AFFERO GENERAL PUBLIC LICENSE, Version 3, 19 November 2007\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredborder%2Frb-aioutliers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredborder%2Frb-aioutliers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredborder%2Frb-aioutliers/lists"}