AI

Learn how to integrate AI into your project.

ship.pluv.io templates include an AI integration for you to use out-of-the-box, and includes AI-powered utilities to help you ship your products faster.

AI Integration

The @workspace-apps/web app includes an existing AI integration built with the AI SDK and OpenRouter.

The AI SDK is a TypeScript/React SDK for building conversational AI experiences using streaming AI responses. OpenRouter is a unified API layer for accessing multiple LLM providers.

Using both of these together, you can build conversational AI features quickly with the AI SDK, then hot-swap the LLM providers with a different one without having to change any of your code.

Setup

To get started, you will need to create an account on OpenRouter and create an API key.

Once you have your API key, you can add it to your .env file.

/apps/web/.env
OPEN_ROUTER_API_KEY="your-api-key-here"

Then, because the templates currently use GPT-4o-mini, you will need to create an account on OpenAI and create an API key.

Once you have your API key, you can add it to your .env file.

/apps/web/.env
OPENAI_API_KEY="your-api-key-here"

With this, you can see the included AI integration in action in the following files:

  1. /apps/web/src/app/(app)/[teamSlug]/[projectSlug]/chat/page.tsx
  2. /apps/web/src/server/router/chat/router.ts
  3. /apps/web/src/server/router/projects/router.ts
    • In the POST /:urlSlug/chat route

AI Utilities

llms.txt

Important

This feature is only included for the following templates:

Cloudflare Monorepo
Vercel Monorepo

The llms.txt file is a publically accessible file that is intended to be parsed by AI agents to have a better understanding of the product(s) you offer. This can later be used to integrate with other AI-powered services to power things such as:

  1. Product search
  2. Automated live support
  3. Automated guides and onboarding

It is automatically generated by the @workspace-apps/docs app. As you add more documentation to your product, the llms.txt file will be updated to include the new documentation.

.cursor/rules

If you are using Cursor to edit your code, you can use Cursor Rules to add rules for your AI agent to follow. They can be used to enforce coding standards, or to help the AI agent understand the codebase better.

The ship.pluv.io templates include multiple .cursor/rules that explains each package and app in the monorepo. This should help you better use AI agents to generate code with better context.

Helpful Prompts

Important

The prompts provided do not consistute legal advice. Please consult a lawyer if you are unsure about any legal implications of your product.

The /resources directory contains helpful prompts that you can paste into chats like ChatGPT including:

  1. A privacy policy builder
  2. A terms of service builder