modal_com.mdx 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ---
  2. title: 'Modal.com'
  3. description: 'Deploy your RAG application to modal.com platform'
  4. ---
  5. Embedchain has a nice and simple abstraction on top of the [Modal.com](https://modal.com/) tools to let developers deploy RAG application to modal.com platform seamlessly.
  6. Follow the instructions given below to deploy your first application quickly:
  7. ## Step-1 Create RAG application:
  8. We provide a command line utility called `ec` in embedchain that inherits the template for `modal.com` platform and help you deploy the app. Follow the instructions to create a modal.com app using the template provided:
  9. ```bash Create application
  10. pip install embedchain[modal]
  11. mkdir my-rag-app
  12. ec create --template=modal.com
  13. ```
  14. This `create` command will open a browser window and ask you to login to your modal.com account and will generate a directory structure like this:
  15. ```bash
  16. ├── app.py
  17. ├── .env
  18. ├── .env.example
  19. ├── embedchain.json
  20. └── requirements.txt
  21. ```
  22. Feel free to edit the files as required.
  23. - `app.py`: Contains API app code
  24. - `.env`: Contains environment variables for production
  25. - `.env.example`: Contains dummy environment variables (can ignore this file)
  26. - `embedchain.json`: Contains embedchain specific configuration for deployment (you don't need to configure this)
  27. - `requirements.txt`: Contains python dependencies for your FastAPI application
  28. ## Step-2: Test app locally
  29. You can run the app locally by simply doing:
  30. ```bash Run locally
  31. pip install -r requirements.txt
  32. ec dev
  33. ```
  34. ## Step-3: Deploy to modal.com
  35. You can deploy to modal.com using the following command:
  36. ```bash Deploy app
  37. ec deploy
  38. ```
  39. Once this step finished, it will provide you with the deployment endpoint where you can access the app live. It will look something like this (Swagger docs):
  40. <img src="/images/fly_io.png" />
  41. ## Seeking help?
  42. If you run into issues with deployment, please feel free to reach out to us via any of the following methods:
  43. <Snippet file="get-help.mdx" />