{"id":19316371,"url":"https://github.com/ivangolt/ml_service_fastapi_celery_rabbitmq_redis","last_synced_at":"2026-05-04T20:31:22.942Z","repository":{"id":245685940,"uuid":"818957451","full_name":"ivangolt/ml_service_fastapi_celery_rabbitmq_redis","owner":"ivangolt","description":"Highload ML service","archived":false,"fork":false,"pushed_at":"2024-06-23T11:38:57.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-06T04:12:12.323Z","etag":null,"topics":["celery","fastapi","python","rabbitmq","redis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivangolt.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-23T11:11:45.000Z","updated_at":"2024-07-18T17:37:35.000Z","dependencies_parsed_at":"2024-06-23T12:52:51.583Z","dependency_job_id":null,"html_url":"https://github.com/ivangolt/ml_service_fastapi_celery_rabbitmq_redis","commit_stats":null,"previous_names":["ivangolt/ml_service_fastapi_celery_rabbitmq_redis"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivangolt%2Fml_service_fastapi_celery_rabbitmq_redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivangolt%2Fml_service_fastapi_celery_rabbitmq_redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivangolt%2Fml_service_fastapi_celery_rabbitmq_redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivangolt%2Fml_service_fastapi_celery_rabbitmq_redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivangolt","download_url":"https://codeload.github.com/ivangolt/ml_service_fastapi_celery_rabbitmq_redis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240420938,"owners_count":19798501,"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":["celery","fastapi","python","rabbitmq","redis"],"created_at":"2024-11-10T01:11:05.537Z","updated_at":"2026-05-04T20:31:17.898Z","avatar_url":"https://github.com/ivangolt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Model Service Api\n\nExample The ML service is a web application that provides an API for interacting with a machine learning model. It allows users to send queries with prediction data and get results back.\n\n**Startup logic:**\n\nWhen launched, the application initializes FastAPI, which handles HTTP requests. The app also connects to the machine learning model and loads it into memory for use in making predictions.\n\n## Operational logic\n\n- Client sends HTTP request with text data in json to FastAPI asynchronous endpoint.\n- FastAPI receives the request, validates it and creates a new Celery task.\n- Celery places the task in the queue of the RabbitMQ broker running \"under the bonnet\".\n- The Celery Worker retrieves the task from the RabbitMQ queue, then sends the request to the ML model, receives the response, and returns the result.\n- Redis is used to cache intermediate results and speed up repeated queries with the same data.\n- The response is returned via RabbitMQ to FastAPI, which sends it back to the client as an HTTP response.\n```\n.\n├── .docker\n│   └── Dockerfile              # Docker image with app\n├── docker-compose.yml          # Docker container managing\n├── pyproject.toml              # Dependencies\n└── src\n    ├── app.py                  # Main app, FastAPI initializing\n    ├── api                     # Package with API routes\n    │   ├── __init__.py\n    │   └── routes              # Package with API routes\n    │       ├── __init__.py\n    │       ├── healthcheck.py  # Route to check the srvice status\n    │       ├── predict.py      # Route for model predictions\n    │       └── router.py       # Main router\n    ├── celery                  # Package with data models\n    │   ├── __init__.py\n    │   ├── celery_init.py      # Celery initializing\n    │   └── worker.py           # Celery worker\n    └── services                # Package with ML model\n        ├── __init__.py\n        ├── model.py            # ML model with prediction\n        └── utils.py            # Supporting utilities\n```\n\n## Getting started with Docker Compose\n\n`docker-compose up --build`\n\nWeb-server on\n\n`http://localhost:8000`\n\nUI on\n\n`http://localhost:8000/docs`\n\n\n## Running local\n\n`pip install --no-cache-dir poetry`\n\n`poetry install --no-dev`\n\n`poetry run uvicorn src.app:app --host localhost --port 8000`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivangolt%2Fml_service_fastapi_celery_rabbitmq_redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivangolt%2Fml_service_fastapi_celery_rabbitmq_redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivangolt%2Fml_service_fastapi_celery_rabbitmq_redis/lists"}