{"id":29015387,"url":"https://github.com/deven367/deven-cleric-backend","last_synced_at":"2026-05-20T14:06:16.597Z","repository":{"id":235039992,"uuid":"789416517","full_name":"deven367/deven-cleric-backend","owner":"deven367","description":"repo for the cleric assessment","archived":true,"fork":false,"pushed_at":"2024-04-21T22:44:22.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T21:06:58.184Z","etag":null,"topics":["fastapi","gpt-4"],"latest_commit_sha":null,"homepage":"https://deven-cleric-backend.onrender.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deven367.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-04-20T13:42:41.000Z","updated_at":"2024-08-20T19:05:28.000Z","dependencies_parsed_at":"2024-04-22T04:06:39.388Z","dependency_job_id":null,"html_url":"https://github.com/deven367/deven-cleric-backend","commit_stats":null,"previous_names":["deven367/deven-cleric-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/deven367/deven-cleric-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deven367%2Fdeven-cleric-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deven367%2Fdeven-cleric-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deven367%2Fdeven-cleric-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deven367%2Fdeven-cleric-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deven367","download_url":"https://codeload.github.com/deven367/deven-cleric-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deven367%2Fdeven-cleric-backend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268385755,"owners_count":24242104,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"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":["fastapi","gpt-4"],"created_at":"2025-06-25T21:06:52.013Z","updated_at":"2026-05-20T14:06:16.550Z","avatar_url":"https://github.com/deven367.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deven-cleric-backend\n\nFor the backend, I have used `fastapi` and `pydantic` for data validation. The model working on the backend to give insights from the logs is GPT-4.\n\nThe OpenAI's API key is set as an environment variable in the configuration on the deployment.\n\n## To run the backend locally\n\n```sh\npip install -r requirement.txt\n```\n\nOnce the requirements are installed, run the command\n\n```sh\nuvicorn api:app --reload\n```\n\nto run the app locally.\n\n## Model choice\n\nUpon some testing, I found GPT-3.5 Turbo also working reliably. However, I went GPT-4 for a safer measure. GPT-4 takes slightly longer than GPT-3.5 for receiving the response, but the quality of the reponse is better than GPT-3.5.\n\n## Code organization and approach\n\nThe code is organized in the following way:\n\n```md\n|- api.py               # FastAPI app\n|- ask_gp4.py           # GPT-4 model\n|- responses.py         # Pydantic Response model\n|- requirements.txt     # Requirements\n```\n\n1. The `api.py` file contains the FastAPI app, which has two endpoints `/submit_question_and_documents` which takes a `POST` request with a JSON body containing the `question` key and urls of logs.\n2. The `POST` request is validated using Pydantic models. The logs are fetched from the URLs by sending a `GET` request and the question and logs are sent to the GPT-4 model.\n   1. All the logs are concatenated and sent to the GPT-4 model, so that has the entire context for generating the response.\n   2. Once the logs are concatenated, the processed payload is written to a file.\n   3. The `GET` endpoint then reads the file, checks if the logs were fetched correctly, and if not, it returns an error. Else, it sends the payload to the GPT-4 model.\n3. The `ask_gp4.py` file pings the GPT-4 endpoint, which is used to generate the response.\n4. The `responses.py` file contains the Pydantic Response model, which is used to validate the response from the GPT-4 model.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeven367%2Fdeven-cleric-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeven367%2Fdeven-cleric-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeven367%2Fdeven-cleric-backend/lists"}