Skip to content

[chatbot-demo]: Add Vercel serverless deployment config#1

Open
jonah-berman wants to merge 1 commit intomainfrom
devin/1769820999-vercel-deploy
Open

[chatbot-demo]: Add Vercel serverless deployment config#1
jonah-berman wants to merge 1 commit intomainfrom
devin/1769820999-vercel-deploy

Conversation

@jonah-berman
Copy link
Copy Markdown
Contributor

Summary

Converts the Express.js backend to Vercel serverless functions to enable deployment on Vercel. Creates two API endpoints (/api/chat and /api/chat/stream) that replicate the existing server.js functionality, plus a vercel.json configuration file.

The serverless functions include all the Exa search logic, OpenRouter LLM integration, and system prompts inline (duplicated from the original server.js/exa.js/prompt.js files).

Review & Testing Checklist for Human

  • Configure environment variables in Vercel: OPEN_ROUTER_KEY and EXA_API_KEY must be set in the Vercel project settings before the deployment will work
  • Test SSE streaming: Verify that /api/chat/stream correctly streams responses - SSE in Vercel serverless can behave differently than Express
  • Verify maxDuration: The 60s function timeout requires Vercel Pro plan; if on Hobby plan, functions timeout at 10s which may not be enough for LLM + search operations
  • Test the deployed app end-to-end: Send a chat message, verify Exa search triggers, and confirm the response streams back correctly

Notes

The code in api/chat.js and api/chat/stream.js is largely duplicated - this was done intentionally to keep the serverless functions self-contained, but could be refactored to share common modules if this becomes a maintenance burden.

Requested by: @jonah-berman
Link to Devin run: https://app.devin.ai/sessions/e718255bc0da453a9e25487a80118e85

Co-Authored-By: jonah@exa.ai <jonah@exa.ai>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant