{"id":17494588,"url":"https://github.com/bsenst/streamlit-llm","last_synced_at":"2025-04-10T22:19:36.193Z","repository":{"id":193064862,"uuid":"688019560","full_name":"bsenst/streamlit-llm","owner":"bsenst","description":"The purpose of this application is to test LLM-generated interpretations of medical observations. The explanations are generated fully automatically by a large language model. This application should be used for experimental purposes only. It does not provide support for real world cases and does not replace advice from medical professionals.","archived":false,"fork":false,"pushed_at":"2023-11-27T21:30:53.000Z","size":8966,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T19:21:39.305Z","etag":null,"topics":["diagnosis","fhir","hallucinations","llm","observations","streamlit","synthea"],"latest_commit_sha":null,"homepage":"https://experimental-clinical-support.streamlit.app/","language":"Jupyter Notebook","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/bsenst.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}},"created_at":"2023-09-06T13:36:00.000Z","updated_at":"2025-01-08T14:51:10.000Z","dependencies_parsed_at":"2023-11-27T22:35:08.906Z","dependency_job_id":null,"html_url":"https://github.com/bsenst/streamlit-llm","commit_stats":null,"previous_names":["bsenst/streamlit-llm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsenst%2Fstreamlit-llm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsenst%2Fstreamlit-llm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsenst%2Fstreamlit-llm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsenst%2Fstreamlit-llm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsenst","download_url":"https://codeload.github.com/bsenst/streamlit-llm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248306306,"owners_count":21081659,"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":["diagnosis","fhir","hallucinations","llm","observations","streamlit","synthea"],"created_at":"2024-10-19T13:28:26.544Z","updated_at":"2025-04-10T22:19:36.174Z","avatar_url":"https://github.com/bsenst.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# streamlit-llm\n\n## Understanding Medical Observations with Large Language Models\n\nThe purpose of this application is to test LLM-generated interpretations of medical observations. \nThe explanations are generated fully automatically by a large language model. \nThis application should be used for experimental purposes only. \nIt does not provide support for real world cases and does not replace advice from medical professionals.\n\nhttps://experimental-clinical-support.streamlit.app/\n\n### Architecture\n\n![app-architecture-image](https://github.com/bsenst/streamlit-llm/assets/8211411/d5bc2063-b5fb-43ad-9220-8c5d16954024)\n\n* Streamlit caching loaded Synthea synthetic medical data\n* Prompting with LangChain PromptTemplate\n* LLM served by Clarifai backend\n\n### Run the app\n\n```\npip install -r requirements.txt\nstreamlit run Main.py\n```\n\n### Data source\n\nhttps://synthetichealth.github.io\n\n## Discussion\n\n* Consider changes of values over time instead of interpreting each time point individually\n* Interpret measurements with context (age, gender)\n* Consider different national diagnostic criteria\n* Preserving privacy while interacting with LLMs\n* Parse LLM output and process for further queries\n* Warning labels according to clinical significance of the results\n* Guardrails to guide user input\n\n### Prompt engineering\n\n* Better prompts = better LLM results https://learnprompting.org/docs/basics/prompt_engineering#what-happens-when-a-prompt-doesnt-work\n* Instruction prompts https://learnprompting.org/docs/basics/instructions\n* Assigning roles https://learnprompting.org/docs/basics/roles\n* Few-shot prompt vs instruction prompt https://learnprompting.org/docs/basics/few_shot#more-on-structure\n* CoT Chain-of-Thought https://learnprompting.org/docs/intermediate/chain_of_thought\n* Ensembling\n    * AMA https://learnprompting.org/docs/reliability/ensembling#ask-me-anything-ama-prompting\n    * Diverse Verifier on Reasoning Steps https://learnprompting.org/docs/reliability/ensembling#diverse\n* Calibration https://learnprompting.org/docs/reliability/calibration\n\n### Problem: Hallucinations\n\n\u003e Respiratory rate: This is the number of breaths a person takes per minute. A normal respiratory rate for an adult at rest is between 12 and 20 breaths per minute. In this case, the patient's respiratory rate is 14 breaths per minute, which is slightly higher than normal.\n\n\u003e Input: Erythrocyte distribution width [Entitic volume] by Automated count, Platelet distribution width [Entitic volume] in Blood by Automated count\n\u003e [...]\n\u003e Output: So, in simple terms, these observations are telling us that the red blood cells in this patient's blood are spread out over a pretty big range of sizes, and the machine that counted them got a slightly higher measurement than the manual count.\n\n## Hackathon resources\n\n* https://streamlit.io/community/llm-hackathon-2023\n* https://discuss.streamlit.io/t/streamlit-llm-hackathon/50618\n\n### Evaluation criteria\n\n* Inventive\n* Error-free\n* Public repo\n* Hosted on community cloud\n* Tools: LangChain, Clarifai, ...\n* LLM pain points: transparency, trust, accuracy, privacy, cost reduction, ethics\n\n## Learning resources\n\n* LLM\n    * https://aiplanet.com/learn/llm-bootcamp\n* Prompting\n    * https://langchain.readthedocs.io/en/latest/\n    * https://learnprompting.org/\n    * https://apps.cognitiveclass.ai/learning/course/course-v1:IBMSkillsNetwork+AI0117EN+v1\n* Monitoring\n    * https://github.com/whylabs/langkit\n    * https://arize.com/llm/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsenst%2Fstreamlit-llm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsenst%2Fstreamlit-llm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsenst%2Fstreamlit-llm/lists"}