Aimform

Deployment

@aimform/ai is environment-agnostic. The core AI class only needs implementations of its adapter interfaces. Choose your platform:

  • Cloudflare — Workers + Workflows + Durable Objects (recommended)
  • AWS — Lambda + API Gateway + Step Functions + RDS
  • VPS — Node.js + PostgreSQL + WebSocket on any server

What changes per environment

ComponentCloudflareAWSVPS
ComputeWorker fetch handlerLambda handlerExpress/Fastify server
DatabaseD1DatabaseAdapterRDS via pg poolPostgres via pg pool
TransportAgentsSDKTransportAdapterAPI Gateway WebSocketws library
Durable executionWorkflowEntrypointStep FunctionsIn-process
File storageR2S3Local / MinIO
Secretswrangler secretSSM Parameter Store.env / Doppler

The pattern

// Environment-agnostic setup
const ai = new AI({
  model,        // Same everywhere
  apiKeys,      // From env-specific secrets manager
  db,           // Any DatabaseAdapter implementation
  transport,    // Any ChatTransportAdapter implementation
  plugins,      // Swap providers per environment
});

The AI class, ChatEngine, memory system, and all plugin interfaces are identical across environments. Only the adapter implementations change.

On this page