{"id":20932199,"url":"https://github.com/ashnkumar/llm-full-stack-tutorial","last_synced_at":"2025-04-11T13:37:32.834Z","repository":{"id":208341561,"uuid":"721396776","full_name":"ashnkumar/llm-full-stack-tutorial","owner":"ashnkumar","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-19T18:53:49.000Z","size":355,"stargazers_count":34,"open_issues_count":3,"forks_count":16,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-25T09:52:46.771Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ashnkumar.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,"publiccode":null,"codemeta":null}},"created_at":"2023-11-21T01:20:35.000Z","updated_at":"2025-02-24T06:09:43.000Z","dependencies_parsed_at":"2023-11-27T03:29:23.237Z","dependency_job_id":"cd40f729-e0f4-4ca5-ad84-68f118a5f7cb","html_url":"https://github.com/ashnkumar/llm-full-stack-tutorial","commit_stats":null,"previous_names":["ashnkumar/llm_full_stack_tutorial"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashnkumar%2Fllm-full-stack-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashnkumar%2Fllm-full-stack-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashnkumar%2Fllm-full-stack-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashnkumar%2Fllm-full-stack-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashnkumar","download_url":"https://codeload.github.com/ashnkumar/llm-full-stack-tutorial/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248410302,"owners_count":21098774,"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":[],"created_at":"2024-11-18T21:47:25.974Z","updated_at":"2025-04-11T13:37:32.806Z","avatar_url":"https://github.com/ashnkumar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URL Q\u0026A\n*Full-stack LLM application with OpenAI, Flask, React, and Pinecone*\n\n\u003cimg src=\"https://media4.giphy.com/media/v1.Y2lkPTc5MGI3NjExczdhcjIyZTd1YWZmdDdsem1rbTd3c2VjYnR6YmtmcTF5bjFuajAzciZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/oolHrmHDE9XtZtSLG8/giphy.gif\" width=\"800\"\u003e\n\nThis is a sample application built for the following tutorial series, \"Build a full-stack LLM application with OpenAI, Flask, React, and Pinecone\". It allows a user to input a URL and ask questions about the content of that webpage. It demonstrates the use of Retrieval Augmented Generation, OpenAI, and vector databases.\n* **[Part 1:](https://shwinda.medium.com/ceda4e290c33](https://medium.com/@shwinda/build-a-full-stack-llm-application-with-openai-flask-react-and-pinecone-part-1-f3844429a5ef))** Backend and RAG with Python, OpenAI, and Pinecone ([branch](https://github.com/ashnkumar/llm_full_stack_tutorial/tree/part1_backend))\n* **[Part 2:](https://medium.com/@shwinda/build-a-full-stack-llm-application-with-openai-flask-react-and-pinecone-part-2-ceda4e290c33)** Front-end chat user interface with React ([branch](https://github.com/ashnkumar/llm_full_stack_tutorial/tree/part2_frontend))\n* **Part 3 (coming):** Tracking important metrics for a production LLM application\n\n## Architecture\n\u003cimg src=\"https://i.imgur.com/FqOr8t8.png\" witdth=\"800\"\u003e\n\n### Components of the full application:\n* **Backend (Flask):** This handles the logic to scrape the website and call OpenAI's Embeddings API to create embeddings from the website's text. It also stores these embeddings in the vector database (Pinecone) and retrieves relevant text to help the LLM answer the user's question.\n* **OpenAI:** We'll call two different API's from OpenAI: (1) the Embeddings API to embed the text of the website as well as the user's question, and (2) the ChatCompletions API to get an answer from GPT-4 to send back to the user.\n* **Pinecone:** This is the vector database that we'll use to (1) send the embeddings of the website's text to, and (2) retrieve the most similar text chunks for constructing the prompt to send to the LLM in step 3.\n* **Frontend (React):** This is the interface that the user interacts with to input a URL and ask questions about the webpage.\n\n\n## Setup\n\n**Install Python dependencies**\n\n```sh\npip install -r requirements.txt\n```\n**Install React dependencies**\n```sh\ncd client\nnpm install\n```\n\n**Create .env file**\n```sh\nOPENAI_API_KEY=\u003cYOUR_API_KEY\u003e\nPINECONE_API_KEY=\u003cYOUR_API_KEY\u003e\n```\n\n**Start the Flask server**\n```sh\n# In root directory\npython run.py\n```\n\n**Start the React app**\n```sh\ncd client\nnpm start\n```\n\n## License\n\n### The MIT License (MIT)\n\nCopyright (c) 2023 Ashwin Kumar\u003cash.nkumar@gmail.com@gmail.com\u003e\n\n\u003e Permission is hereby granted, free of charge, to any person obtaining a copy\n\u003e of this software and associated documentation files (the \"Software\"), to deal\n\u003e in the Software without restriction, including without limitation the rights\n\u003e to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\u003e copies of the Software, and to permit persons to whom the Software is\n\u003e furnished to do so, subject to the following conditions:\n\u003e\n\u003e The above copyright notice and this permission notice shall be included in\n\u003e all copies or substantial portions of the Software.\n\u003e\n\u003e THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\u003e IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\u003e FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\u003e AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\u003e LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\u003e OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\u003e THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashnkumar%2Fllm-full-stack-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashnkumar%2Fllm-full-stack-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashnkumar%2Fllm-full-stack-tutorial/lists"}