Self-Hosting
You have the option to self-host your own instance of Promptmodel. We provide both Docker Compose and Railway templates for easy setup.
Railway Template
You can easily deploy your own instance of Promptmodel
with our Railway Template.
You should update 2 environment variables after deploying.
- frontend
BACKEND_PUBLIC_URL
is the url of the backend server. It should be updated to backend's public url created by Railway.FRONTEND_PUBLIC_URL
is the url of the frontend server. It should be updated to frontend's public url created by Railway.
- backend
FRONTEND_PUBLIC_URL
is the url of the frontend server. It should be updated to frontend's public url created by Railway.
Docker
Requirements: docker and docker compose, both included in Docker Desktop
Start
Before deploying, you need to configure the following environment variables in the .env
file:
# .env
NEXTAUTH_SECRET=yoursecret # Required
POSTGRES_USER=yourusername # Optional, postgres by default
POSTGRES_PASSWORD=yourpassword # Optional, postgres by default
POSTGRES_DB=dbname # Optional, postgres by default
POSTGRES_PORT=5432 # Optional, 5432 by default
BACKEND_PUBLIC_URL=http://localhost:8000
FRONTEND_PUBLIC_URL=http://localhost:3000
-
Postgres variables
POSTGRES_DB
,POSTGRES_USER
andPOSTGRES_PASSWORD
are the credentials for the postgres database.POSTGRES_PORT
is the port on which the postgres database is running. We recommend using the default port5432
.
-
Authentication secret key
NEXTAUTH_SECRET
is a secret for the authentication. We use next-auth (opens in a new tab) for authentication.
-
Endpoint urls
BACKEND_PUBLIC_URL
is the url of the backend server. It should be updated to backend's public url.FRONTEND_PUBLIC_URL
is the url of the frontend server. It should be updated to frontend's public url.
After you have configured the environment variables, you can start the container with the following command:
docker compose up
-> Visit http://localhost:3000 (opens in a new tab) (or frontend public URL)
This will build the docker images of a Next.js frontend, FastAPI backend server, postgres database, redis and postgres-redis listener for realtime.
Upgrade
cd promptmodel
git pull
docker compose down
docker compose build --no-cache
docker compose up
Connect to codebase
You can connect your codebase with the self-hosted Promptmodel by Python SDK.
Support
If you encounter any issues, you can ask for help on Discord (opens in a new tab).