Codapult
Comment ça marchePlateforme IAArchitectureModulesMCPCLIPluginsTarifsDocsBlogDémo
Obtenir Codapult
Logo

Le boilerplate SaaS pour les créateurs

Obtenir Codapult

Projet

  • Tarifs
  • Architecture
  • Modules
  • Plateforme IA
  • MCP
  • CLI
  • Plugins
  • Blog
  • Documentation

Alternatives

  • Comparaison de templates SaaS
  • Codapult vs Supastarter
  • Codapult vs Makerkit
  • Codapult vs ShipFast
  • Codapult vs SaaSBold
  • Codapult vs Gravity
  • Codapult vs Nextbase
  • Codapult vs BuilderKit

À propos

  • FAQ
  • Contact

Mentions légales

  • Politique de confidentialité
  • Conditions d'utilisation

Featured on

Codapult on LaunchNestCodapult on LaunchNestbetterlaunch.cobetterlaunch.coFeatured on LaunchBuffFeatured on LaunchBuffCodapult on PeerPushCodapult on PeerPush
© 2026 Codapult. Tous droits réservés.Code source complet · Achat unique · Hébergement autonome
Tous les articles

Getting Started

  • Introduction
  • Quick Start
  • Project Structure
  • License and Permitted Use

Configuration

  • Environment Variables
  • App Configuration

Authentication

  • Authentication
  • OAuth Providers
  • Two-Factor & Passwordless
  • Enterprise SSO (SAML)

Database

  • Database
  • Migrations

Teams

  • Teams & Organizations
  • Permissions & RBAC
  • SCIM Provisioning

Payments

  • Payments & Billing
  • Stripe Setup
  • LemonSqueezy Setup
  • Polar Setup
  • Payment Webhooks

Api

  • API Layer
  • tRPC
  • GraphQL

Ai

  • AI Features
  • Streaming Chat
  • RAG and Semantic Search
  • Quotas and Memory

Email

  • Email
  • Email Templates

Infrastructure

  • Infrastructure
  • Self-Hosting
  • File Storage
  • Docker
  • Background Jobs
  • Terraform & Pulumi
  • Kubernetes

Ui

  • UI & Theming

I18n

  • Internationalization

Content Management

  • Content Management

Admin

  • Admin Panel

Security

  • Security

Monitoring

  • Analytics & Monitoring

Modules

  • Module Architecture
  • Waitlist
  • Audit Log
  • White-Labeling
  • Workflow Automation
  • A/B Testing
  • Welcome Page
  • Referrals
  • GDPR Export and Deletion
  • Outgoing Webhooks

Plugins

  • Plugin System
  • CRM Plugin
  • Helpdesk Plugin
  • Email Marketing Plugin

Deployment

  • Deployment
  • Troubleshooting

Upgrading

  • Upgrading Codapult

Developer Tools

  • AI Agents & IDEs
  • MCP Server
  • Testing
Ai

Streaming Chat

How the built-in AI chat uses Vercel AI SDK, model adapters, streaming responses, and tools.

Codapult includes a working AI chat surface, not just provider configuration. The module combines a dashboard chat UI, persisted conversations, a streaming API route, provider adapters, model selection, organization quotas, and optional RAG context injection.

src/components/ai/ChatUI is the only connected chat component. It is the production dashboard surface and owns conversation history, model selection, streaming transport, and rendering of both text and tool-call parts.

Runtime flow

  1. The user sends a message from src/components/ai/ChatUI.
  2. POST /api/ai/chat authenticates the session and validates the request.
  3. The route checks rate limits and organization AI quota.
  4. The selected model is resolved through src/lib/ai/providers.ts.
  5. RAG context is retrieved when enabled and appended to the system prompt.
  6. The response streams back through the Vercel AI SDK.
  7. Conversation and message rows are persisted for history.

Key files

FilePurpose
src/app/api/ai/chat/route.tsStreaming chat endpoint
src/components/ai/ChatUIConnected dashboard chat experience
src/components/ai/ToolCallStream.tsxTool-call progress and results
src/lib/ai/models.tsClient-safe model list
src/lib/ai/providers.tsProvider/model resolver
src/lib/ai/conversations.tsConversation and message persistence
src/lib/ai/rag.tsOptional retrieval context

Models

Models are declared in src/lib/ai/models.ts. Each entry has an ID, label, provider, SDK model ID, capabilities, and pricing. Unknown model IDs are rejected instead of being inferred from a name prefix.

To restrict the UI to a subset of models, set AI_ALLOWED_MODELS to a comma-separated list. The server page resolves the list and passes only serializable model metadata to the client component.

Tool calls

The chat route supports Vercel AI SDK tool calls. Add product-specific tools in /api/ai/chat/route.ts with a Zod parameter schema and an execute function. Keep tools small and domain-specific: lookup a record, update a workflow, fetch a report, or call an internal service.

ChatUI renders tool-call parts returned by the route through ToolCallStream. The component also accepts optional agent, debug, and message-cost data props for specialized server-backed integrations; those values must be supplied by the parent integration and are not generated by the basic chat route automatically.

Configuration

SettingLocation
Default modelAI_DEFAULT_MODEL
System promptsrc/lib/ai/system-prompt.ts
Allowed modelsAI_ALLOWED_MODELS
OpenAI keyOPENAI_API_KEY
Anthropic keyANTHROPIC_API_KEY

For an OpenAI-compatible custom endpoint, add the model to src/lib/ai/models.ts with provider: 'custom', then set CUSTOM_AI_BASE_URL and CUSTOM_AI_API_KEY. These variables configure the endpoint only; they do not create an arbitrary model entry.

Related docs

  • RAG and Semantic Search
  • Quotas and Memory
  • Environment Variables
AI FeaturesRAG and Semantic Search