Deploy LlamaIndex on Koyeb
Learn more about Koyeb
·
Explore the documentation
·
Discover our tutorials
Koyeb is a developer-friendly serverless platform to deploy apps globally. No-ops, servers, or infrastructure management.
This repository contains is designed to show how LlamaIndex applications can be deployed to Koyeb. The Dockerfile
in this repository builds an image that serves a LlamaIndex application with a Streamlit frontend that queries the OpenAI API about the short story "The Gift of the Magi" by O. Henry.
Follow the steps below to deploy the LlamaIndex application to your Koyeb account.
To use this repository, you need:
- A Koyeb account to build the Docker image and run the Dockerized application. If you don't already have an account, you can sign-up for free.
- An OpenAI API key so that our application can send queries to OpenAI.
The fastest way to deploy the LlamaIndex application is to click the Deploy to Koyeb button below.
Clicking on this button brings you to the Koyeb App creation page with most of the settings pre-configured to launch this application. You will need to replace the value for the following variable:
OPENAI_API_KEY
: Set to your OpenAI API key.
To modify this application example, you will need to fork this repository. Checkout the fork and deploy instructions.
If you want to customize and enhance this application, you need to fork this repository.
If you used the Deploy to Koyeb button, you can simply link your service to your forked repository to be able to push changes. Alternatively, you can manually create the application as described below.
On the Koyeb Control Panel, on the Overview tab, click the Create Web Service button to begin.
- Select GitHub as the deployment method.
- Choose the repository containing your application code.
- In the Builder section, select Dockerfile.
- Expand the Environment variables section and click Add Variable to configure a new environment variable. Create a variable called
OPENAI_API_KEY
. Select the Secret type and choose Create secret in the value. In the form that appears, create a new secret containing your OpenAI API key. - Choose a name for your App and Service, for example
example-llamaindex
, and click Deploy.
A container image for the LlamaIndex application will be built and a container will be deployed to Koyeb. You can follow the build process as the repository is cloned, built, and deployed. Once the deployment is complete, it will be accessible using the Koyeb subdomain for your service.
If you have any questions, ideas or suggestions regarding this application sample, feel free to open an issue or fork this repository and open a pull request.