streamlit_io.mdx 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ---
  2. title: 'Streamlit.io'
  3. description: 'Deploy your RAG application to streamlit.io platform'
  4. ---
  5. Embedchain offers a Streamlit template to facilitate the development of RAG chatbot applications in just three easy steps.
  6. Follow the instructions given below to deploy your first application quickly:
  7. ## Step-1: Create RAG app
  8. We provide a command line utility called `ec` in embedchain that inherits the template for `streamlit.io` platform and help you deploy the app. Follow the instructions to create a streamlit.io app using the template provided:
  9. ```bash Install embedchain
  10. pip install embedchain
  11. ```
  12. ```bash Create application
  13. mkdir my-rag-app
  14. ec create --template=streamlit.io
  15. ```
  16. This will generate a directory structure like this:
  17. ```bash
  18. ├── .streamlit
  19. │ └── secrets.toml
  20. ├── app.py
  21. ├── embedchain.json
  22. └── requirements.txt
  23. ```
  24. Feel free to edit the files as required.
  25. - `app.py`: Contains API app code
  26. - `.streamlit/secrets.toml`: Contains secrets for your application
  27. - `embedchain.json`: Contains embedchain specific configuration for deployment (you don't need to configure this)
  28. - `requirements.txt`: Contains python dependencies for your application
  29. Add your `OPENAI_API_KEY` in `.streamlit/secrets.toml` file to run and deploy the app.
  30. ## Step-2: Test app locally
  31. You can run the app locally by simply doing:
  32. ```bash Run locally
  33. pip install -r requirements.txt
  34. ec dev
  35. ```
  36. ## Step-3: Deploy to streamlit.io
  37. ![Streamlit App deploy button](https://github.com/embedchain/embedchain/assets/73601258/90658e28-29e5-4ceb-9659-37ff8b861a29)
  38. Use the deploy button from the streamlit website to deploy your app.
  39. You can refer this [guide](https://docs.streamlit.io/streamlit-community-cloud/deploy-your-app) if you run into any problems.
  40. ## Seeking help?
  41. If you run into issues with deployment, please feel free to reach out to us via any of the following methods:
  42. <Snippet file="get-help.mdx" />