Skip to content

Auto-wired Services

Varity Team Core Contributors Updated May 2026

When you deploy with Varity, the platform reads your package.json or requirements.txt and automatically provisions the databases and services your app depends on. You do not write any configuration files.

The services start alongside your app when you deploy. No extra steps needed.

Varity scans your dependency files for known packages and maps them to services:

  1. You add a database library to your project (for example, pg or mongoose)
  2. You deploy with varitykit app deploy
  3. Varity detects the library and starts the matching service automatically
  4. Your app receives the connection URL as an environment variable

You do not configure ports, credentials, or connection strings. Varity handles all of that.

DependencyService ProvisionedEnvironment Variable Injected
pgPostgres databaseDATABASE_URL
@prisma/clientPostgres databaseDATABASE_URL
drizzle-ormPostgres databaseDATABASE_URL
postgresPostgres databaseDATABASE_URL
ioredisRedis cacheREDIS_URL
redisRedis cacheREDIS_URL
@vercel/kvRedis cacheREDIS_URL
@langchain/ollamaAI model serverOLLAMA_URL
ollamaAI model serverOLLAMA_URL
mongooseMongoDB databaseMONGODB_URI
mongodbMongoDB databaseMONGODB_URI
DependencyService ProvisionedEnvironment Variable Injected
psycopgPostgres databaseDATABASE_URL
psycopg2Postgres databaseDATABASE_URL
psycopg2-binaryPostgres databaseDATABASE_URL
asyncpgPostgres databaseDATABASE_URL
redisRedis cacheREDIS_URL
ollamaAI model serverOLLAMA_URL
pymongoMongoDB databaseMONGODB_URI

If your project includes a prisma/schema.prisma file, Varity reads the datasource block to confirm which database to provision:

provider valueService Provisioned
postgresqlPostgres database
mongodbMongoDB database

Postgres Database

A relational database for structured data. Includes vector extension support, which means you can store and query embeddings for AI features without any additional setup.

Your app receives DATABASE_URL automatically.

Redis Cache

An in-memory key-value store for caching, sessions, and queues. Ideal for rate limiting, temporary data, and speeding up repeated queries.

Your app receives REDIS_URL automatically.

AI Model Server

A local model runtime so your app can run language models without calling an external API. Useful for apps with on-device inference or privacy requirements.

Your app receives OLLAMA_URL automatically.

MongoDB Database

A document database for flexible, schema-optional data. Good for apps where data shape varies across records.

Your app receives MONGODB_URI automatically.

If your package.json contains:

{
"dependencies": {
"next": "^14.0.0",
"@prisma/client": "^5.0.0"
}
}

Running varitykit app deploy will:

  1. Detect Next.js as the framework
  2. Detect @prisma/client and provision a Postgres database
  3. Inject DATABASE_URL into your app’s runtime environment
  4. Start both your app and the database together

Your Prisma client will connect automatically using the injected URL.

Example: FastAPI App with Redis and MongoDB

Section titled “Example: FastAPI App with Redis and MongoDB”

If your requirements.txt contains:

fastapi
redis
pymongo

Running varitykit app deploy will:

  1. Detect FastAPI as the framework
  2. Detect redis and provision a Redis cache
  3. Detect pymongo and provision a MongoDB database
  4. Inject REDIS_URL and MONGODB_URI into your runtime environment

Your app code reads these variables the same way it would in any environment:

Next.js / Node.js
const db = new PrismaClient({
datasources: { db: { url: process.env.DATABASE_URL } }
});
Python (FastAPI)
import os
from motor.motor_asyncio import AsyncIOMotorClient
client = AsyncIOMotorClient(os.environ["MONGODB_URI"])

You do not need to add these variables to .env files yourself. Varity injects them at deploy time.