Deployment
Deploy Ross AI to Vercel with environment variables and path-based documentation.
Deployment
Ross AI is designed for Vercel serverless functions.
Deploy the app
- Push the repo to GitHub
- Import the project in Vercel (framework preset: Next.js)
- Deploy — no build command changes needed
Environment variables
In Vercel → Project → Settings → Environment Variables, add:
| Variable | Environments | Notes |
|---|---|---|
OPENAI_API_KEY | Production, Preview | Your OpenAI secret key |
NEXT_PUBLIC_APP_URL | Production | e.g. https://ross-ai-nine.vercel.app |
NEXT_PUBLIC_DOCS_URL | Optional | Only if using a custom docs subdomain (see below) |
If
OPENAI_API_KEYis only set for Preview, production will return 503. Enable it for Production and redeploy.
Documentation URL
Production docs are served at:
https://ross-ai-nine.vercel.app/docs
No extra Vercel domain setup is required. Navbar and footer "Docs" links point to /docs on the same host.
Why not docs.ross-ai-nine.vercel.app?
Vercel does not support subdomains of the default *.vercel.app hostname (no DNS or SSL for docs.project-name.vercel.app). Attempting to open that URL will fail with a connection error.
If you need a separate docs hostname later:
- Buy or use a custom domain (e.g.
ross-ai.com) - Add
docs.ross-ai.comin Vercel → Domains with a CNAME to Vercel - Set
NEXT_PUBLIC_DOCS_URL=https://docs.ross-ai.comand re-enable subdomain middleware in the repo
Production limits
| Limit | Value | Why |
|---|---|---|
| Max PDF size | 4 MB | Vercel serverless request body limit (~4.5 MB) |
| Contract text sent to OpenAI | ~15,000 chars | Cost control |
| Function timeout | 60 s | maxDuration in the API route |
| Rate limit | 10 requests / 15 min / IP | Abuse protection |
PDF parsing on Vercel
Production uses unpdf (pure JavaScript) instead of pdf-parse, which relies on native bindings that fail in serverless Linux environments.
Redeploy checklist
-
OPENAI_API_KEYenabled for Production - Latest commit deployed (includes unpdf fix)
- Docs reachable at
/docson your production URL - Test with a PDF under 4MB