Deploy Chat UI Pro Stack: Self Hosted HuggingChat with Bifrost and Mongo
The open chat app behind HuggingChat, on any model, with its own database.
Bifrost
Just deployed
/app/data
Just deployed
Just deployed
/var/lib/postgresql/data
MongoDB
Just deployed
/data/db
Deploy and Host Hugging Face Chat UI with Railway
Hugging Face Chat UI is the open source codebase that powers HuggingChat, a fast, self hosted chat interface for any OpenAI compatible model. This Pro Stack template runs it on Railway with MongoDB for storage and the Bifrost AI gateway in front, so every model call flows through one governed endpoint while conversations, users, and settings persist in your own database.
About Hosting Hugging Face Chat UI
The stack is four services: Chat UI, MongoDB, the Bifrost AI gateway, and Postgres. Chat UI serves the SvelteKit chat interface and stores all conversations, users, settings, and assistants in MongoDB. Bifrost holds your real provider keys and handles routing, failover, virtual keys, budgets, and request logging, with Postgres storing its configuration and logs. Chat UI points at Bifrost through a single base URL environment variable and automatically discovers whatever models Bifrost serves, so the app never holds a real provider key itself.
Common Use Cases
- Run a private, self hosted HuggingChat style interface for a team across any model provider.
- Keep conversations, users, and settings in your own MongoDB instead of a third party service.
- Put budgets and rate limits on shared AI usage so a single team cannot run up an unbounded bill.
- Switch or fail over between model providers centrally in Bifrost without touching the chat app.
Dependencies for Hugging Face Chat UI Hosting
- MongoDB for conversations, users, settings, and assistants.
- Postgres for Bifrost configuration and request log storage.
Deployment Dependencies
- Chat UI: https://github.com/huggingface/chat-ui
- Bifrost docs: https://docs.getbifrost.ai
- Bifrost Docker Hub: https://hub.docker.com/r/maximhq/bifrost
Why Deploy Hugging Face Chat UI on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
Running Chat UI with Bifrost on Railway gives you a private, multi model chat backed by your own database, with budgets, failover, and a request log under every message from day one.
Template Content
Bifrost
maximhq/bifrost:latestMongoDB
mongo:7
