Deploy Moyai

Background coding agent from the LiteLLM team, always on.

Deploy Moyai

/data

Deploy and Host Moyai on Railway

Run Moyai, the self-hosted background coding agent from the LiteLLM team, on Railway. Give it a task in chat, then close your laptop. The agent keeps working in its own cloud computer, and you can steer it, answer its questions and download its files from any browser.

About Hosting Moyai

Moyai is a shared AI workspace for coding and connected-service tasks. You chat with an agent, and it works on a real Linux computer: it writes and runs code, uses a browser and keeps the results. Pydantic AI runs the agent, Temporal makes each task durable, LiteLLM (or any OpenAI-compatible gateway) supplies the model, and Modal provides the agent's computer.

This template runs Moyai's single-container mode on one Railway service. That's the web app, a worker and a local Temporal server, with SQLite and encrypted files on a Railway volume. It suits one person or a small team. For a larger team, Moyai's own guide covers a split deployment with PostgreSQL, S3 storage and Temporal Cloud.

Common Use Cases

  • Hand off coding tasks ("fix this failing test", "add an endpoint") and check back later from your phone.
  • Run long agent tasks that would stop if your laptop slept.
  • Give a small team one place to run and review agent work, with history and files kept.
  • Try Moyai without installing Docker on your own machine.

Dependencies for Moyai Hosting

  • A Railway account.
  • A model gateway with a Responses-capable model, either your own LiteLLM proxy or any OpenAI-compatible HTTPS endpoint, plus its API key.
  • A Modal account and a token pair (modal token new). Modal's Starter plan includes free monthly compute credits. Agent computers run there and are billed by Modal.

Deployment Dependencies

Implementation Details

PartWhat it does
Moyai servicemoyai dev on Railway's PORT: web app, embedded worker and local Temporal server.
Volume at /dataSQLite database, Temporal history, encrypted files and the generated encryption key. Keep it.
/healthHealth check. It returns OK once the database answers.
Sign-inMoyai's own login: user admin and a password generated for you at deploy.

Variables:

VariableRequiredPurpose
WORKSPACE_PASSWORDyesSign-in password for admin, generated at deploy.
LITELLM_API_BASEyesHTTPS base URL of your model gateway, ending in /v1.
LITELLM_API_KEYyesAPI key for that gateway.
AGENT_MODELyesModel name as your gateway knows it. It must support the Responses API.
MOYAI_MODELSnoComma-separated models offered in the model picker. Defaults to AGENT_MODEL.
MODAL_TOKEN_IDyesModal token ID for the agent's computer.
MODAL_TOKEN_SECRETyesModal token secret.
MOYAI_PUBLIC_URLset for youYour Railway HTTPS address. Moyai checks it on every form submit.
MOYAI_SECURE_COOKIESset for youtrue, because Railway serves HTTPS.

How to Use Moyai After Deployment

  1. Wait for the first start, about 2 minutes. Until the web server is up, the URL returns 502.
  2. Open the Railway URL and sign in as admin with WORKSPACE_PASSWORD (Railway shows it under the service's Variables).
  3. Try a first task: "Create /workspace/hello.py that prints Hello from Moyai, run it, and save it for download." The chat should show the output and a file to download.
  4. Connect GitHub, Slack or other services under Settings when you need them.

If a task fails straight away, check LITELLM_API_BASE, AGENT_MODEL and the Modal token pair first. The service starts without them, but tasks can't run.

Resource use measured on Railway: about 520 MB of memory and almost no CPU when idle (roughly US$5–6 a month at Railway's list prices). Agent computers run on Modal and are billed there.

Why Deploy Moyai 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.

By deploying Moyai on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


This template is a community wrapper and is not made by the Moyai or BerriAI team. Moyai is © its authors under the MIT licence.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
118
View Template
Weaviate
Vector database with hybrid search and an API key-protected API

GitHub Locker
1
View Template
Möbius Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

Tracklayer
4